Skip to content

Commit

Permalink
OpenGL2: Fix holodeck doors being black and not fading out
Browse files Browse the repository at this point in the history
On Windows the opaque textures on the holodeck doors model were drawn
solid black and did not fade out.

Set up ref entity lightDir and modelLightDir as unit vectors. I am
guessing the vector lengths are being used as a divisor in a GLSL shader
or something.

Also clear directedLight so the same fields are set for RF_FULLBRIGHT as
all other ref entities.
  • Loading branch information
zturtleman committed Jun 2, 2018
1 parent 0b0e10f commit 74ec00d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
5 changes: 4 additions & 1 deletion code/renderergl1/tr_light.c
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,10 @@ void R_SetupEntityLighting( const trRefdef_t *refdef, trRefEntity_t *ent ) {
((byte *)&ent->ambientLightInt)[2] = 0x7F;
((byte *)&ent->ambientLightInt)[3] = 0xFF;

ent->lightDir[0] = ent->lightDir[1] = ent->lightDir[2] = 0;
ent->directedLight[0] = ent->directedLight[1] = ent->directedLight[2] = 0;

ent->lightDir[0] = ent->lightDir[1] = 0;
ent->lightDir[2] = 1;
return;
}
#endif
Expand Down
9 changes: 8 additions & 1 deletion code/renderergl2/tr_light.c
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,14 @@ void R_SetupEntityLighting( const trRefdef_t *refdef, trRefEntity_t *ent ) {
((byte *)&ent->ambientLightInt)[2] = 0x7F;
((byte *)&ent->ambientLightInt)[3] = 0xFF;

ent->lightDir[0] = ent->lightDir[1] = ent->lightDir[2] = 0;
ent->directedLight[0] = ent->directedLight[1] = ent->directedLight[2] = 0;

ent->lightDir[0] = ent->lightDir[1] = 0;
ent->lightDir[2] = 1;

ent->modelLightDir[0] = DotProduct( ent->lightDir, ent->e.axis[0] );
ent->modelLightDir[1] = DotProduct( ent->lightDir, ent->e.axis[1] );
ent->modelLightDir[2] = DotProduct( ent->lightDir, ent->e.axis[2] );
return;
}
#endif
Expand Down

0 comments on commit 74ec00d

Please sign in to comment.