Post Process texture that doesn't move with camera

Hello,

I’m trying to do a distant fog / smoke effect in one of my projects. I’m attempting to do this via a post process blendable. Generally it’s working well, but I cannot figure out how to do one specific thing.

The distant effect is driven by a texture based modification of the scene image. This is working very well until I rotate the camera, and the distant effect moves along with the rotation of the camera - breaking the effect entirely.

Is there any way to map the texture or the coordinates of the texture to world space so that when I rotate the camera left or right, the texture itself is offset or moved left or right?

I attempted to do this by getting the camera direction vector and distilling it down into a variable that could then be used for the time slot in a panner… and it almost works, but after spinning the camera 90 degrees it stops offsetting properly.

What is the best way to get the rotation or direction of the camera entirely within the material, and distill it’s rotation down into a single number which I can then do things with?

(Or if you can think of a better way to do this effect that doesn’t involve attaching a massive sphere to the player character, I would definitely appreciate the help)

Thank you for your time.

I believe there’s a material function called “TriplanarCameraVector” which can do this for you.

Absolutely exactly what I was looking for. Thank you very much!

Hello everyone ! I found this post due to the fact that I ran into a similar problem. Could you guys leave a reply about how you managed to stop making the postprocess effect move with the camera ? I am trying to make an item highlight system using post process material but the highlight moves when I move the camera. How can I stop it ? Any help is greatly appreciated. Thank you !

We used the “TriplanarCameraVector” node in the post process material. This is a screenshot of the material we used in in: http://i.imgur.com/S6p0Gaz.png

In our case, we we creating a form of noise effect, so we used the node twice with the same texture but different values, and then merged them together.