Is it possible to have a directional light that only casts shadows without contributing any light to the scene?
My scene lighting is a combo of baked, IBL, and a hemi light and I don’t want any additional light – just the shadows from a “sun” light. Is this possible?
Hmm maybe. The challenge is I want the shadow to fall on otherwise normally textured material lit by other lights and light maps. That shadow-only material seems to only render the shadow and nothing else. I wonder if I need add a quad to my scene whose sole purpose is to receive the shadow?
@papajuan, yes, you can cull any mesh from a light by adding it to the light.excludedMeshes array. The calculations for lights and shadows are separate and have separate member lists, so you can exclude a mesh from being lit but include it in the shadow calculations for a light or vice versa. I added this on line 146 of your playground. You can see that the specular reflection from the directional light is gone in this PG while the shadow remains:
Not quite. The mesh I don’t want additionally lit is the floor – but I want the shadow.
It looks like the additional light on the floor is required to make the shadow. That is, the shadow isn’t actually darker, it just looks dark because the surrounding area has been made lighter by the added light.
Using the shadowOnlyMaterial as Cedric mentionned should definitely work ? You need to add a plane just above your ground with this material and exclude the casting light from all other materials.
We can help with the setup if you share a playground.