Jump to content

Using camera position to light object.


barad_dur

Recommended Posts

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

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...