OpenGL2: Fix black planar projection shadows (cg_shadows 3)

Restore MD3 code for cg_shadows 2 and 3 like other model formats.
Fix planar projection shadow deform (cg_shadows 3) to use correct
light direction. I fixed light direction for stencil shadows
(cg_shadows 2) but it's still broken.
This commit is contained in:
Zack Middleton committed 2017-06-30 14:06:13 -05:00
1 parent 09a23e0417
commit 102c79eb49
2 files changed
+23 -7

No files matched your search

+2 -2
View File
@@ -162,7 +162,7 @@ void RB_ShadowTessEnd( void ) {
return;
}
VectorCopy( backEnd.currentEntity->lightDir, lightDir );
VectorCopy( backEnd.currentEntity->modelLightDir, lightDir );
// project vertexes away from light direction
for ( i = 0 ; i < tess.numVertexes ; i++ ) {
@@ -302,7 +302,7 @@ void RB_ProjectionShadowDeform( void ) {
groundDist = backEnd.or.origin[2] - backEnd.currentEntity->e.shadowPlane;
VectorCopy( backEnd.currentEntity->lightDir, lightDir );
VectorCopy( backEnd.currentEntity->modelLightDir, lightDir );
d = DotProduct( lightDir, ground );
// don't let the shadows get too long or go negative
if ( d < 0.5 ) {