Hi,
I have problems combining shadow maps and textured entities.
When doing multiple passes with additive blending to apply the shadow maps, the textured entities (with GL_MODULATE, on Texture Unit 0) become lightier than they should.
Example:
Scene with 2 lights: Light1 projects shadows, Light2 doesn't.
Pass 1:
Build the shadow map of Light1.
Pass 2:
Draw the scene with only ambient color for Light1 and ambient/diffuse/specular for Light2.
Pass 3:
Enable additive blending (GL_ONE, GL_ONE) to add contributions of Light1.
Enable ShadowMap with depth Comparison (on Texture Unit 1) and draw the scene (with its textures on Texture Unit 0).
The textured entities become lightier than they should, while non-textured entities are fine (the lit parts have the same illumination they have if I disable ShadowMaps).
Am I doing something wrong?
What is the correct way to get the correct illumination for textured entities when using additive blending with multiple passes?



