Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
LightingPS.cg in the MoBu Dynamic Lighting shader
// To make the spot light works in correct way with normal maps assigned on meshes, you should change lines to these one
// And last but not least, figure out the spot factor ...
float spotFactor = 1.0f;
if( LightPositions[index].w )
{
float3 spotLightDir = normalize(LightDirections[index].xyz);
//spotLightDir = mul(fTangentMat, spotLightDir);
spotFactor = saturate( (dot( -normalize(lightDiff), -spotLightDir ) - LightDirections[index].w) / (1 - LightDirections[index].w) );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.