diff --git a/src/dxvk/imgui/dxvk_imgui.cpp b/src/dxvk/imgui/dxvk_imgui.cpp index df60b9d8f..863bfb3f2 100644 --- a/src/dxvk/imgui/dxvk_imgui.cpp +++ b/src/dxvk/imgui/dxvk_imgui.cpp @@ -141,8 +141,11 @@ namespace dxvk { std::vector rtxTextureOptions = { {"uitextures", "UI Texture", &RtxOptions::Get()->uiTexturesObject()}, {"worldspaceuitextures", "World Space UI Texture", &RtxOptions::Get()->worldSpaceUiTexturesObject()}, + {"worldspaceuibackgroundtextures", "World Space UI Background Texture", &RtxOptions::Get()->worldSpaceUiBackgroundTexturesObject()}, {"skytextures", "Sky Texture", &RtxOptions::Get()->skyBoxTexturesObject()}, {"ignoretextures", "Ignore Texture (optional)", &RtxOptions::Get()->ignoreTexturesObject()}, + {"hidetextures", "Hide Texture Instance (optional)", &RtxOptions::Get()->hideInstanceTexturesObject()}, + {"lightmaptextures","Lightmap Textures (optional)", &RtxOptions::Get()->lightmapTexturesObject()}, {"ignorelights", "Ignore Lights (optional)", &RtxOptions::Get()->ignoreLightsObject()}, {"particletextures", "Particle Texture (optional)", &RtxOptions::Get()->particleTexturesObject()}, {"beamtextures", "Beam Texture (optional)", &RtxOptions::Get()->beamTexturesObject()}, @@ -1444,7 +1447,6 @@ namespace dxvk { break; } } - const ImVec2 availableSize = ImGui::GetContentRegionAvail(); const float childWindowHeight = availableSize.y < 600 ? 600 : availableSize.y; ImGuiWindowFlags window_flags = ImGuiWindowFlags_None; @@ -1636,7 +1638,8 @@ namespace dxvk { void ImGUI::showSetupWindow(const Rc& ctx) { ImGui::PushItemWidth(200); - const float thumbnailSize = 120.f; + const float thumbnailScale = RtxOptions::textureGridThumbnailScale(); + const float thumbnailSize = (120.f * thumbnailScale); const float thumbnailSpacing = ImGui::GetStyle().ItemSpacing.x; const float thumbnailPadding = ImGui::GetStyle().CellPadding.x; const uint32_t numThumbnailsPerRow = uint32_t(std::max(1.f, (m_windowWidth - 18.f) / (thumbnailSize + thumbnailSpacing + thumbnailPadding * 2.f))); @@ -1644,100 +1647,155 @@ namespace dxvk { ImGui::Checkbox("Preserve discarded textures", &RtxOptions::Get()->keepTexturesForTaggingObject()); if (IMGUI_ADD_TOOLTIP(ImGui::CollapsingHeader("Step 1: Categorize Textures", collapsingHeaderClosedFlags), "Select texture definitions for Remix")) { - ImGui::Checkbox("Split Texture Category List", &showLegacyTextureGuiObject()); - + ImGui::DragFloat("Texture Thumbnail Scale", &RtxOptions::Get()->textureGridThumbnailScaleObject(), 0.25f, 0.25f, 3.f, "%.2f", sliderFlags); + ImGui::Separator(); if (!showLegacyTextureGui()) { showTextureSelectionGrid(ctx, "textures", numThumbnailsPerRow, thumbnailSize); } else { - if (IMGUI_ADD_TOOLTIP(ImGui::CollapsingHeader("Step 1: UI Textures", collapsingHeaderClosedFlags), RtxOptions::Get()->uiTexturesDescription())) { + ImGui::Indent(); + if (IMGUI_ADD_TOOLTIP(ImGui::CollapsingHeader("UI Textures", collapsingHeaderClosedFlags), RtxOptions::Get()->uiTexturesDescription())) { + //Legacy GUI: Using indents in this field is causing issues with padding where the rightmost texture is cut off by the scroll bar. + //Unindent and indent around each list to preserve formatting and use full space while keeping headers and other UI indented for organization. + ImGui::Unindent(); showTextureSelectionGrid(ctx, "uitextures", numThumbnailsPerRow, thumbnailSize); + ImGui::Indent(); + } - if (IMGUI_ADD_TOOLTIP(ImGui::CollapsingHeader("Step 1.2: Worldspace UI Textures (optional)", collapsingHeaderClosedFlags), RtxOptions::Get()->worldSpaceUiTexturesDescription())) { + if (IMGUI_ADD_TOOLTIP(ImGui::CollapsingHeader("Worldspace UI Textures (optional)", collapsingHeaderClosedFlags), RtxOptions::Get()->worldSpaceUiTexturesDescription())) { + ImGui::Unindent(); showTextureSelectionGrid(ctx, "worldspaceuitextures", numThumbnailsPerRow, thumbnailSize); + ImGui::Indent(); } - if (ImGui::CollapsingHeader("Step 3: Sky Parameters (optional)", collapsingHeaderClosedFlags)) { + if (IMGUI_ADD_TOOLTIP(ImGui::CollapsingHeader("Worldspace UI Background Textures (optional)", collapsingHeaderClosedFlags), RtxOptions::Get()->worldSpaceUiBackgroundTexturesDescription())) { + ImGui::Unindent(); + showTextureSelectionGrid(ctx, "worldspaceuibackgroundtextures", numThumbnailsPerRow, thumbnailSize); ImGui::Indent(); + } - if (IMGUI_ADD_TOOLTIP(ImGui::CollapsingHeader("Sky Textures", collapsingHeaderClosedFlags), RtxOptions::Get()->skyBoxTexturesDescription())) { - showTextureSelectionGrid(ctx, "skytextures", numThumbnailsPerRow, thumbnailSize); - } - + if (IMGUI_ADD_TOOLTIP(ImGui::CollapsingHeader("Sky Textures", collapsingHeaderClosedFlags), RtxOptions::Get()->skyBoxTexturesDescription())) { ImGui::Unindent(); + showTextureSelectionGrid(ctx, "skytextures", numThumbnailsPerRow, thumbnailSize); + ImGui::Indent(); } - if (IMGUI_ADD_TOOLTIP(ImGui::CollapsingHeader("Step 4: Ignore Textures (optional)", collapsingHeaderClosedFlags), RtxOptions::Get()->ignoreTexturesDescription())) { + if (IMGUI_ADD_TOOLTIP(ImGui::CollapsingHeader("Ignore Textures (optional)", collapsingHeaderClosedFlags), RtxOptions::Get()->ignoreTexturesDescription())) { + ImGui::Unindent(); showTextureSelectionGrid(ctx, "ignoretextures", numThumbnailsPerRow, thumbnailSize); + ImGui::Indent(); + } + + if (IMGUI_ADD_TOOLTIP(ImGui::CollapsingHeader("Hide Instance Textures (optional)", collapsingHeaderClosedFlags), RtxOptions::Get()->hideInstanceTexturesDescription())) { + ImGui::Unindent(); + showTextureSelectionGrid(ctx, "hidetextures", numThumbnailsPerRow, thumbnailSize); + ImGui::Indent(); + } + if (IMGUI_ADD_TOOLTIP(ImGui::CollapsingHeader("Lightmap Textures (optional)", collapsingHeaderClosedFlags), RtxOptions::Get()->lightmapTexturesDescription())) { + ImGui::Unindent(); + showTextureSelectionGrid(ctx, "lightmaptextures", numThumbnailsPerRow, thumbnailSize); + ImGui::Indent(); } - if (IMGUI_ADD_TOOLTIP(ImGui::CollapsingHeader("Step 5: Ignore Lights (optional)", collapsingHeaderClosedFlags), RtxOptions::Get()->ignoreLightsDescription())) { + if (IMGUI_ADD_TOOLTIP(ImGui::CollapsingHeader("Ignore Lights (optional)", collapsingHeaderClosedFlags), RtxOptions::Get()->ignoreLightsDescription())) { + ImGui::Unindent(); showTextureSelectionGrid(ctx, "ignorelights", numThumbnailsPerRow, thumbnailSize); + ImGui::Indent(); } - if (IMGUI_ADD_TOOLTIP(ImGui::CollapsingHeader("Step 6: Particle Textures (optional)", collapsingHeaderClosedFlags), RtxOptions::Get()->particleTexturesDescription())) { + if (IMGUI_ADD_TOOLTIP(ImGui::CollapsingHeader("Particle Textures (optional)", collapsingHeaderClosedFlags), RtxOptions::Get()->particleTexturesDescription())) { + ImGui::Unindent(); showTextureSelectionGrid(ctx, "particletextures", numThumbnailsPerRow, thumbnailSize); + ImGui::Indent(); } - if (IMGUI_ADD_TOOLTIP(ImGui::CollapsingHeader("Step 6.1: Beam Textures (optional)", collapsingHeaderClosedFlags), RtxOptions::Get()->beamTexturesDescription())) { + if (IMGUI_ADD_TOOLTIP(ImGui::CollapsingHeader("Beam Textures (optional)", collapsingHeaderClosedFlags), RtxOptions::Get()->beamTexturesDescription())) { + ImGui::Unindent(); showTextureSelectionGrid(ctx, "beamtextures", numThumbnailsPerRow, thumbnailSize); + ImGui::Indent(); } - if (IMGUI_ADD_TOOLTIP(ImGui::CollapsingHeader("Step 6.2: Add Lights to Textures (optional)", collapsingHeaderClosedFlags), RtxOptions::Get()->lightConverterDescription())) { + if (IMGUI_ADD_TOOLTIP(ImGui::CollapsingHeader("Add Lights to Textures (optional)", collapsingHeaderClosedFlags), RtxOptions::Get()->lightConverterDescription())) { + ImGui::Unindent(); showTextureSelectionGrid(ctx, "lightconvertertextures", numThumbnailsPerRow, thumbnailSize); + ImGui::Indent(); } - if (IMGUI_ADD_TOOLTIP(ImGui::CollapsingHeader("Step 7: Decal Textures (optional)", collapsingHeaderClosedFlags), RtxOptions::Get()->decalTexturesDescription())) { + if (IMGUI_ADD_TOOLTIP(ImGui::CollapsingHeader("Decal Textures (optional)", collapsingHeaderClosedFlags), RtxOptions::Get()->decalTexturesDescription())) { + ImGui::Unindent(); showTextureSelectionGrid(ctx, "decaltextures", numThumbnailsPerRow, thumbnailSize); + ImGui::Indent(); } - if (IMGUI_ADD_TOOLTIP(ImGui::CollapsingHeader("Step 7.1: Dynamic Decal Textures", collapsingHeaderClosedFlags), RtxOptions::Get()->dynamicDecalTexturesDescription())) { + 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("Step 7.2: Single Offset Decal Textures", collapsingHeaderClosedFlags), RtxOptions::Get()->singleOffsetDecalTexturesDescription())) { + + 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("Step 7.3: Non-Offset Decal Textures", collapsingHeaderClosedFlags), RtxOptions::Get()->nonOffsetDecalTexturesDescription())) { + 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("Step 8.1: Legacy Cutout Textures (optional)", collapsingHeaderClosedFlags), RtxOptions::Get()->cutoutTexturesDescription())) { - ImGui::DragFloat("Force Cutout Alpha", &RtxOptions::Get()->forceCutoutAlphaObject(), 0.01f, 0.0f, 1.0f, "%.3f", sliderFlags); + if (IMGUI_ADD_TOOLTIP(ImGui::CollapsingHeader("Legacy Cutout Textures (optional)", collapsingHeaderClosedFlags), RtxOptions::Get()->cutoutTexturesDescription())) { + ImGui::Unindent(); showTextureSelectionGrid(ctx, "cutouttextures", numThumbnailsPerRow, thumbnailSize); + ImGui::Indent(); } - if (IMGUI_ADD_TOOLTIP(ImGui::CollapsingHeader("Step 8.2: Terrain Textures", collapsingHeaderClosedFlags), RtxOptions::Get()->terrainTexturesDescription())) { + if (IMGUI_ADD_TOOLTIP(ImGui::CollapsingHeader("Terrain Textures", collapsingHeaderClosedFlags), RtxOptions::Get()->terrainTexturesDescription())) { + ImGui::Unindent(); showTextureSelectionGrid(ctx, "terraintextures", numThumbnailsPerRow, thumbnailSize); + ImGui::Indent(); } - if (IMGUI_ADD_TOOLTIP(ImGui::CollapsingHeader("Step 8.3: Water Textures (optional)", collapsingHeaderClosedFlags), RtxOptions::Get()->animatedWaterTexturesDescription())) { + if (IMGUI_ADD_TOOLTIP(ImGui::CollapsingHeader("Water Textures (optional)", collapsingHeaderClosedFlags), RtxOptions::Get()->animatedWaterTexturesDescription())) { + ImGui::Unindent(); showTextureSelectionGrid(ctx, "watertextures", numThumbnailsPerRow, thumbnailSize); + ImGui::Indent(); } - if (RtxOptions::AntiCulling::Object::enable() && - IMGUI_ADD_TOOLTIP(ImGui::CollapsingHeader("Step 8.4: Anti-Culling Textures (optional)", collapsingHeaderClosedFlags), RtxOptions::Get()->antiCullingTexturesDescription())) { - showTextureSelectionGrid(ctx, "antiCullingTextures", numThumbnailsPerRow, thumbnailSize); + if (IMGUI_ADD_TOOLTIP(ImGui::CollapsingHeader("Player Model Textures (optional)", collapsingHeaderClosedFlags), RtxOptions::Get()->playerModelTexturesDescription())) { + ImGui::Unindent(); + showTextureSelectionGrid(ctx, "playermodeltextures", numThumbnailsPerRow, thumbnailSize); + ImGui::Indent(); } - if (IMGUI_ADD_TOOLTIP(ImGui::CollapsingHeader("Step 8.5: Motion Blur Mask-Out Textures (optional)", collapsingHeaderClosedFlags), RtxOptions::Get()->motionBlurMaskOutTexturesDescription())) { - showTextureSelectionGrid(ctx, "motionBlurMaskOutTextures", numThumbnailsPerRow, thumbnailSize); + if (IMGUI_ADD_TOOLTIP(ImGui::CollapsingHeader("Player Model Body Textures (optional)", collapsingHeaderClosedFlags), RtxOptions::Get()->playerModelBodyTexturesDescription())) { + ImGui::Unindent(); + showTextureSelectionGrid(ctx, "playermodelbodytextures", numThumbnailsPerRow, thumbnailSize); + ImGui::Indent(); } - if (IMGUI_ADD_TOOLTIP(ImGui::CollapsingHeader("Step 9.1: Player Model Textures (optional)", collapsingHeaderClosedFlags), RtxOptions::Get()->playerModelTexturesDescription())) { - showTextureSelectionGrid(ctx, "playermodeltextures", numThumbnailsPerRow, thumbnailSize); + if (RtxOptions::AntiCulling::Object::enable() && + IMGUI_ADD_TOOLTIP(ImGui::CollapsingHeader("Anti-Culling Textures (optional)", collapsingHeaderClosedFlags), RtxOptions::Get()->antiCullingTexturesDescription())) { + ImGui::Unindent(); + showTextureSelectionGrid(ctx, "antiCullingTextures", numThumbnailsPerRow, thumbnailSize); + ImGui::Indent(); } - if (IMGUI_ADD_TOOLTIP(ImGui::CollapsingHeader("Step 9.2: Player Model Body Textures (optional)", collapsingHeaderClosedFlags), RtxOptions::Get()->playerModelBodyTexturesDescription())) { - showTextureSelectionGrid(ctx, "playermodelbodytextures", numThumbnailsPerRow, thumbnailSize); + if (IMGUI_ADD_TOOLTIP(ImGui::CollapsingHeader("Motion Blur Mask-Out Textures (optional)", collapsingHeaderClosedFlags), RtxOptions::Get()->motionBlurMaskOutTexturesDescription())) { + ImGui::Unindent(); + showTextureSelectionGrid(ctx, "motionBlurMaskOutTextures", numThumbnailsPerRow, thumbnailSize); + ImGui::Indent(); } - if (IMGUI_ADD_TOOLTIP(ImGui::CollapsingHeader("Step 10: Opacity Micromap Ignore Textures (optional)", collapsingHeaderClosedFlags), RtxOptions::Get()->opacityMicromapIgnoreTexturesDescription())) { + if (IMGUI_ADD_TOOLTIP(ImGui::CollapsingHeader("Opacity Micromap Ignore Textures (optional)", collapsingHeaderClosedFlags), RtxOptions::Get()->opacityMicromapIgnoreTexturesDescription())) { + ImGui::Unindent(); showTextureSelectionGrid(ctx, "opacitymicromapignoretextures", numThumbnailsPerRow, thumbnailSize); + ImGui::Indent(); } + ImGui::Unindent(); } } @@ -1748,13 +1806,17 @@ namespace dxvk { ImGui::Checkbox("Scene Left-Handed", &RtxOptions::Get()->isLHSObject()); fusedWorldViewModeCombo.getKey(&RtxOptions::Get()->fusedWorldViewModeRef()); ImGui::Separator(); - + ImGui::DragFloat("Unique Object Search Distance", &RtxOptions::Get()->uniqueObjectDistanceObject(), 0.01f, 0.01f, FLT_MAX, "%.3f", sliderFlags); ImGui::Separator(); - ImGui::DragFloat("Vertex Color Strength", &RtxOptions::Get()->vertexColorStrengthObject(), 0.001f, 0.0f, 1.0f); ImGui::Separator(); - + if (ImGui::CollapsingHeader("Texture Parameters", collapsingHeaderClosedFlags)) { + ImGui::Indent(); + ImGui::DragFloat("Force Cutout Alpha", &RtxOptions::Get()->forceCutoutAlphaObject(), 0.01f, 0.0f, 1.0f, "%.3f", sliderFlags); + ImGui::DragFloat("World Space UI Background Offset", &RtxOptions::Get()->worldSpaceUiBackgroundOffsetObject(), 0.01f, -FLT_MAX, FLT_MAX, "%.3f", sliderFlags); + ImGui::Unindent(); + } if (ImGui::CollapsingHeader("Shader Support (Experimental)", collapsingHeaderClosedFlags)) { ImGui::Indent(); ImGui::Checkbox("Capture Vertices from Shader", &D3D9Rtx::useVertexCaptureObject()); diff --git a/src/dxvk/imgui/dxvk_imgui_about.cpp b/src/dxvk/imgui/dxvk_imgui_about.cpp index bf91cb45f..48bfe87d9 100644 --- a/src/dxvk/imgui/dxvk_imgui_about.cpp +++ b/src/dxvk/imgui/dxvk_imgui_about.cpp @@ -91,7 +91,8 @@ namespace dxvk { ImGuiAbout::Credits::Credits() : m_sections({ { "Github Contributors", - { "Leonardo Leotte"}}, + { "Leonardo Leotte", + "Nico Rodrigues-McKenna"}}, { "Engineering", { "Riley Alston", "Xiangshun Bei", diff --git a/src/dxvk/rtx_render/rtx_options.h b/src/dxvk/rtx_render/rtx_options.h index 0c7584bf7..346233198 100644 --- a/src/dxvk/rtx_render/rtx_options.h +++ b/src/dxvk/rtx_render/rtx_options.h @@ -163,7 +163,10 @@ namespace dxvk { RW_RTX_OPTION("rtx", fast_unordered_set, worldSpaceUiTextures, {}, "Textures on draw calls that should be treated as worldspace UI elements.\n" "Unlike typical UI textures this option is useful for improved rendering of UI elements which appear as part of the scene (moving around in 3D space rather than as a screenspace element)."); - RW_RTX_OPTION("rtx", fast_unordered_set, worldSpaceUiBackgroundTextures, {}, ""); + RW_RTX_OPTION("rtx", fast_unordered_set, worldSpaceUiBackgroundTextures, {}, + "Hack/workaround option for dynamic world space UI textures with a coplanar background.\n" + "Apply to backgrounds if the foreground material is a dynamic world texture rendered in UI that is unpredictable and rapidly changing.\n" + "This offsets the background texture backwards."); RW_RTX_OPTION("rtx", fast_unordered_set, hideInstanceTextures, {}, "Textures on draw calls that should be hidden from rendering, but not totally ignored.\n" "This is similar to rtx.ignoreTextures but instead of completely ignoring such draw calls they are only hidden from rendering, allowing for the hidden objects to still appear in captures.\n" @@ -231,7 +234,10 @@ namespace dxvk { RTX_OPTION_ENV("rtx", float, timeDeltaBetweenFrames, 0.f, "RTX_FRAME_TIME_DELTA_MS", "Frame time delta to use during scene processing. Setting this to 0 will use actual frame time delta for a given frame. Non-zero value is primarily used for automation to ensure determinism run to run."); RTX_OPTION_FLAG("rtx", bool, keepTexturesForTagging, false, RtxOptionFlags::NoSave, "A flag to keep all textures in video memory, which can drastically increase VRAM consumption. Intended to assist with tagging textures that are only used for a short period of time (such as loading screens). Use only when necessary!"); - + RTX_OPTION("rtx.gui", float, textureGridThumbnailScale, 1.f, + "A float to set the scale of thumbnails while selecting textures.\n" + "This will be scaled by the default value of 120 pixels.\n" + "This value must always be greater than zero."); RTX_OPTION("rtx", bool, skipDrawCallsPostRTXInjection, false, "Ignores all draw calls recorded after RTX Injection, the location of which varies but is currently based on when tagged UI textures begin to draw."); RTX_OPTION_ENV("rtx", DlssPreset, dlssPreset, DlssPreset::On, "RTX_DLSS_PRESET", "Combined DLSS Preset for quickly controlling Upscaling, Frame Interpolation and Latency Reduction."); RTX_OPTION("rtx", NisPreset, nisPreset, NisPreset::Balanced, "Adjusts NIS scaling factor, trades quality for performance.");