{"id":699,"date":"2023-09-07T17:21:08","date_gmt":"2023-09-08T00:21:08","guid":{"rendered":"http:\/\/fx-td.com\/houdiniandchill\/?p=699"},"modified":"2023-09-07T17:28:08","modified_gmt":"2023-09-08T00:28:08","slug":"archived-post-by-mattiasmalmer","status":"publish","type":"post","link":"http:\/\/fx-td.com\/houdiniandchill\/2023\/09\/07\/archived-post-by-mattiasmalmer\/","title":{"rendered":"Archived post by mattiasmalmer"},"content":{"rendered":"<div class=\"postie-post\">\n<p class=\"\">how do i get the cameras uv space in a materialx shader? i want to do projective texturing in the shader.<\/p>\n<p class=\"\">This works half-assedly but only on CPUkarma. I load the hit position in worldspace. transform it to cameraspace (using space:camera in the transformpoint) then divide that with hit distance to get a projection. (using ray:hitPz in the mtlxdot) but the camera:space thing does not work in XPU.<br \/>\nI thought this would be the easiest thing ever. anyone having any better tricks?<\/p>\n<p class=\"\">generating precooked uv data on the geo from the camera is not as good as one tends to get projection errors over larger polygons and such.<\/p>\n<p class=\"\">ok after the longest time mucking about I found how it is actually done:<br \/>\nYou use the coordsys node in LOP:s to define the coordinate system and reference the camera.  Then use that coordsys in a mtlxposition and use myCoordinateSysName:ndc to get it in the camera projection space. Neat because then you can use any camera as a projector and so forth.<\/p>\n<p class=\"\">aw frekk. does not work in xpu.<\/p>\n<p>Attachments in this post: <br \/><a href=\"http:\/\/fx-td.com\/houdiniandchill\/wp-content\/uploads\/discord\/20232109\/07\/23\/image.png\">http:\/\/fx-td.com\/houdiniandchill\/wp-content\/uploads\/discord\/20232109\/07\/23\/image.png<\/a><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>how do i get the cameras uv space in a materialx shader? i want to do projective texturing in the shader. This works half-assedly but only on CPUkarma. I load the hit position in worldspace. transform it to cameraspace (using space:camera in the transformpoint) then divide that with hit distance to get a projection. (using &hellip; <a href=\"http:\/\/fx-td.com\/houdiniandchill\/2023\/09\/07\/archived-post-by-mattiasmalmer\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Archived post by mattiasmalmer<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[5],"tags":[],"_links":{"self":[{"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/posts\/699"}],"collection":[{"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/comments?post=699"}],"version-history":[{"count":0,"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/posts\/699\/revisions"}],"wp:attachment":[{"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/media?parent=699"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/categories?post=699"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/fx-td.com\/houdiniandchill\/wp-json\/wp\/v2\/tags?post=699"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}