mirror of
https://github.com/id-Software/DOOM-3-BFG.git
synced 2025-04-24 02:32:18 +00:00
Skip shadowmaps for small distant lights #746
This commit is contained in:
parent
302eb3fa85
commit
ee3fbb46f0
4 changed files with 11 additions and 9 deletions
|
@ -1555,7 +1555,8 @@ void idRenderBackend::DBG_ShowShadowMapLODs()
|
|||
// depth buffered planes
|
||||
if( r_showShadowMapLODs.GetInteger() >= 1 )
|
||||
{
|
||||
GL_State( GLS_DEPTHFUNC_ALWAYS | GLS_SRCBLEND_SRC_ALPHA | GLS_DSTBLEND_ONE_MINUS_SRC_ALPHA | GLS_DEPTHMASK );
|
||||
GL_State( GLS_DEPTHFUNC_ALWAYS | GLS_POLYMODE_LINE | GLS_DEPTHMASK );
|
||||
//GL_State( GLS_DEPTHFUNC_ALWAYS | GLS_SRCBLEND_SRC_ALPHA | GLS_DSTBLEND_ONE_MINUS_SRC_ALPHA | GLS_DEPTHMASK );
|
||||
|
||||
idVec4 c;
|
||||
if( vLight->shadowLOD == 0 )
|
||||
|
|
|
@ -4019,11 +4019,13 @@ void idRenderBackend::ShadowAtlasPass( const viewDef_t* _viewDef )
|
|||
|
||||
GL_ViewportAndScissor( 0, 0, r_shadowMapAtlasSize.GetInteger(), r_shadowMapAtlasSize.GetInteger() );
|
||||
|
||||
/*
|
||||
const nvrhi::FramebufferAttachment& attColor = currentFrameBuffer->GetApiObject()->getDesc().colorAttachments[0];
|
||||
if( attColor.texture )
|
||||
{
|
||||
commandList->clearTextureFloat( attColor.texture, nvrhi::AllSubresources, nvrhi::Color( 0.0f ) );
|
||||
}
|
||||
*/
|
||||
|
||||
const nvrhi::FramebufferAttachment& attDepth = currentFrameBuffer->GetApiObject()->getDesc().depthAttachment;
|
||||
if( attDepth.texture )
|
||||
|
|
|
@ -281,7 +281,7 @@ idCVar r_shadowMapRandomizeJitter( "r_shadowMapRandomizeJitter", "1", CVAR_RENDE
|
|||
idCVar r_shadowMapSamples( "r_shadowMapSamples", "16", CVAR_RENDERER | CVAR_INTEGER, "1, 4, 12 or 16", 1, 64 );
|
||||
idCVar r_shadowMapSplits( "r_shadowMapSplits", "3", CVAR_RENDERER | CVAR_INTEGER, "number of splits for cascaded shadow mapping with parallel lights", 0, 4 );
|
||||
idCVar r_shadowMapSplitWeight( "r_shadowMapSplitWeight", "0.9", CVAR_RENDERER | CVAR_FLOAT, "" );
|
||||
idCVar r_shadowMapLodScale( "r_shadowMapLodScale", "1.4", CVAR_RENDERER | CVAR_FLOAT, "" );
|
||||
idCVar r_shadowMapLodScale( "r_shadowMapLodScale", "0.9", CVAR_RENDERER | CVAR_FLOAT, "" );
|
||||
idCVar r_shadowMapLodBias( "r_shadowMapLodBias", "0", CVAR_RENDERER | CVAR_INTEGER, "" );
|
||||
idCVar r_shadowMapPolygonFactor( "r_shadowMapPolygonFactor", "2", CVAR_RENDERER | CVAR_FLOAT, "polygonOffset factor for drawing shadow buffer" );
|
||||
idCVar r_shadowMapPolygonOffset( "r_shadowMapPolygonOffset", "3000", CVAR_RENDERER | CVAR_FLOAT, "polygonOffset units for drawing shadow buffer" );
|
||||
|
|
|
@ -307,7 +307,8 @@ static void R_AddSingleLight( viewLight_t* vLight )
|
|||
flod = 0;
|
||||
}
|
||||
|
||||
flod *= numLods;
|
||||
// +1 allow to be so distant so we turn off shadow mapping
|
||||
flod *= ( numLods + 1 );
|
||||
|
||||
if( flod < 0 )
|
||||
{
|
||||
|
@ -316,10 +317,10 @@ static void R_AddSingleLight( viewLight_t* vLight )
|
|||
|
||||
lod = idMath::Ftoi( flod );
|
||||
|
||||
if( lod >= numLods )
|
||||
{
|
||||
//lod = numLods - 1;
|
||||
}
|
||||
//if( lod >= numLods )
|
||||
//{
|
||||
// lod = numLods - 1;
|
||||
//}
|
||||
|
||||
lod += r_shadowMapLodBias.GetInteger();
|
||||
|
||||
|
@ -332,8 +333,6 @@ static void R_AddSingleLight( viewLight_t* vLight )
|
|||
{
|
||||
// don't draw any shadow
|
||||
lod = -1;
|
||||
|
||||
//lod = numLods - 1;
|
||||
}
|
||||
|
||||
// 2048^2 ultra quality is only for cascaded shadow mapping with sun lights
|
||||
|
|
Loading…
Reference in a new issue