- Home /
Access GameObject position and model position in surface shader?
How can I access the GameObject position in a surface shader? I know I can get worldPos, but I'd like to change the Albedo depending on where the where the GameObject is situated, and the position on the mesh relative to that location. Ideally I'd use the model position rather than world position as I don't want it to change if the object is rotated. Is this possible?
If it isn't possible, can I write my own vertex and pixel shaders that still use Unity's lighting model? What other options do I have?
Your answer
Follow this Question
Related Questions
Is the documentation for surface shader custom lighting functions wrong? 1 Answer
how to stop the camera to follow the player on his jump movement ? 2 Answers
Smooth Camera/Object Movement 1 Answer
why does IN.screenPos in a surface shader have different Z values on Windows and Android? 2 Answers
Deviating from path while falling down. 3 Answers