Simple shader question regarding light colors.

I want a simple shader where the color of the light source is directly transferred onto an object. E.g. if the color of the light source is 100% red (and intensity max), then the part of an object that are hit by this light also becomes 100% red no matter what their original material color is.

Anyone can guide me? Is a custom shader necessary?

Am using free-version Unity3D.

The easiest way to do this is with a surface shader that uses a custom lighting model. The result you want is quite simple, so it should be fairly easy to adapt one of the examples from the manual to your needs. The first (SimpleLambert) shader is probably the best starting point. Your shader should be even simpler than that.

Thank you for your reply.

I actually tried, but I can’t figure out the actual meaning of “_LightColor0”. It seems to contain the ambient color and my directional light added together, whereas in my case I only want the color information from my directional light. Can I access information about specific light sources, when writing a lighting model as in your example given.

Edit: I guess it actually becomes two parses, one where the ambient color is used, and another where the directional color is used?

_LightColor0 is just the colour of your directional light. The ambient light is added in a separate part of the generated surface shader. You could override it by setting o.Albedo to black. That will zero out the ambient contribution while leaving your custom lighting (which does not use albedo) intact.

I got it up and running. Thank you.