iamjaideep80 Posted March 6, 2007 Share Posted March 6, 2007 Hi Everybody.... I am trying to create a Terrain Shader. I have written Displacement shader, and facing a problem while writing surface shader. I want to shade the surface based on the slope, say Green for Horizontal surface and Red for vertical surface. Polygon Normal's Y component varies from 0 to 1 for Horizontal To Vertical. So I have a Spline which has Normal.Y as the input. It is giving me result, but the shader is changing as I move the camera. I tried all space combinations inside Vops. But not working. What can be the problem??? ----iamjaideep80 Jaideep Khadilkar TD, Sciclone Motion Graphics Quote Link to comment Share on other sites More sharing options...
rdg Posted March 6, 2007 Share Posted March 6, 2007 Hi Everybody....I am trying to create a Terrain Shader. I have written Displacement shader, and facing a problem while writing surface shader. I want to shade the surface based on the slope, say Green for Horizontal surface and Red for vertical surface. Polygon Normal's Y component varies from 0 to 1 for Horizontal To Vertical. So I have a Spline which has Normal.Y as the input. It is giving me result, but the shader is changing as I move the camera. I tried all space combinations inside Vops. But not working. What can be the problem??? ----iamjaideep80 Jaideep Khadilkar TD, Sciclone Motion Graphics This is just guessing: The Colors change because the normal you use depends on the camera. You could add a explicit normal attribute reference this in your shader. Georg Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.