diff --git a/neo/engine/doomdll.vcxproj.user b/neo/engine/doomdll.vcxproj.user index 0d14ea58..35d47df4 100644 --- a/neo/engine/doomdll.vcxproj.user +++ b/neo/engine/doomdll.vcxproj.user @@ -15,9 +15,9 @@ D:\projects\Doom3\Doom3.exe WindowsLocalDebugger - +set r_fullscreen 0 +set r_mode 1 + +set r_fullscreen 1 +set r_mode 9 D:\projects\Doom3 - +set r_fullscreen 0 +set r_mode 6|+set r_fullscreen 1 +set r_mode 6|+set r_fullscreen 1 +set r_mode 1|+set r_fullscreen 0 +set r_mode 1 +set fs_game q1base|+set r_fullscreen 0 +set r_mode 1| + +set r_fullscreen 1 +set r_mode 1|+set r_fullscreen 0 +set r_mode 1|+set r_fullscreen 1 +set r_mode 0|+set r_fullscreen 1 +set r_mode 10|+set r_fullscreen 1 +set r_mode 9| D:\projects\Doom3\Quake4.exe diff --git a/neo/engine/framework/Session_menu.cpp b/neo/engine/framework/Session_menu.cpp index bc0e5dfe..29174628 100644 --- a/neo/engine/framework/Session_menu.cpp +++ b/neo/engine/framework/Session_menu.cpp @@ -985,9 +985,9 @@ void idSessionLocal::HandleMainMenuCommands( const char *menuCommand ) { cmdSystem->BufferCommandText( CMD_EXEC_NOW, "setMachineSpec\n" ); //Make sure that any r_brightness changes take effect - float bright = cvarSystem->GetCVarFloat("r_brightness"); - cvarSystem->SetCVarFloat("r_brightness", 0.0f); - cvarSystem->SetCVarFloat("r_brightness", bright); + float bright = cvarSystem->GetCVarFloat("r_brightnesspt"); + cvarSystem->SetCVarFloat("r_brightnesspt", 0.0f); + cvarSystem->SetCVarFloat("r_brightnesspt", bright); //Force user info modified after a reset to defaults cvarSystem->SetModifiedFlags(CVAR_USERINFO); diff --git a/neo/engine/opengl/gl_d3d12shim.cpp b/neo/engine/opengl/gl_d3d12shim.cpp index 97436f30..a338ceb4 100644 --- a/neo/engine/opengl/gl_d3d12shim.cpp +++ b/neo/engine/opengl/gl_d3d12shim.cpp @@ -142,6 +142,21 @@ using Microsoft::WRL::ComPtr; #ifndef GL_TEXTURE_INTERNAL_FORMAT #define GL_TEXTURE_INTERNAL_FORMAT 0x1003 #endif +#ifndef GL_POLYGON_OFFSET_UNITS +#define GL_POLYGON_OFFSET_UNITS 0x2A00 +#endif +#ifndef GL_POLYGON_OFFSET_POINT +#define GL_POLYGON_OFFSET_POINT 0x2A01 +#endif +#ifndef GL_POLYGON_OFFSET_LINE +#define GL_POLYGON_OFFSET_LINE 0x2A02 +#endif +#ifndef GL_POLYGON_OFFSET_FILL +#define GL_POLYGON_OFFSET_FILL 0x8037 +#endif +#ifndef GL_POLYGON_OFFSET_FACTOR +#define GL_POLYGON_OFFSET_FACTOR 0x8038 +#endif // QD3D12-private compatibility enums used by the optional tangent-space // normal-map path. They intentionally live outside the official GL enum range @@ -170,6 +185,12 @@ using Microsoft::WRL::ComPtr; #ifndef GL_QD3D12_DLAA_ENABLED #define GL_QD3D12_DLAA_ENABLED 0x6009 #endif +#ifndef GL_QD3D12_TONEMAP_BRIGHTNESS +#define GL_QD3D12_TONEMAP_BRIGHTNESS 0x600A +#endif +#ifndef GL_QD3D12_TONE_MAP_BRIGHTNESS +#define GL_QD3D12_TONE_MAP_BRIGHTNESS GL_QD3D12_TONEMAP_BRIGHTNESS +#endif // Optional material/ray-visibility tags for the DXR path. These are private // shim enums; they deliberately live next to the normal-map compatibility enums. @@ -280,6 +301,12 @@ void glShowAllTopLevelAceelStructures(glRaytracingSceneHandle_t scene); void QD3D12_SetUpscalerBackend(int backend); void QD3D12_SetUpscalerQuality(int quality); void QD3D12_SetUpscalerSharpness(float sharpness); +void QD3D12_SetToneMapBrightness(float brightness); +float QD3D12_GetToneMapBrightness(void); +void APIENTRY glToneMapBrightnessQD3D12(GLfloat brightness); +void APIENTRY glToneMapBrightnessfQD3D12(GLfloat brightness); +void APIENTRY glTonemapBrightnessQD3D12(GLfloat brightness); +void APIENTRY glTonemapBrightnessfQD3D12(GLfloat brightness); void QD3D12_EnableRayAIDenoise(int enabled); void QD3D12_EnableDLSSRayReconstruction(int enabled); void QD3D12_EnableFSRRayRegeneration(int enabled); @@ -634,7 +661,7 @@ struct GLBufferObject const char* vendor = "Justin Marshall"; const char* renderer = "Quake D3D12 Wrapper"; const char* version = "1.1-quake-d3d12"; -const char* extensions = "GL_SGIS_multitexture GL_ARB_multitexture GL_EXT_texture_env_add GL_ARB_texture_env_combine GL_ARB_texture_compression GL_EXT_texture_compression_s3tc GL_ARB_vertex_program GL_ARB_fragment_program GL_EXT_texture_cube_map GL_EXT_depth_bounds_test GL_EXT_stencil_two_side GL_ATI_separate_stencil GL_QD3D12_normal_map GL_QD3D12_glow_map GL_QD3D12_specular_map GL_QD3D12_glass_material GL_QD3D12_volumetric_light GL_QD3D12_dlaa"; +const char* extensions = "GL_SGIS_multitexture GL_ARB_multitexture GL_EXT_texture_env_add GL_ARB_texture_env_combine GL_ARB_texture_compression GL_EXT_texture_compression_s3tc GL_ARB_vertex_program GL_ARB_fragment_program GL_EXT_texture_cube_map GL_EXT_depth_bounds_test GL_EXT_stencil_two_side GL_ATI_separate_stencil GL_QD3D12_normal_map GL_QD3D12_glow_map GL_QD3D12_specular_map GL_QD3D12_glass_material GL_QD3D12_volumetric_light GL_QD3D12_dlaa GL_QD3D12_tonemap_brightness"; enum TexEnvModeShader { @@ -727,6 +754,10 @@ struct BatchKey float depthBoundsMin = 0.0f; float depthBoundsMax = 1.0f; + bool polygonOffsetEnabled = false; + float polygonOffsetFactor = 0.0f; + float polygonOffsetUnits = 0.0f; + float alphaRef = 0.0f; float alphaFunc = 4.0f; float useTex0 = 0.0f; @@ -829,6 +860,9 @@ static bool BatchKeyEquals(const BatchKey& a, const BatchKey& b) a.depthBoundsTest == b.depthBoundsTest && a.depthBoundsMin == b.depthBoundsMin && a.depthBoundsMax == b.depthBoundsMax && + a.polygonOffsetEnabled == b.polygonOffsetEnabled && + a.polygonOffsetFactor == b.polygonOffsetFactor && + a.polygonOffsetUnits == b.polygonOffsetUnits && memcmp(a.texComb0RGB, b.texComb0RGB, sizeof(a.texComb0RGB)) == 0 && memcmp(a.texComb0Alpha, b.texComb0Alpha, sizeof(a.texComb0Alpha)) == 0 && memcmp(a.texComb0Operand, b.texComb0Operand, sizeof(a.texComb0Operand)) == 0 && @@ -1157,6 +1191,7 @@ struct GLState bool gbufferResolvedThisFrame = false; bool raytracedLightingReadyThisFrame = false; float upscalerSharpness = 1.0f; + float toneMapBrightness = 1.0f; GLenum depthFunc = GL_LEQUAL; UINT64 nextFenceValue = 1; @@ -1243,6 +1278,9 @@ struct GLState GLfloat polygonOffsetFactor = 0.0f; GLfloat polygonOffsetUnits = 0.0f; + bool polygonOffsetPoint = false; + bool polygonOffsetLine = false; + bool polygonOffsetFill = false; GLclampd clearDepthValue = 1.0; GLboolean colorMaskR = GL_TRUE; @@ -3434,7 +3472,7 @@ SamplerState gSamp0 : register(s0); cbuffer PostCB : register(b0) { // gPostParams0: x = sharpen strength, y = history weight, z = TAA reset flag. - // gPostParams1: x = tone-map exposure, y = white-point scale. + // gPostParams1: x = tone-map exposure, y = white-point scale, z = display brightness. float4 gPostParams0; float4 gPostParams1; }; @@ -3444,6 +3482,7 @@ cbuffer PostCB : register(b0) #define gTaaReset gPostParams0.z #define gToneMapExposure gPostParams1.x #define gToneMapWhiteScale gPostParams1.y +#define gToneMapBrightness gPostParams1.z #define QD3D12_TONEMAP_TILE_DIM 64u struct VSOut @@ -3587,7 +3626,7 @@ float3 QD3D12_ExtendedReinhard(float3 hdr, float whitePoint) float w = max(whitePoint * max(gToneMapWhiteScale, 0.001), 1.0); float w2 = max(w * w, 1.0e-4); float3 mapped = (hdr * (1.0 + hdr / w2)) / (1.0 + hdr); - return saturate(mapped); + return saturate(mapped * max(gToneMapBrightness, 0.0)); } float4 PSToneMap(VSOut i) : SV_Target0 @@ -4201,6 +4240,29 @@ static bool QD3D12_TextureIsMaterialMapOnlyForFixedFunctionColor(const TextureRe tex->glId == g_gl.currentSpecularMapTexture; } +static bool QD3D12_PolygonOffsetEnabledForMode(GLenum originalMode) +{ + switch (originalMode) + { + case GL_POINTS: + return g_gl.polygonOffsetPoint; + + case GL_LINES: + case GL_LINE_STRIP: + case GL_LINE_LOOP: + return g_gl.polygonOffsetLine; + + case GL_TRIANGLES: + case GL_TRIANGLE_STRIP: + case GL_TRIANGLE_FAN: + case GL_QUADS: + case GL_QUAD_STRIP: + case GL_POLYGON: + default: + return g_gl.polygonOffsetFill; + } +} + #ifdef _DEBUG #pragma optimize off #endif @@ -4304,6 +4366,12 @@ static BatchKey BuildCurrentBatchKey(GLenum originalMode, const TextureResource* key.depthBoundsTest = g_gl.depthBoundsTest; key.depthBoundsMin = (float)g_gl.depthBoundsMin; key.depthBoundsMax = (float)g_gl.depthBoundsMax; + key.polygonOffsetEnabled = QD3D12_PolygonOffsetEnabledForMode(originalMode); + if (key.polygonOffsetEnabled) + { + key.polygonOffsetFactor = g_gl.polygonOffsetFactor; + key.polygonOffsetUnits = g_gl.polygonOffsetUnits; + } key.blendSrc = g_gl.blendSrc; key.blendDst = g_gl.blendDst; key.depthTest = g_gl.depthTest; @@ -4692,10 +4760,40 @@ static D3D12_DEPTH_STENCILOP_DESC BuildStencilFaceDesc(GLenum func, GLenum sfail return d; } +static INT QD3D12_MapPolygonOffsetUnitsToDepthBias(float units) +{ + if (!std::isfinite(units) || fabsf(units) <= 1.0e-7f) + return 0; + + const float clamped = ClampValue(units, -16777216.0f, 16777216.0f); + INT bias = (INT)std::lround((double)clamped); + + // D3D12 only exposes the constant term as an integer. Preserve sub-unit GL + // offsets instead of silently rounding a small but intentional offset to zero. + if (bias == 0) + bias = (clamped > 0.0f) ? 1 : -1; + + return bias; +} + static void ApplyRasterDepthStencilState(D3D12_GRAPHICS_PIPELINE_STATE_DESC& d, const BatchKey& key) { d.RasterizerState.CullMode = key.cullFaceEnabled ? MapCull(key.cullMode) : D3D12_CULL_MODE_NONE; d.RasterizerState.FrontCounterClockwise = (key.frontFace == GL_CCW) ? TRUE : FALSE; + if (key.polygonOffsetEnabled) + { + // OpenGL polygon offset is: depth += m * factor + r * units. + // D3D12's slope and integer depth-bias terms map to the same two pieces. + d.RasterizerState.SlopeScaledDepthBias = key.polygonOffsetFactor; + d.RasterizerState.DepthBias = QD3D12_MapPolygonOffsetUnitsToDepthBias(key.polygonOffsetUnits); + d.RasterizerState.DepthBiasClamp = 0.0f; + } + else + { + d.RasterizerState.SlopeScaledDepthBias = 0.0f; + d.RasterizerState.DepthBias = 0; + d.RasterizerState.DepthBiasClamp = 0.0f; + } d.DepthStencilState.DepthEnable = key.depthTest ? TRUE : FALSE; d.DepthStencilState.DepthWriteMask = key.depthWrite ? D3D12_DEPTH_WRITE_MASK_ALL : D3D12_DEPTH_WRITE_MASK_ZERO; @@ -5507,7 +5605,8 @@ static void QD3D12_SetPostConstants( float taaHistoryWeight, float taaReset, float toneMapExposure = 1.0f, - float toneMapWhiteScale = 1.0f) + float toneMapWhiteScale = 1.0f, + float toneMapBrightness = 1.0f) { if (!cl) return; @@ -5520,7 +5619,7 @@ static void QD3D12_SetPostConstants( 0.0f, toneMapExposure, toneMapWhiteScale, - 0.0f, + toneMapBrightness, 0.0f }; cl->SetGraphicsRoot32BitConstants(QD3D12_PostRootConstants, QD3D12_PostConstantDwords, constants, 0); @@ -5657,7 +5756,7 @@ static bool QD3D12_ToneMapFullscreenPass( cl->SetDescriptorHeaps(_countof(heaps), heaps); cl->SetGraphicsRootSignature(g_gl.postRootSig.Get()); const float passSharpness = (sharpnessOverride >= 0.0f) ? sharpnessOverride : g_gl.upscalerSharpness; - QD3D12_SetPostConstants(cl, passSharpness, 0.0f, 1.0f, 1.0f, 1.0f); + QD3D12_SetPostConstants(cl, passSharpness, 0.0f, 1.0f, 1.0f, 1.0f, g_gl.toneMapBrightness); cl->SetPipelineState(g_gl.postToneMapPSO.Get()); cl->OMSetRenderTargets(1, &outputRtv, FALSE, nullptr); cl->RSSetViewports(1, &viewport); @@ -7415,6 +7514,12 @@ static uint64_t MakePSOKey( h ^= v; h *= 1099511628211ull; }; + auto mixFloat = [&](float f) + { + uint32_t bits = 0; + memcpy(&bits, &f, sizeof(bits)); + mix(bits); + }; mix(uint32_t(key.pipeline)); mix(uint32_t(key.blendSrc)); @@ -7422,6 +7527,9 @@ static uint64_t MakePSOKey( mix(key.depthTest ? 1ull : 0ull); mix(key.depthWrite ? 1ull : 0ull); mix(uint32_t(key.depthFunc)); + mix(key.polygonOffsetEnabled ? 1ull : 0ull); + mixFloat(key.polygonOffsetEnabled ? key.polygonOffsetFactor : 0.0f); + mixFloat(key.polygonOffsetEnabled ? key.polygonOffsetUnits : 0.0f); mix(uint32_t(topoType)); mix(QD3D12_UseNormalMapTessellationPSO(key, nativeColorOnly) ? 1ull : 0ull); mix(nativeColorOnly ? 1ull : 0ull); @@ -7579,6 +7687,12 @@ static uint64_t MakeARBPSOKey( { h ^= v + 0x9e3779b97f4a7c15ull + (h << 6) + (h >> 2); }; + auto mixFloat = [&](float f) + { + uint32_t bits = 0; + memcpy(&bits, &f, sizeof(bits)); + mix(bits); + }; mix(uint32_t(key.pipeline)); mix(uint32_t(key.blendSrc)); @@ -7586,6 +7700,9 @@ static uint64_t MakeARBPSOKey( mix(key.depthTest ? 1ull : 0ull); mix(key.depthWrite ? 1ull : 0ull); mix(uint32_t(key.depthFunc)); + mix(key.polygonOffsetEnabled ? 1ull : 0ull); + mixFloat(key.polygonOffsetEnabled ? key.polygonOffsetFactor : 0.0f); + mixFloat(key.polygonOffsetEnabled ? key.polygonOffsetUnits : 0.0f); mix(uint32_t(topoType)); mix(nativeColorOnly ? 1ull : 0ull); mix(nativeColorOnly ? 1ull : uint64_t(QD3D12_GBufferSampleCount())); @@ -10224,6 +10341,9 @@ void APIENTRY glEnable(GLenum cap) #ifdef GL_DEPTH_BOUNDS_TEST_EXT case GL_DEPTH_BOUNDS_TEST_EXT: g_gl.depthBoundsTest = true; break; #endif + case GL_POLYGON_OFFSET_POINT: g_gl.polygonOffsetPoint = true; break; + case GL_POLYGON_OFFSET_LINE: g_gl.polygonOffsetLine = true; break; + case GL_POLYGON_OFFSET_FILL: g_gl.polygonOffsetFill = true; break; case GL_VERTEX_PROGRAM_ARB: case GL_FRAGMENT_PROGRAM_ARB: QD3D12ARB_SetEnabled(cap, true); @@ -10258,6 +10378,9 @@ void APIENTRY glDisable(GLenum cap) #ifdef GL_DEPTH_BOUNDS_TEST_EXT case GL_DEPTH_BOUNDS_TEST_EXT: g_gl.depthBoundsTest = false; break; #endif + case GL_POLYGON_OFFSET_POINT: g_gl.polygonOffsetPoint = false; break; + case GL_POLYGON_OFFSET_LINE: g_gl.polygonOffsetLine = false; break; + case GL_POLYGON_OFFSET_FILL: g_gl.polygonOffsetFill = false; break; case GL_VERTEX_PROGRAM_ARB: case GL_FRAGMENT_PROGRAM_ARB: QD3D12ARB_SetEnabled(cap, false); @@ -10893,6 +11016,9 @@ void APIENTRY glGetFloatv(GLenum pname, GLfloat* params) params[1] = (GLfloat)g_gl.depthBoundsMax; break; #endif + case GL_QD3D12_TONEMAP_BRIGHTNESS: + params[0] = g_gl.toneMapBrightness; + break; case GL_MODELVIEW_MATRIX: memcpy(params, g_gl.modelStack.back().m, sizeof(GLfloat) * 16); break; @@ -10905,6 +11031,12 @@ void APIENTRY glGetFloatv(GLenum pname, GLfloat* params) params[2] = g_gl.curColor[2]; params[3] = g_gl.curColor[3]; break; + case GL_POLYGON_OFFSET_FACTOR: + params[0] = g_gl.polygonOffsetFactor; + break; + case GL_POLYGON_OFFSET_UNITS: + params[0] = g_gl.polygonOffsetUnits; + break; default: memset(params, 0, sizeof(GLfloat) * 16); break; @@ -13416,6 +13548,12 @@ PROC WINAPI qd3d12_wglGetProcAddress(LPCSTR name) { { "QD3D12_SetUpscalerBackend", (PROC)QD3D12_SetUpscalerBackend }, { "QD3D12_SetUpscalerQuality", (PROC)QD3D12_SetUpscalerQuality }, { "QD3D12_SetUpscalerSharpness", (PROC)QD3D12_SetUpscalerSharpness }, + { "QD3D12_SetToneMapBrightness", (PROC)QD3D12_SetToneMapBrightness }, + { "QD3D12_GetToneMapBrightness", (PROC)QD3D12_GetToneMapBrightness }, + { "glToneMapBrightnessQD3D12", (PROC)glToneMapBrightnessQD3D12 }, + { "glToneMapBrightnessfQD3D12", (PROC)glToneMapBrightnessfQD3D12 }, + { "glTonemapBrightnessQD3D12", (PROC)glTonemapBrightnessQD3D12 }, + { "glTonemapBrightnessfQD3D12", (PROC)glTonemapBrightnessfQD3D12 }, { "QD3D12_EnableRayAIDenoise", (PROC)QD3D12_EnableRayAIDenoise }, { "QD3D12_EnableDLSSRayReconstruction", (PROC)QD3D12_EnableDLSSRayReconstruction }, { "QD3D12_EnableFSRRayRegeneration", (PROC)QD3D12_EnableFSRRayRegeneration }, @@ -13456,6 +13594,7 @@ PROC WINAPI qd3d12_wglGetProcAddress(LPCSTR name) { { "glStencilOpSeparateATI", (PROC)glStencilOpSeparateATI }, { "glStencilFuncSeparateATI", (PROC)glStencilFuncSeparateATI }, { "glStencilMaskSeparate", (PROC)glStencilMaskSeparate }, + { "glPolygonOffset", (PROC)glPolygonOffset }, { "wglSwapIntervalEXT", (PROC)qd3d12_wglSwapIntervalEXT }, { "wglGetDeviceGammaRamp3DFX", (PROC)qd3d12_wglGetDeviceGammaRamp3DFX }, { "wglSetDeviceGammaRamp3DFX", (PROC)qd3d12_wglSetDeviceGammaRamp3DFX }, @@ -14369,6 +14508,44 @@ void QD3D12_SetUpscalerSharpness(float sharpness) g_gl.upscalerSharpness = ClampValue(sharpness, 0.0f, 1.0f); } +static float QD3D12_ClampToneMapBrightness(float brightness) +{ + if (!std::isfinite(brightness)) + return 1.0f; + + return ClampValue(brightness, 0.0f, 8.0f); +} + +void QD3D12_SetToneMapBrightness(float brightness) +{ + g_gl.toneMapBrightness = QD3D12_ClampToneMapBrightness(brightness); +} + +float QD3D12_GetToneMapBrightness(void) +{ + return g_gl.toneMapBrightness; +} + +void APIENTRY glToneMapBrightnessQD3D12(GLfloat brightness) +{ + QD3D12_SetToneMapBrightness(brightness); +} + +void APIENTRY glToneMapBrightnessfQD3D12(GLfloat brightness) +{ + QD3D12_SetToneMapBrightness(brightness); +} + +void APIENTRY glTonemapBrightnessQD3D12(GLfloat brightness) +{ + QD3D12_SetToneMapBrightness(brightness); +} + +void APIENTRY glTonemapBrightnessfQD3D12(GLfloat brightness) +{ + QD3D12_SetToneMapBrightness(brightness); +} + void QD3D12_EnableRayAIDenoise(int enabled) { g_gl.enableRayAIDenoise = enabled ? true : false; @@ -15495,6 +15672,9 @@ GLboolean APIENTRY glIsEnabled(GLenum cap) #ifdef GL_DEPTH_BOUNDS_TEST_EXT case GL_DEPTH_BOUNDS_TEST_EXT: return g_gl.depthBoundsTest ? GL_TRUE : GL_FALSE; #endif + case GL_POLYGON_OFFSET_POINT: return g_gl.polygonOffsetPoint ? GL_TRUE : GL_FALSE; + case GL_POLYGON_OFFSET_LINE: return g_gl.polygonOffsetLine ? GL_TRUE : GL_FALSE; + case GL_POLYGON_OFFSET_FILL: return g_gl.polygonOffsetFill ? GL_TRUE : GL_FALSE; #ifdef GL_STENCIL_TEST_TWO_SIDE_EXT case GL_STENCIL_TEST_TWO_SIDE_EXT: return g_gl.stencilTwoSide ? GL_TRUE : GL_FALSE; #endif diff --git a/neo/engine/opengl/opengl.h b/neo/engine/opengl/opengl.h index 9bc0b195..6a4f20ec 100644 --- a/neo/engine/opengl/opengl.h +++ b/neo/engine/opengl/opengl.h @@ -2322,4 +2322,7 @@ void APIENTRY glHideAllTopLevelAccelStructures( glRaytracingSceneHandle_t scene); void APIENTRY glShowAllTopLevelAccelStructures( - glRaytracingSceneHandle_t scene); \ No newline at end of file + glRaytracingSceneHandle_t scene); + +void QD3D12_SetUpscalerSharpness(float sharpness); +void QD3D12_SetToneMapBrightness(float brightness); \ No newline at end of file diff --git a/neo/engine/renderer/RenderSystem_init.cpp b/neo/engine/renderer/RenderSystem_init.cpp index 37663736..72848234 100644 --- a/neo/engine/renderer/RenderSystem_init.cpp +++ b/neo/engine/renderer/RenderSystem_init.cpp @@ -83,7 +83,7 @@ idCVar r_finish( "r_finish", "0", CVAR_RENDERER | CVAR_BOOL, "force a call to gl idCVar r_swapInterval( "r_swapInterval", "0", CVAR_RENDERER | CVAR_ARCHIVE | CVAR_INTEGER, "changes wglSwapIntarval" ); idCVar r_gamma( "r_gamma", "1", CVAR_RENDERER | CVAR_ARCHIVE | CVAR_FLOAT, "changes gamma tables", 0.5f, 3.0f ); -idCVar r_brightness( "r_brightness", "1", CVAR_RENDERER | CVAR_ARCHIVE | CVAR_FLOAT, "changes gamma tables", 0.5f, 2.0f ); +idCVar r_brightness( "r_brightnesspt", "1.5", CVAR_RENDERER | CVAR_ARCHIVE | CVAR_FLOAT, "changes gamma tables", 0.5f, 2.0f ); idCVar r_renderer( "r_renderer", "best", CVAR_RENDERER | CVAR_ARCHIVE, "hardware specific renderer path to use", r_rendererArgs, idCmdSystem::ArgCompletion_String ); diff --git a/neo/engine/renderer/draw_dx.cpp b/neo/engine/renderer/draw_dx.cpp index ac694535..7307254c 100644 --- a/neo/engine/renderer/draw_dx.cpp +++ b/neo/engine/renderer/draw_dx.cpp @@ -158,6 +158,8 @@ void RB_DXDrawInteractions(void) viewLight_t* vLight; bool hasLight = false; + QD3D12_SetToneMapBrightness(r_brightness.GetFloat()); + for (vLight = backEnd.viewDef->viewLights; vLight; vLight = vLight->next) { backEnd.vLight = vLight; @@ -187,9 +189,9 @@ void RB_DXDrawInteractions(void) vLight->globalLightOrigin.x, vLight->globalLightOrigin.y, vLight->globalLightOrigin.z, - srcLight.lightRadius[0] * 1.3f, - srcLight.lightRadius[1] * 1.3f, - srcLight.lightRadius[2] * 2.0f, + srcLight.lightRadius[0] * 1.15f, + srcLight.lightRadius[1] * 1.15f, + srcLight.lightRadius[2] * 1.5f, r, g, b, intensity);