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 :)
Thank you for your help !
asked Mar 25 '17 at 11:54 AM in C++ Programming
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.
Follow this question
Once you sign in you will be able to subscribe for any updates here