- Home /
Convert World to UV coordinates
I am using ParticleSystem OnParticleCollision to track impact of particles to an object. My intend is to modify the texture of the object hit at the impact point, i.e. adding bullet holes to the wall. Due to the amount of impacts (it is more like a rain shower) I want to paint into the texture for performance reasons.
ParticleCollisionEvent just gives me the intersection point in world coordinates. So far I am using a ComputeShader, providing the intersection coordinates via ComputeBuffer, a RWtexture (RenderTexture) as the canvas and the Object transform, this is working fine for a Quad. As X and Y coordinates in Object CoordinateSystem match texture UV coordinates. But how to do for more complex "3D mesh" objects? How to convert world coordinates to UV / Texture coordinates?
Your answer
Follow this Question
Related Questions
How can I convert the texture coordinates of the multi-spite to 0-1? 0 Answers
Let Particles sit on Collider without triggering callback - OnParticleCollisionEnter? . 1 Answer
Mysterious plane created on enabling particle collision 1 Answer
Basic surface shader question ... 0 Answers
Creating cube in script/ texture stretches on all sides but top and bottom? 1 Answer