I’ve made some good progress on this today - with a lot of help from This nuke tutorial on position pass projection
Here’s the material:
And here’s the blueprint that spawns the projection camera, and attaches a decal to it
Still having some issues, though.
Issue 1: Using the ‘TransformToZVector’ node works perfectly (Thanks divi!) - but only if the camera has no Z rotation. I’ve been trying to use the ‘RotateAboutAxis’ node to rotate the world position data to account for camera Z rotation, but for some reason it breaks everything.
Issue 2: The projection appears both in front AND behind the camera. The texture edges also ‘smear’ to infinity (the screenshot only looks good because the underlying texture is emissive, and the edges of the projection are black). Not sure how to remove everything outside the camera field of view.
Seems like it’s almost there - does anyone have any suggestions of how to get these kinks worked out?