Skip to content

Commit

Permalink
Merge branch 'dev/adunn/ahs_decal' into 'main'
Browse files Browse the repository at this point in the history
[REMIX-2454]  Simplify decal handling

See merge request lightspeedrtx/dxvk-remix-nv!632
  • Loading branch information
AlexDunn committed Jan 5, 2024
2 parents 4553ed7 + 11e910b commit 8922bea
Show file tree
Hide file tree
Showing 29 changed files with 231 additions and 425 deletions.
2 changes: 1 addition & 1 deletion src/d3d9/d3d9_rtx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace dxvk {
const uint32_t kRenderTargetIndex = 0;

#define CATEGORIES_REQUIRE_DRAW_CALL InstanceCategories::Sky, InstanceCategories::Terrain
#define CATEGORIES_REQUIRE_GEOMETRY_COPY InstanceCategories::DecalStatic, InstanceCategories::DecalDynamic, InstanceCategories::DecalNoOffset, InstanceCategories::Terrain, InstanceCategories::WorldUI
#define CATEGORIES_REQUIRE_GEOMETRY_COPY InstanceCategories::Terrain, InstanceCategories::WorldUI

D3D9Rtx::D3D9Rtx(D3D9DeviceEx* d3d9Device)
: m_rtStagingData(d3d9Device->GetDXVKDevice(), (VkMemoryPropertyFlagBits) (VK_MEMORY_PROPERTY_HOST_CACHED_BIT | VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT))
Expand Down
34 changes: 0 additions & 34 deletions src/dxvk/imgui/dxvk_imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,6 @@ namespace dxvk {
{"beamtextures", "Beam Texture (optional)", &RtxOptions::Get()->beamTexturesObject()},
{"lightconvertertextures", "Add Light to Textures (optional)", &RtxOptions::Get()->lightConverterObject()},
{"decaltextures", "Decal Texture (optional)", &RtxOptions::Get()->decalTexturesObject()},
{"dynamicdecaltextures", "Dynamic Decal Texture", &RtxOptions::Get()->dynamicDecalTexturesObject()},
{"singleoffsetdecaltextures", "Single Offset Decal Texture", &RtxOptions::Get()->singleOffsetDecalTexturesObject()},
{"nonoffsetdecaltextures", "Non-Offset Decal Texture", &RtxOptions::Get()->nonOffsetDecalTexturesObject()},
{"cutouttextures", "Legacy Cutout Texture (optional)", &RtxOptions::Get()->cutoutTexturesObject()},
{"terraintextures", "Terrain Texture", &RtxOptions::Get()->terrainTexturesObject()},
{"watertextures", "Water Texture (optional)", &RtxOptions::Get()->animatedWaterTexturesObject()},
Expand Down Expand Up @@ -1952,24 +1949,6 @@ namespace dxvk {
ImGui::Indent();
}

if (IMGUI_ADD_TOOLTIP(ImGui::CollapsingHeader("Dynamic Decal Textures", collapsingHeaderClosedFlags), RtxOptions::Get()->dynamicDecalTexturesDescription())) {
ImGui::Unindent();
showTextureSelectionGrid(ctx, "dynamicdecaltextures", numThumbnailsPerRow, thumbnailSize);
ImGui::Indent();
}

if (IMGUI_ADD_TOOLTIP(ImGui::CollapsingHeader("Single Offset Decal Textures", collapsingHeaderClosedFlags), RtxOptions::Get()->singleOffsetDecalTexturesDescription())) {
ImGui::Unindent();
showTextureSelectionGrid(ctx, "singleoffsetdecaltextures", numThumbnailsPerRow, thumbnailSize);
ImGui::Indent();
}

if (IMGUI_ADD_TOOLTIP(ImGui::CollapsingHeader("Non-Offset Decal Textures", collapsingHeaderClosedFlags), RtxOptions::Get()->nonOffsetDecalTexturesDescription())) {
ImGui::Unindent();
showTextureSelectionGrid(ctx, "nonoffsetdecaltextures", numThumbnailsPerRow, thumbnailSize);
ImGui::Indent();
}

if (IMGUI_ADD_TOOLTIP(ImGui::CollapsingHeader("Legacy Cutout Textures (optional)", collapsingHeaderClosedFlags), RtxOptions::Get()->cutoutTexturesDescription())) {
ImGui::Unindent();
showTextureSelectionGrid(ctx, "cutouttextures", numThumbnailsPerRow, thumbnailSize);
Expand Down Expand Up @@ -2791,19 +2770,6 @@ namespace dxvk {
ImGui::DragInt("Min Prims in Static BLAS", &RtxOptions::Get()->minPrimsInStaticBLASObject(), 1.f, 100, 0);
ImGui::Checkbox("Portals: Virtual Instance Matching", &RtxOptions::Get()->useRayPortalVirtualInstanceMatchingObject());
ImGui::Checkbox("Portals: Fade In Effect", &RtxOptions::Get()->enablePortalFadeInEffectObject());

if (ImGui::CollapsingHeader("Decals", collapsingHeaderClosedFlags)) {
ImGui::Indent();

ImGui::TextWrapped("Warning: changes to these parameters will only apply to new geometry. Existing geometry needs to be invalidated by either a game reload or gameplay and/or camera view change if the game uses runtime or view dependent geometry batching per draw call.");

ImGui::DragFloat("Offset Multiplier [m]", &RtxOptions::Decals::offsetMultiplierMetersObject(), 0.0001f, 0.f, 0.f, "%.5f");
ImGui::DragInt("Base Offset Index", &RtxOptions::Decals::baseOffsetIndexObject(), 1.f, 1, 1000);
ImGui::DragInt("Max Offset Index", &RtxOptions::Decals::maxOffsetIndexObject(), 1.f, 1, 10000);
ImGui::DragInt("Offset Increase Between Decal Draw Calls", &RtxOptions::Decals::offsetIndexIncreaseBetweenDrawCallsObject(), 1.f, 1, 1000);
ImGui::Unindent();
}

ImGui::Unindent();
}

Expand Down
2 changes: 2 additions & 0 deletions src/dxvk/rtx_render/rtx_debug_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@ namespace dxvk {

{DEBUG_VIEW_PRIMARY_USE_ALTERNATE_DISOCCLUSION_THRESHOLD, "Primary Use Alternate Disocclusion Threshold"},

{DEBUG_VIEW_PRIMARY_DECAL_ALBEDO, "Primary Decal Albedo" },

{DEBUG_VIEW_PRIMARY_SPECULAR_ALBEDO, "Primary Specular Albedo"},
{DEBUG_VIEW_SECONDARY_SPECULAR_ALBEDO, "Secondary Specular Albedo"},

Expand Down
3 changes: 1 addition & 2 deletions src/dxvk/rtx_render/rtx_dlss.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ namespace dxvk {
rtOutput.m_compositeOutput.view(Resources::AccessType::Read),
rtOutput.m_primaryScreenSpaceMotionVector.view,
rtOutput.m_primaryDepth.view,
rtOutput.getCurrentPrimaryWorldPositionWorldTriangleNormal().view,
rtOutput.getCurrentPrimaryWorldPositionWorldTriangleNormal().view(Resources::AccessType::Read),
rtOutput.m_primaryAlbedo.view,
rtOutput.m_sharedBiasCurrentColorMask.view(Resources::AccessType::Read)
};
Expand Down Expand Up @@ -276,7 +276,6 @@ namespace dxvk {
&rtOutput.m_primaryAlbedo, // pDiffuseAlbedo
specularAlbedoInput, // pSpecularAlbedo
&autoExposure.getExposureTexture(), // pExposure
&rtOutput.getCurrentPrimaryWorldPositionWorldTriangleNormal(), // pPosition
normalsInput, // pNormals
&rtOutput.m_primaryPerceptualRoughness, // pRoughness
&rtOutput.m_sharedBiasCurrentColorMask.resource(Resources::AccessType::Read),// pBiasCurrentColorMask
Expand Down
Loading

0 comments on commit 8922bea

Please sign in to comment.