How to go from World Position to Texture Coordinates?

Hello everyone !

For a prototype I’m working on, I created a dynamic texture to obtain a fog of war effect.
This texture is updated with a timer to display a brighter circle, origin being the position of my pawn.
I display this texture with a post process material using an Absolute World Position node.

My problem is :
How do I convert the Actor Position of my Pawn to the coordinates of the texture ?
Actually, I found empirically that dividing by 9.3 the Actor Position X and Y allow me to find the right point in the texture. But I can’t be happy with such an approximative solution :slight_smile:

Thank you for your help !

First You need to bind UV space to World space. Your case is just a coincidence that You able to do that by just multiplication.

There’s many ways to do so, but main is by using Absolute World Position for UV.

Then You need to feed Your Actor’s position to the material. This can be done by using Material Instance Dynamic parameters controlled by blueprint.

Hello, thank you for your answer !

Actually, I found no ways of doing the “erasing” operation in a material.
The texture is updateded each time the character moves, and redrawn. The blendable material only owns the redrawn texture.
It is at the redrawing moment done in C++ code that I would need the World position to UV operation.

Is there any way of doing it outside of material edition ?