I'm writing a set of tools for use in cinematics and i'm trying to find out if maya has a certain attribute to help with one of the tools.
I was wondering if objects have a way of reading how much light they are receiving.
For example,
a spot light is lighting an object with a brightness of 3,
the object it is lighting reads a value of 3 and is scripted to turn orange.
The spot light is changed to brightness 1,
The object it is lighting reads a value of 1 and is scripted to turn green.
So basically, what i'm after in an ideal world is an attribute i can simply reference as the lighting value of that object, but if not, is there any other work arounds?
Replies
@bardler - Not a bad idea, but sadly this needs to all work dynamically.
It seems that Surface Luminance only outputs a value at render time, so its not giving any feedback in the viewport. This is no good for me as this is eventually being used to drive a set of bones. I found that the lightInfo node gives you a value based on the distance of a light from a surface - but then occlusion is an issue
What about a custom viewport shader then?
That would still produce issues with shadows and/or occlusion not being computed.
I think the way to go would be a coloured ramp with luminance plugged into it as UVs. Like the TF2 shader or Unity's toon shader (ramp).
@Brendan - I'm not sure what you are suggesting or how it would achieve what i'm after - care to elaborate?
I managed to get a hacky work around going with the light info node. It doesn't actually calc the light on the eye but just uses light distances. Doesn't work with occulusion obviously... But this is what i'm trying to achieve - An eye rig that changes the wideness of the eye and dilates the pupils based on how much light is hitting the eye.