Is it possible to project texture based on camera view.

Hi all,

I want to project the texture on geometry using camera mapping method but I couldn’t figure out how to do that in UE4. The attached images are examples that I want to achieve which I’ve made using Cinema 4D. Basically what I want is to project the texture based on specified camera view.

I have already tried using ScreenPosition node in Material editor in UE4 but it could only be used for current camera but I want to map the texture based on multiple different cameras so that I can have a view just like the second image I attached.

Any help & advice is appreciated. Thanks!

Hi Kibblesticks,

Thank you for your infos! I’ve tried decals but decals are more like planar projection but what I would want to achieve is square pyramid projection based on the perspective of the camera.

Panning the texture sounds like an idea which I would want to try. I was just not sure if it would work if there were multiple objects in various depth position from the camera view with the same projected material still works (without perspective offset for each object) with this method.

Take a look at this thread: Projection Mapping technique to projects video files on objects? - Rendering - Epic Developer Community Forums

Ryan Brucks (badass tech artist from Epic) gave a solution, and “Scribbler” worked on one too took some of Ryan’s advice into his implementation, and released some .uasset’s that do exactly what you’re looking for.

I played with it a little bit, the implementation is using decals right now, but I’m sure you could just apply a material instead of using decals.

Thank you again, I will take a look at “find look-at rotation” node and see if I can use it.

Thank you Ruffian! This sounds really promising. I will try this asap and see if it works for me.

I’ve tried the Scribbler’s work but unfortunately this wouldn’t work for me since it still is a flat plane projection but doesn’t consider the camera perspective as shown in screenshot attached… I would want the texture to be seamless when I look from the camera.

192982-スクリーンショット+(2).png

Not sure how useful this would be but you could maybe look into decals?

Otherwise I’d imagine you’d need to alter the object’s material to orient the texture to the camera by adjusting the texture coordinates via a pan node. I can’t explain the full set up, but you can find more info on this by looking up panning textures.

I suspect the objects would have to use a “find look-at rotation” node (in their blueprint) and use that to effect the dynamic material’s pan parameter. I couldn’t tell you exactly how to set it up without experimenting, but in theory it should be possible.

Scribbler’s work does work. Be sure to reselect Projection Camera in projected_decal, after changing position of the camera. This way you refresh the mapping.

Also make sure you are looking through the projection camera and not a plain perspective angle.

If you move the camera while looking through it you will have to refresh the mapping by reselecting the camera as described above.

If we exclude the refreshing problem, Scribbler’s solution works as advertised, good work.

Hi!! have you solved this problem now?