PDA

View Full Version : Vector "freak" needed!



Thomas M.
02-19-2009, 01:30 AM
I need to alter the specularity color of a surface in the following manner (see sketch). If the reflected ray is behind the hot spot it's supposed to be blueish, while the rays lying before the hotspot are slightly red. The color is going top be controlled by a gradient.

I'm not looking for dispersion as this effect in LW works like a circle (inside color vs outside color).

Alpha is always in the pitch direction within the plane created by the three points camera/hotspot/lightsource. I don't know whether this will work at all or only with points lights, though it would be cool if it will work with all light sources (e.g. distant or dome light). Anybody an idea how to solve this?

Cheers
Thomas

Thomas M.
02-19-2009, 01:32 AM
P.S.: Pure incidence based gradient won't work as it doesn't relate to the angle of the light, but only to the one of the camera. Probably there's a way to alter this.

lwanmtr
02-19-2009, 01:35 AM
light incidence on a gradient?

Thomas M.
02-19-2009, 01:49 AM
Probably!?

lwanmtr
02-19-2009, 01:55 AM
Hehe..I'd give that a try..cant load lw atm or i'd test it out. There may even be a node..but dont ask me which one (prolly some math thing..hehe)

Thomas M.
02-19-2009, 01:56 AM
Just experimenting with the spot info and light info node right now, but that's more or less trial and error.

Thomas M.
02-19-2009, 02:01 AM
LightInfo > Direction subtract SpotInfo > ObjectSpot doesn't work as it's not close to the spotlight highlight. More a Light/Shadow color solution.

lwanmtr
02-19-2009, 02:04 AM
I think you could also try a color gradient node onto the spec channel..that might work.

Thomas M.
02-19-2009, 02:06 AM
LightInfo > Direction subtract SpotInfo > RayDirection. BINGO!!!

Thomas M.
02-19-2009, 02:10 AM
The only problem is that you need to tweak the gradient to the glossiness of the light.

spiroz
02-19-2009, 02:11 AM
Ah.. you already solved it.. Oh well, here's another setup..

Thomas M.
02-19-2009, 02:19 AM
Here's my set up.