Skip to content

Commit

Permalink
Use conventional shadow mapping code for inverse lights.
Browse files Browse the repository at this point in the history
This re-enables shadows for players in the tiled renderer.
  • Loading branch information
gimhael committed Mar 5, 2016
1 parent 2330e44 commit ddc6b4a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
8 changes: 6 additions & 2 deletions daemon/src/engine/renderer/tr_backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5291,8 +5291,12 @@ static const void *RB_SetupLights( const void *data )
0, numLights * sizeof( shaderLight_t ),
GL_MAP_WRITE_BIT | GL_MAP_INVALIDATE_BUFFER_BIT );

for( int i = 0; i < numLights; i++ ) {
trRefLight_t *light = &cmd->refdef.lights[i];
for( int i = 0, j = 0; i < numLights; i++, j++ ) {
trRefLight_t *light = &cmd->refdef.lights[j];

while( light->l.inverseShadows ) {
light = &cmd->refdef.lights[++j];
}

VectorCopy( light->l.origin, buffer[i].center );
buffer[i].radius = light->l.radius;
Expand Down
12 changes: 7 additions & 5 deletions daemon/src/engine/renderer/tr_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2062,8 +2062,7 @@ void R_AddLightInteractions()
{
light = tr.currentLight = &tr.refdef.lights[ i ];

if ( light->isStatic )
{
if ( light->isStatic ) {
if ( r_staticLight->integer != 1 || ( ( r_precomputedLighting->integer || r_vertexLighting->integer ) && !light->noRadiosity ) )
{
if( r_staticLight->integer == 2 ) {
Expand All @@ -2072,9 +2071,12 @@ void R_AddLightInteractions()
light->cull = cullResult_t::CULL_OUT;
continue;
}
}
else
{
} else if ( light->l.inverseShadows ) {
if( !r_dynamicLight->integer ) {
light->cull = CULL_OUT;
continue;
}
} else {
if ( r_dynamicLight->integer != 1 )
{
if( r_dynamicLight->integer == 2 ) {
Expand Down

0 comments on commit ddc6b4a

Please sign in to comment.