mirror of
https://github.com/id-Software/DOOM-3-BFG.git
synced 2025-04-24 02:32:18 +00:00
Changed r_useShadowMapping 1: medium+faster, 2: high quality
This commit is contained in:
parent
cd3ed5a927
commit
87b0040f92
5 changed files with 30 additions and 17 deletions
|
@ -285,7 +285,9 @@ ___________________________________________________
|
|||
9) CONSOLE VARIABLES
|
||||
__________________________________________
|
||||
|
||||
r_useShadowMapping 1 - Use soft shadow mapping instead of hard stencil shadows
|
||||
r_useShadowMapping 0: Use oldschool hard stencil shadows
|
||||
1: Use soft shadow mapping medium quality
|
||||
2: Use soft shadow mapping high quality
|
||||
|
||||
|
||||
___________________________________________________
|
||||
|
|
|
@ -514,8 +514,8 @@ void idMenuScreen_Shell_SystemOptions::idMenuDataSource_SystemSettings::AdjustFi
|
|||
// RB begin
|
||||
case SYSTEM_FIELD_SHADOWMAPPING:
|
||||
{
|
||||
static const int numValues = 2;
|
||||
static const int values[numValues] = { 0, 1 };
|
||||
static const int numValues = 3;
|
||||
static const int values[numValues] = { 0, 1, 2 };
|
||||
r_useShadowMapping.SetInteger( AdjustOption( r_useShadowMapping.GetInteger(), values, numValues, adjustAmount ) );
|
||||
break;
|
||||
}
|
||||
|
@ -609,7 +609,11 @@ idSWFScriptVar idMenuScreen_Shell_SystemOptions::idMenuDataSource_SystemSettings
|
|||
case SYSTEM_FIELD_SHADOWMAPPING:
|
||||
if( r_useShadowMapping.GetInteger() == 1 )
|
||||
{
|
||||
return "#str_swf_enabled";
|
||||
return "Medium";
|
||||
}
|
||||
else if( r_useShadowMapping.GetInteger() == 2 )
|
||||
{
|
||||
return "High";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -218,13 +218,12 @@ idCVar stereoRender_deGhost( "stereoRender_deGhost", "0.05", CVAR_FLOAT | CVAR_A
|
|||
idCVar r_useVirtualScreenResolution( "r_useVirtualScreenResolution", "1", CVAR_RENDERER | CVAR_BOOL | CVAR_ARCHIVE, "do 2D rendering at 640x480 and stretch to the current resolution" );
|
||||
|
||||
// RB: shadow mapping parameters
|
||||
idCVar r_useShadowMapping( "r_useShadowMapping", "1", CVAR_RENDERER | CVAR_ARCHIVE | CVAR_INTEGER, "use shadow mapping instead of stencil shadows" );
|
||||
idCVar r_useShadowMapping( "r_useShadowMapping", "1", CVAR_RENDERER | CVAR_ARCHIVE | CVAR_INTEGER, "0 = stencil shadows, 1 = medium quality soft shadow mapping, 2 = high quality soft shadow mapping" );
|
||||
idCVar r_shadowMapFrustumFOV( "r_shadowMapFrustumFOV", "92", CVAR_RENDERER | CVAR_FLOAT, "oversize FOV for point light side matching" );
|
||||
idCVar r_shadowMapSingleSide( "r_shadowMapSingleSide", "-1", CVAR_RENDERER | CVAR_INTEGER, "only draw a single side (0-5) of point lights" );
|
||||
idCVar r_shadowMapImageSize( "r_shadowMapImageSize", "1024", CVAR_RENDERER | CVAR_INTEGER, "", 128, 2048 );
|
||||
idCVar r_shadowMapJitterScale( "r_shadowMapJitterScale", "0.006", CVAR_RENDERER | CVAR_FLOAT, "scale factor for jitter offset" );
|
||||
idCVar r_shadowMapBiasScale( "r_shadowMapBiasScale", "0.0001", CVAR_RENDERER | CVAR_FLOAT, "scale factor for jitter bias" );
|
||||
idCVar r_shadowMapSamples( "r_shadowMapSamples", "16", CVAR_RENDERER | CVAR_INTEGER, "0, 1, 4, or 16" );
|
||||
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, "" );
|
||||
|
|
|
@ -1273,17 +1273,28 @@ static void RB_RenderInteractions( const drawSurf_t* surfList, const viewLight_t
|
|||
{
|
||||
const static int JITTER_SIZE = 128;
|
||||
|
||||
// default high quality
|
||||
float jitterSampleScale = 1.0f;
|
||||
float shadowMapSamples = 16.0f;
|
||||
|
||||
if( r_useShadowMapping.GetInteger() == 1 )
|
||||
{
|
||||
// medium quality
|
||||
jitterSampleScale = 0.5f;
|
||||
shadowMapSamples = 4.0f;
|
||||
}
|
||||
|
||||
// screen power of two correction factor
|
||||
float screenCorrectionParm[4];
|
||||
screenCorrectionParm[0] = 1.0f / ( JITTER_SIZE * r_shadowMapSamples.GetInteger() ) ;
|
||||
screenCorrectionParm[0] = 1.0f / ( JITTER_SIZE * shadowMapSamples ) ;
|
||||
screenCorrectionParm[1] = 1.0f / JITTER_SIZE;
|
||||
screenCorrectionParm[2] = 1.0f / shadowMapResolutions[vLight->shadowLOD];
|
||||
screenCorrectionParm[3] = r_shadowMapSamples.GetInteger();
|
||||
screenCorrectionParm[3] = shadowMapSamples;
|
||||
SetFragmentParm( RENDERPARM_SCREENCORRECTIONFACTOR, screenCorrectionParm ); // rpScreenCorrectionFactor
|
||||
|
||||
float jitterTexScale[4];
|
||||
jitterTexScale[0] = r_shadowMapJitterScale.GetFloat() * 1.0f; // TODO shadow buffer size fraction shadowMapSize / maxShadowMapSize
|
||||
jitterTexScale[1] = r_shadowMapJitterScale.GetFloat() * 1.0f;
|
||||
jitterTexScale[0] = r_shadowMapJitterScale.GetFloat() * jitterSampleScale; // TODO shadow buffer size fraction shadowMapSize / maxShadowMapSize
|
||||
jitterTexScale[1] = r_shadowMapJitterScale.GetFloat() * jitterSampleScale;
|
||||
jitterTexScale[2] = -r_shadowMapBiasScale.GetFloat();
|
||||
jitterTexScale[3] = 0.0f;
|
||||
SetFragmentParm( RENDERPARM_JITTERTEXSCALE, jitterTexScale ); // rpJitterTexScale
|
||||
|
@ -1350,17 +1361,15 @@ static void RB_RenderInteractions( const drawSurf_t* surfList, const viewLight_t
|
|||
|
||||
// texture 6 will be the jitter texture for soft shadowing
|
||||
GL_SelectTexture( INTERACTION_TEXUNIT_JITTER );
|
||||
if( r_shadowMapSamples.GetInteger() == 16 )
|
||||
{
|
||||
globalImages->jitterImage16->Bind();
|
||||
}
|
||||
else if( r_shadowMapSamples.GetInteger() == 4 )
|
||||
if( r_useShadowMapping.GetInteger() == 1 )
|
||||
{
|
||||
// medium quality
|
||||
globalImages->jitterImage4->Bind();
|
||||
}
|
||||
else
|
||||
{
|
||||
globalImages->jitterImage1->Bind();
|
||||
// high quality
|
||||
globalImages->jitterImage16->Bind();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1061,7 +1061,6 @@ extern idCVar r_shadowMapSingleSide;
|
|||
extern idCVar r_shadowMapImageSize;
|
||||
extern idCVar r_shadowMapJitterScale;
|
||||
extern idCVar r_shadowMapBiasScale;
|
||||
extern idCVar r_shadowMapSamples;
|
||||
extern idCVar r_shadowMapSplits;
|
||||
extern idCVar r_shadowMapSplitWeight;
|
||||
extern idCVar r_shadowMapLodScale;
|
||||
|
|
Loading…
Reference in a new issue