- Home /
How to start gradient for dissolve shader at specific spot on mesh
I'm building a dissolve shader that uses a simple linear gradient. I'd like to 'start' the gradient (the fully opaque part) at the spot on the mesh that is closest to a specific reference object's transform.
I know how to make the gradient reference UV space, world space or object space - but this seems to be a problem of distance and direction relative to object space.
This shader: http://answers.unity3d.com/questions/14931/how-to-detect-in-a-shader-if-two-objects-are-close.html shows how to get a shader to reference another object. But I can't see how to apply it to my situation.
Anybody have any pointers? Your thoughts are very much appreciated.
Comment