mirror of
https://github.com/id-Software/DOOM-3-BFG.git
synced 2025-02-27 22:21:28 +00:00
Added graphics option to make soft shadows optional
This commit is contained in:
parent
c300acd507
commit
42874cfd05
6 changed files with 51 additions and 5 deletions
|
@ -3,6 +3,7 @@
|
|||
|
||||
Doom 3 BFG Edition GPL Source Code
|
||||
Copyright (C) 1993-2012 id Software LLC, a ZeniMax Media company.
|
||||
Copyright (C) 2014 Robert Beckebans
|
||||
|
||||
This file is part of the Doom 3 BFG Edition GPL Source Code ("Doom 3 BFG Edition Source Code").
|
||||
|
||||
|
@ -1361,6 +1362,9 @@ public:
|
|||
SYSTEM_FIELD_VSYNC,
|
||||
SYSTEM_FIELD_ANTIALIASING,
|
||||
SYSTEM_FIELD_MOTIONBLUR,
|
||||
// RB begin
|
||||
SYSTEM_FIELD_SHADOWMAPPING,
|
||||
// RB end
|
||||
SYSTEM_FIELD_LODBIAS,
|
||||
SYSTEM_FIELD_BRIGHTNESS,
|
||||
SYSTEM_FIELD_VOLUME,
|
||||
|
@ -1393,6 +1397,9 @@ public:
|
|||
int originalVsync;
|
||||
float originalBrightness;
|
||||
float originalVolume;
|
||||
// RB begin
|
||||
int originalShadowMapping;
|
||||
// RB end
|
||||
|
||||
idList<vidMode_t> modeList;
|
||||
};
|
||||
|
|
|
@ -110,6 +110,16 @@ void idMenuScreen_Shell_SystemOptions::Initialize( idMenuHandler* data )
|
|||
control->AddEventAction( WIDGET_EVENT_PRESS ).Set( WIDGET_ACTION_COMMAND, idMenuDataSource_SystemSettings::SYSTEM_FIELD_MOTIONBLUR );
|
||||
options->AddChild( control );
|
||||
|
||||
// RB begin
|
||||
control = new( TAG_SWF ) idMenuWidget_ControlButton();
|
||||
control->SetOptionType( OPTION_SLIDER_TEXT );
|
||||
control->SetLabel( "Soft Shadows" );
|
||||
control->SetDataSource( &systemData, idMenuDataSource_SystemSettings::SYSTEM_FIELD_SHADOWMAPPING );
|
||||
control->SetupEvents( DEFAULT_REPEAT_TIME, options->GetChildren().Num() );
|
||||
control->AddEventAction( WIDGET_EVENT_PRESS ).Set( WIDGET_ACTION_COMMAND, idMenuDataSource_SystemSettings::SYSTEM_FIELD_SHADOWMAPPING );
|
||||
options->AddChild( control );
|
||||
// RB end
|
||||
|
||||
control = new( TAG_SWF ) idMenuWidget_ControlButton();
|
||||
control->SetOptionType( OPTION_SLIDER_BAR );
|
||||
control->SetLabel( "#str_swf_lodbias" );
|
||||
|
@ -384,6 +394,9 @@ void idMenuScreen_Shell_SystemOptions::idMenuDataSource_SystemSettings::LoadData
|
|||
originalVsync = r_swapInterval.GetInteger();
|
||||
originalBrightness = r_lightScale.GetFloat();
|
||||
originalVolume = s_volume_dB.GetFloat();
|
||||
// RB begin
|
||||
originalShadowMapping = r_useShadowMapping.GetInteger();
|
||||
// RB end
|
||||
|
||||
const int fullscreen = r_fullscreen.GetInteger();
|
||||
if( fullscreen > 0 )
|
||||
|
@ -498,6 +511,15 @@ void idMenuScreen_Shell_SystemOptions::idMenuDataSource_SystemSettings::AdjustFi
|
|||
r_motionBlur.SetInteger( AdjustOption( r_motionBlur.GetInteger(), values, numValues, adjustAmount ) );
|
||||
break;
|
||||
}
|
||||
// RB begin
|
||||
case SYSTEM_FIELD_SHADOWMAPPING:
|
||||
{
|
||||
static const int numValues = 2;
|
||||
static const int values[numValues] = { 0, 1 };
|
||||
r_useShadowMapping.SetInteger( AdjustOption( r_useShadowMapping.GetInteger(), values, numValues, adjustAmount ) );
|
||||
break;
|
||||
}
|
||||
// RB end
|
||||
case SYSTEM_FIELD_LODBIAS:
|
||||
{
|
||||
const float percent = LinearAdjust( r_lodBias.GetFloat(), -1.0f, 1.0f, 0.0f, 100.0f );
|
||||
|
@ -583,6 +605,17 @@ idSWFScriptVar idMenuScreen_Shell_SystemOptions::idMenuDataSource_SystemSettings
|
|||
return "#str_swf_disabled";
|
||||
}
|
||||
return va( "%dx", idMath::IPow( 2, r_motionBlur.GetInteger() ) );
|
||||
// RB begin
|
||||
case SYSTEM_FIELD_SHADOWMAPPING:
|
||||
if( r_useShadowMapping.GetInteger() == 1 )
|
||||
{
|
||||
return "#str_swf_enabled";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "#str_swf_disabled";
|
||||
}
|
||||
// RB end
|
||||
case SYSTEM_FIELD_LODBIAS:
|
||||
return LinearAdjust( r_lodBias.GetFloat(), -1.0f, 1.0f, 0.0f, 100.0f );
|
||||
case SYSTEM_FIELD_BRIGHTNESS:
|
||||
|
@ -626,5 +659,11 @@ bool idMenuScreen_Shell_SystemOptions::idMenuDataSource_SystemSettings::IsDataCh
|
|||
{
|
||||
return true;
|
||||
}
|
||||
// RB begin
|
||||
if( originalShadowMapping != r_useShadowMapping.GetInteger() )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
// RB end
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -484,7 +484,7 @@ bool idCinematicLocal::InitFromFFMPEGFile( const char* qpath, bool amilooping )
|
|||
idStr newPath( qpath );
|
||||
newPath.Replace( "sound/vo", "sound/VO" );
|
||||
|
||||
testFile = fileSystem->OpenFileRead( newPath );
|
||||
testFile = fileSystem->OpenFileRead( newPath );
|
||||
if( testFile )
|
||||
{
|
||||
fullpath = testFile->GetFullPath();
|
||||
|
|
|
@ -311,7 +311,7 @@ static void R_CheckCvars()
|
|||
case GLDRV_OPENGL_ES2:
|
||||
case GLDRV_OPENGL_ES3:
|
||||
case GLDRV_OPENGL_MESA:
|
||||
r_useShadowMapping.SetBool( false );
|
||||
r_useShadowMapping.SetInteger( 0 );
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
@ -213,7 +213,7 @@ 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_BOOL, "use shadow mapping instead of stencil shadows" );
|
||||
idCVar r_useShadowMapping( "r_useShadowMapping", "1", CVAR_RENDERER | CVAR_ARCHIVE | CVAR_INTEGER, "use shadow mapping instead of stencil shadows" );
|
||||
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 );
|
||||
|
|
|
@ -2653,14 +2653,14 @@ static void RB_ShadowMapPass( const drawSurf_t* drawSurfs, const viewLight_t* vL
|
|||
uint64 surfGLState = 0;
|
||||
|
||||
// set polygon offset if necessary
|
||||
if( shader->TestMaterialFlag( MF_POLYGONOFFSET ) )
|
||||
if( shader && shader->TestMaterialFlag( MF_POLYGONOFFSET ) )
|
||||
{
|
||||
surfGLState |= GLS_POLYGON_OFFSET;
|
||||
GL_PolygonOffset( r_offsetFactor.GetFloat(), r_offsetUnits.GetFloat() * shader->GetPolygonOffset() );
|
||||
}
|
||||
|
||||
#if 1
|
||||
if( shader->Coverage() == MC_PERFORATED )
|
||||
if( shader && shader->Coverage() == MC_PERFORATED )
|
||||
{
|
||||
// perforated surfaces may have multiple alpha tested stages
|
||||
for( int stage = 0; stage < shader->GetNumStages(); stage++ )
|
||||
|
|
Loading…
Reference in a new issue