I am attemting an unlit shader that color tints an object depending on its relation to the world axis. As an example, any normals of a rotating object facing the world-x axis would get tinted with agreen color.
Is there any optimized way to get the world rotation from within the shader?
Would it be better/(more optimized) to supply it as a parameter through code to the shader?
@GGeff : If I was not dependent on the objects normals, a script would work. I think I would avoid iterating through all those meshes normals in script if I can put that work on the gpu instead.
@ -belik: Thanks, but not quite what I am looking for. I need some way to get the rotation relation between the vertex normal and the world axis.
Aha! Found what I was looking for, and ironically it brought me back to where I first started, with _Object2World. The reason it did not work before was the order:
The effect was that I no longer got the proper rotation of the normal if I had the wrong order. I hope anyone following in my footsteps can benifit from this.