FIX: alpha tested modulative shadows

What it says on the tin: a place to discuss proposed new features.
Post Reply
digitalgibs
Gnoblar
Posts: 15
Joined: Wed Aug 04, 2010 8:22 pm
x 1

FIX: alpha tested modulative shadows

Post by digitalgibs »

Original Code: OgreSceneManager.cpp line 4921

Code: Select all

        unsigned short keepTUCount;
	// If additive, need lighting parameters & standard programs
	if (isShadowTechniqueAdditive())
New Code:

Code: Select all

        unsigned short keepTUCount;
	// If additive, need lighting parameters & standard programs
	if (isShadowTechniqueAdditive() || !retPass->getVertexProgramName().empty())
All I did was allow the original Pass texture units to be sent to the shader. Since these parameters are optimized out when not used I figured that it wouldn't hurt. Now "modulate" custom shadow shaders have access to their textures. Before this change, only the shadow map and (maybe) the spotlight texture was sent to the receiver.

Sure you could override EVERY material with custom integrated shaders, but this was a 1 line fix for hundreds of materials that just need a generic shadow technique.
Post Reply