- Home /
Can I have a light affect only one material?
Some 3D rendering apps have checkboxes to allow you to say whether a particular light source affects a particular surface.
Is there any way I can do this with a material in Unity? I would like to have a spot light that only affects say the character's clothing and not his face or hair or anything else.
Is this easily possible?
Layers don't work for this do they? As I want one material of several on a single gameobject (character) to be affected by the light and the rest to ignore it.
Answer by GuyTidhar · Jul 11, 2011 at 06:06 AM
Look for "CullingMask" field in your light component.
There you can choose which layers are effected by the light.
To set the layer check out this:
http://unity3d.com/support/documentation/Components/Layers.html
Thanks, appreciate the reply and I just read it, but is this on a per GameObject basis only? If I have a character which is a parented hierarchy of bones and an FBX skinned mesh render which the 1 mesh contains all of the different materials: hair, skin, dress etc. Can I assign JUST the dress material to the Layer? or does that apply to the WHOLE gameobject - and thus all the materials on my character?
Your answer