barad_dur Posted February 8, 2011 Share Posted February 8, 2011 Hello all, I am trying to figure out how to put together a surface shader that uses the camera position, relative to an object, to light that object with a falloff-type ramp. I was thinking that in the shader I would pass a Parameter the camera position and take it into a Dot Product along with a normalized Surface Normal from the Surface Globals but it is apparent now that I am just grasping at straws. The goal is that no matter how the object is lit with regular scene lights the object that the camera is looking at (maybe I should pass Direction from Eye??) will be lit as if the camera was a light. I could do this by parenting a light to the camera but I'd like to do this at the shader level so I can control the falloff via a ramp parameter. Any advice would be appreciated. Thank you. David Quote Link to comment Share on other sites More sharing options...
brianburke Posted February 8, 2011 Share Posted February 8, 2011 Hello all, I am trying to figure out how to put together a surface shader that uses the camera position, relative to an object, to light that object with a falloff-type ramp. check out the 'head light' mode of the 'lighting model' vop Quote Link to comment Share on other sites More sharing options...
Div Posted February 9, 2011 Share Posted February 9, 2011 You may also want to try the normalFalloff vop. It's the dot product of the camera direction to the surface and the surface normal, a kind of 'facing ratio' shader. Quote Link to comment Share on other sites More sharing options...
barad_dur Posted February 11, 2011 Author Share Posted February 11, 2011 Thanks guys. I appreciate the help. David 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.