I’m trying to create a camera projected texture. It looks like it’s possible to use the CameraVectorWS node in the material editor to project a texture from the current camera, but it’s not quite what I’m looking for.
Instead, I’d like to project a series of textures from a series of static cameras. Is there an equivalent to the CameraVectorWS would let me create a projection from an arbitrary camera?
you might want to look into using the TransformToZVector node to transform the world position. just plug the desired “camera” vector into the Z Vector socket and mask the result by R & G to get world projected UVs aligned with your vector.
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?
the decal size is measured from the center of the decal box iirc, so you’ll have to offset the decal location along the camera vector by half the size for not having it affect the camera and everything behind it.
Pixel-perfect camera projections in Unreal Engine!
Ran into some issues with skylights and deferred decals, which seems to be an ongoing issue with the engine - but the camera projection element worked fine. Here’s my ugly ‘proof of concept’:
It’s a blueprint + a material - what’s the most elegant way to package this up so I can share it?
I need to dig the tool out for a project I’m working on - haven’t touched it for a while. May take a bit of time to post it here, but I’ll see what I can do!
Hi _Scribbler, I’d love to see how you made this as I am a Matte Painter trying out Unreal Engine, would it be possible to post screenshots of the graphs?
Hi all. Im a bit of a noob with blueprints and UE in general. I need to project an image using a camera. This thread SOUNDS like it has solved the problem but there isn’t any blueprints or screengrabs associated with what _scribbler has done.
Can anyone help me or give me some simple noob advice please?