Skip to content

Commit

Permalink
Add option to disable skybox rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
mmdanggg2 committed Nov 16, 2024
1 parent 0ec9027 commit 5c149da
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 10 deletions.
6 changes: 5 additions & 1 deletion Config/D3D9DrvRTX.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[D3D9DrvRTX.D3D9RenderDevice]
EnableHashTextures=False
EnableSkyBoxAnchors=True
EnableSkyBoxAnchors=False
EnableSkyBoxRendering=True
LightMultiplier=4000.000000
LightRadiusDivisor=70.000000
LightRadiusExponent=0.550000
1 change: 1 addition & 0 deletions Config/D3D9DrvRTX.int
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Object=(Name=D3D9DrvRTX.D3D9RenderDevice,Class=Class,MetaClass=Engine.RenderDevice,Autodetect=d3d9.dll)
Preferences=(Caption="Rendering",Parent="Advanced Options")
Preferences=(Caption="Direct3D 9 RTX Optimised",Parent="Rendering",Class=D3D9DrvRTX.D3D9RenderDevice,Immediate=True)
Property=(Config,Class=D3D9DrvRTX.D3D9RenderDevice,Name=EnableSkyBoxRendering,Title="Enable Skybox Rendering",Description="Enables the rendering of skybox zones.")
Property=(Config,Class=D3D9DrvRTX.D3D9RenderDevice,Name=EnableSkyBoxAnchors,Title="Enable Skybox Anchors",Description="Enables the special mesh generated for anchoring the skybox in remix.")
Property=(Config,Class=D3D9DrvRTX.D3D9RenderDevice,Name=EnableHashTextures,Title="Enable Hash Textures",Description="Enables specially generated textures with a stable hash in place of procedurally generated ones.")
Property=(Config,Class=D3D9DrvRTX.D3D9RenderDevice,Name=LightMultiplier,Title="Light Multiplier",Description="Global light brightness multiplier.")
Expand Down
1 change: 1 addition & 0 deletions Inc/D3D9RenderDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,7 @@ class UD3D9RenderDevice : public RENDERDEVICE_SUPER {
FTime m_prevFrameTimestamp;
UBOOL SmoothMaskedTextures;

UBOOL EnableSkyBoxRendering;
UBOOL EnableSkyBoxAnchors;
UBOOL EnableHashTextures;
FLOAT LightMultiplier;
Expand Down
16 changes: 9 additions & 7 deletions Src/D3D9Render.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,15 +260,17 @@ void UD3D9Render::DrawWorld(FSceneNode* frame) {

std::unordered_map<UTexture*, FTextureInfo> lockedTextures;

for (FSceneNode* child = frame->Child; child; child = child->Sibling) {
if (frame->Level->GetZoneActor(child->ZoneNumber)->IsA(ASkyZoneInfo::StaticClass())) {
d3d9Dev->startWorldDraw(child);
drawFrame(child, d3d9Dev, modelFacets, objs, lockedTextures, true);
d3d9Dev->endWorldDraw(child);
break;
if (d3d9Dev->EnableSkyBoxRendering) {
for (FSceneNode* child = frame->Child; child; child = child->Sibling) {
if (frame->Level->GetZoneActor(child->ZoneNumber)->IsA(ASkyZoneInfo::StaticClass())) {
d3d9Dev->startWorldDraw(child);
drawFrame(child, d3d9Dev, modelFacets, objs, lockedTextures, true);
d3d9Dev->endWorldDraw(child);
break;
}
}
d3d9Dev->ClearZ(frame);
}
d3d9Dev->ClearZ(frame);

d3d9Dev->startWorldDraw(frame);

Expand Down
5 changes: 3 additions & 2 deletions Src/D3D9RenderDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -403,8 +403,9 @@ void UD3D9RenderDevice::StaticConstructor() {
SC_AddIntConfigParam(TEXT("DynamicTexIdRecycleLevel"), CPP_PROPERTY_LOCAL(DynamicTexIdRecycleLevel), 100);
SC_AddBoolConfigParam(0, TEXT("TexDXT1ToDXT3"), CPP_PROPERTY_LOCAL(TexDXT1ToDXT3), 0);
SC_AddIntConfigParam(TEXT("FrameRateLimit"), CPP_PROPERTY_LOCAL(FrameRateLimit), 0);
SC_AddBoolConfigParam(2, TEXT("SmoothMaskedTextures"), CPP_PROPERTY_LOCAL(SmoothMaskedTextures), 0);
SC_AddBoolConfigParam(1, TEXT("EnableSkyBoxAnchors"), CPP_PROPERTY_LOCAL(EnableSkyBoxAnchors), 1);
SC_AddBoolConfigParam(3, TEXT("SmoothMaskedTextures"), CPP_PROPERTY_LOCAL(SmoothMaskedTextures), 0);
SC_AddBoolConfigParam(2, TEXT("EnableSkyBoxRendering"), CPP_PROPERTY_LOCAL(EnableSkyBoxRendering), 1);
SC_AddBoolConfigParam(1, TEXT("EnableSkyBoxAnchors"), CPP_PROPERTY_LOCAL(EnableSkyBoxAnchors), 0);
SC_AddBoolConfigParam(0, TEXT("EnableHashTextures"), CPP_PROPERTY_LOCAL(EnableHashTextures), 1);
SC_AddFloatConfigParam(TEXT("LightMultiplier"), CPP_PROPERTY_LOCAL(LightMultiplier), 4000.0f);
SC_AddFloatConfigParam(TEXT("LightRadiusDivisor"), CPP_PROPERTY_LOCAL(LightRadiusDivisor), 70.0f);
Expand Down

0 comments on commit 5c149da

Please sign in to comment.