Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 25 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ find_package(efsw CONFIG REQUIRED)
find_package(Tracy CONFIG REQUIRED)
find_package(directx-headers CONFIG REQUIRED)
add_subdirectory(${CMAKE_SOURCE_DIR}/cmake/Streamline)
include(XeSS-SDK)

find_path(DETOURS_INCLUDE_DIRS "detours/detours.h")
find_library(DETOURS_LIBRARY detours REQUIRED)
Expand Down Expand Up @@ -235,6 +234,27 @@ if(CLANG_FORMAT_PATH)
)
endif()

# #######################################################################################################################
# # HLSL additional include directories for VS intellisense
# #######################################################################################################################

set(HLSL_INCLUDE_DIRS ${FEATURE_SHADER_DIRS} "package/Shaders")

set(HLSL_INCLUDE_JSON "")
foreach(dir IN LISTS HLSL_INCLUDE_DIRS)
if(HLSL_INCLUDE_JSON STREQUAL "")
set(HLSL_INCLUDE_JSON " \"${dir}\"")
else()
set(HLSL_INCLUDE_JSON "${HLSL_INCLUDE_JSON},\n \"${dir}\"")
endif()
endforeach()

configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/shadertoolsconfig.json.in"
"${CMAKE_CURRENT_SOURCE_DIR}/shadertoolsconfig.json"
@ONLY
)

# #######################################################################################################################
# # Shader validation config generation
# #######################################################################################################################
Expand Down Expand Up @@ -826,9 +846,11 @@ set(AIO_PACKAGE "${DIST_PATH}/${PROJECT_NAME}_AIO-${UTC_NOW}.7z")
add_custom_command(
OUTPUT ${AIO_PACKAGE}
DEPENDS ${CORE_SOURCES}
COMMAND ${CMAKE_COMMAND} -E make_directory ${AIO_DIR}
COMMAND ${CMAKE_COMMAND} --install ${CMAKE_BINARY_DIR} --prefix ${AIO_DIR}
COMMAND ${CMAKE_COMMAND} -E tar cfv ${AIO_PACKAGE} --format=7zip -- .
WORKING_DIRECTORY ${AIO_DIR}
COMMAND
${CMAKE_COMMAND} -E chdir ${AIO_DIR} ${CMAKE_COMMAND} -E tar cfv
${AIO_PACKAGE} --format=7zip -- .
COMMENT "Creating AIO zip package (manual)"
)
add_custom_target("Package-AIO-Manual" DEPENDS ${AIO_PACKAGE})
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ In Launch Application Menu, use the following settings:
Specifically, the Modded Code includes:

- Skyrim (and its variants)
- Hardware drivers to enable additional functionality provided via proprietary SDKs, such as [Nvidia DLSS](https://developer.nvidia.com/rtx/dlss/get-started), [AMD FidelityFX FSR3](https://gpuopen.com/fidelityfx-super-resolution-3/), and [Intel XeSS](https://github.com/intel/xess)
- Hardware drivers to enable additional functionality provided via proprietary SDKs, such as [Nvidia DLSS](https://developer.nvidia.com/rtx/dlss/get-started) and [AMD FidelityFX FSR3](https://gpuopen.com/fidelityfx-super-resolution-3/)

The Modding Libraries include:

Expand Down
35 changes: 0 additions & 35 deletions cmake/XeSS-SDK.cmake

This file was deleted.

15 changes: 0 additions & 15 deletions cmake/ports/intel-xess/portfile.cmake

This file was deleted.

8 changes: 0 additions & 8 deletions cmake/ports/intel-xess/vcpkg.json

This file was deleted.

8 changes: 8 additions & 0 deletions cmake/shadertoolsconfig.json.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"root": true,
"hlsl.preprocessorDefinitions": {
},
"hlsl.additionalIncludeDirectories": [
@HLSL_INCLUDE_JSON@
]
}
3 changes: 3 additions & 0 deletions features/Hair Specular/Shaders/Hair/Hair.hlsli
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,9 @@ namespace Hair
float3 GetHairDynamicCubemapSpecularIrradiance(float2 uv, float2 ScreenUV, float3 T, float3 N, float3 VN, float3 V, float glossiness, float3 specLobePrim, float3 specLobeSec)
# endif
{
if (SharedData::hairSpecularSettings.HairMode == 1) {
return 0;
}
float3 SpecularIrradiance = 0;
float3 N1 = N;
float3 N2 = N;
Expand Down
12 changes: 8 additions & 4 deletions package/Shaders/Lighting.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,8 @@ VS_OUTPUT main(VS_INPUT input)
vsout.LandBlendWeights2.w = 1 - saturate(0.000375600968 * (9625.59961 - length(gridOffset)));
vsout.LandBlendWeights2.xyz = input.LandBlendWeights2.xyz;
# elif defined(PROJECTED_UV) && !defined(SKINNED)
vsout.TexProj = TextureProj[eyeIndex][2].xyz;
float3x3 texProjWorld3x3 = float3x3(World[eyeIndex][0].xyz, World[eyeIndex][1].xyz, World[eyeIndex][2].xyz);
vsout.TexProj = mul(texProjWorld3x3, TextureProj[eyeIndex][2].xyz);
# endif

# if defined(EYE)
Expand Down Expand Up @@ -2098,9 +2099,11 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace : SV_IsFrontFace)
# endif
hairT = Hair::ReorientTangent(hairT, worldNormal);

if (SharedData::hairSpecularSettings.Enabled && SharedData::hairSpecularSettings.EnableTangentShift) {
float3 shiftedNormal = Hair::ShiftWorldNormal(hairT, worldNormal, 0, uv);
screenSpaceNormal = normalize(FrameBuffer::WorldToView(shiftedNormal, false, eyeIndex));
if (SharedData::hairSpecularSettings.Enabled) {
if (SharedData::hairSpecularSettings.EnableTangentShift && SharedData::hairSpecularSettings.HairMode != 1) {
float3 shiftedNormal = Hair::ShiftWorldNormal(hairT, worldNormal, 0, uv);
screenSpaceNormal = normalize(FrameBuffer::WorldToView(shiftedNormal, false, eyeIndex));
}
}

float3 transmissionColor = 0;
Expand Down Expand Up @@ -2721,6 +2724,7 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace : SV_IsFrontFace)
# if defined(HAIR) && defined(CS_HAIR)
if (SharedData::hairSpecularSettings.Enabled && SharedData::hairSpecularSettings.HairMode == 1)
ambientNormal = normalize(viewDirection - hairT * dot(viewDirection, hairT));
screenSpaceNormal = normalize(FrameBuffer::WorldToView(ambientNormal, false, eyeIndex));
# endif

float3 directionalAmbientColor = max(0, mul(DirectionalAmbient, float4(ambientNormal, 1.0)));
Expand Down
20 changes: 11 additions & 9 deletions src/Features/LightLimitFix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,22 @@ static constexpr uint MAX_LIGHTS = 1024;
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_WITH_DEFAULT(
LightLimitFix::Settings,
EnableContactShadows,
EnableLightsVisualisation,
LightsVisualisationMode)

void LightLimitFix::DrawSettings()
{
auto shaderCache = globals::shaderCache;

if (ImGui::TreeNodeEx("Light Limit Visualization", ImGuiTreeNodeFlags_DefaultOpen)) {
if (ImGui::TreeNodeEx("Statistics", ImGuiTreeNodeFlags_DefaultOpen)) {
ImGui::Text(std::format("Clustered Light Count : {}", lightCount).c_str());

ImGui::TreePop();
}

///////////////////////////////
ImGui::SeparatorText("Debug");

if (ImGui::TreeNode("Light Limit Visualization")) {
ImGui::Checkbox("Enable Lights Visualisation", &settings.EnableLightsVisualisation);
if (auto _tt = Util::HoverTooltipWrapper()) {
ImGui::Text("Enables visualization of the light limit\n");
Expand All @@ -43,12 +51,6 @@ void LightLimitFix::DrawSettings()

ImGui::TreePop();
}

if (ImGui::TreeNodeEx("Statistics", ImGuiTreeNodeFlags_DefaultOpen)) {
ImGui::Text(std::format("Clustered Light Count : {}", lightCount).c_str());

ImGui::TreePop();
}
}

LightLimitFix::PerFrame LightLimitFix::GetCommonBufferData()
Expand Down Expand Up @@ -563,4 +565,4 @@ void LightLimitFix::Hooks::BSWaterShader_SetupGeometry::thunk(RE::BSShader* This
auto& singleton = globals::features::lightLimitFix;
singleton.BSLightingShader_SetupGeometry_Before(Pass);
singleton.BSLightingShader_SetupGeometry_After(Pass);
};
};
2 changes: 1 addition & 1 deletion src/Features/Upscaling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1091,7 +1091,7 @@ bool Upscaling::IsUpscalingActive()
{
auto method = GetUpscaleMethod();

// Only consider vendor upscalers (FSR/XeSS/DLSS) as "active" when the
// Only consider vendor upscalers (FSR/DLSS) as "active" when the
// selected method actually produces a downscale. If the renderer is
// currently running at 1:1 (no downscale) then depth-buffer culling and
// other VR-sensitive behavior can remain enabled.
Expand Down
3 changes: 1 addition & 2 deletions src/Features/Upscaling.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <winrt/base.h>

/**
* @brief Provides upscaling functionality including DLSS, FSR, XeSS and TAA.
* @brief Provides upscaling functionality including DLSS, FSR and TAA.
*
* This feature handles various upscaling methods and frame generation technologies
* to improve performance while maintaining visual quality.
Expand All @@ -30,7 +30,6 @@ struct Upscaling : Feature
"Advanced upscaling and frame generation technologies for improved performance",
{ "DLSS (Deep Learning Super Sampling) support",
"FSR (FidelityFX Super Resolution) support",
"XeSS (Intel Xe Super Sampling) support",
"TAA (Temporal Anti-Aliasing) support",
"Frame generation for supported systems" }
};
Expand Down
8 changes: 4 additions & 4 deletions src/Features/VR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ void VR::PostPostLoad()
void VR::DataLoaded()
{
// Initialize occlusion culling based on settings, but force-disable if an external
// upscaler is active (FSR/XeSS/DLSS) since upscalers may modify the depth buffer.
// upscaler is active (FSR/DLSS) since upscalers may modify the depth buffer.
bool desired = settings.EnableDepthBufferCullingExterior;
UpdateDepthBufferCulling(desired);

Expand Down Expand Up @@ -590,7 +590,7 @@ namespace
// If an upscaler is active that rewrites or repurposes the depth buffer,
// depth-buffer-culling must be disabled to avoid incorrect occlusion tests
// (which are especially problematic in VR). Query the Upscaling feature
// to see whether we're running FSR, XeSS or DLSS.
// to see whether we're running FSR or DLSS.
// Determine if an external upscaler is active by reading the numeric
// setting value directly. Avoid referencing Upscaling types here to
// prevent header/type collisions in this translation unit.
Expand All @@ -603,7 +603,7 @@ namespace
ImGui::Checkbox("Enable Depth Buffer Culling in Exteriors", &settings.EnableDepthBufferCullingExterior);
if (upscalingActive) {
if (auto _tt = Util::HoverTooltipWrapper()) {
ImGui::Text("Disabled while an external upscaler is active (FSR/XeSS/DLSS) because upscalers may modify depth.\nThis prevents incorrect occlusion in VR.");
ImGui::Text("Disabled while an external upscaler is active (FSR/DLSS) because upscalers may modify depth.\nThis prevents incorrect occlusion in VR.");
}
ImGui::EndDisabled();
} else {
Expand All @@ -618,7 +618,7 @@ namespace
ImGui::Checkbox("Enable Depth Buffer Culling in Interiors", &settings.EnableDepthBufferCullingInterior);
if (upscalingActive) {
if (auto _tt = Util::HoverTooltipWrapper()) {
ImGui::Text("Disabled while an external upscaler is active (FSR/XeSS/DLSS) because upscalers may modify depth.\nThis prevents incorrect occlusion in VR.");
ImGui::Text("Disabled while an external upscaler is active (FSR/DLSS) because upscalers may modify depth.\nThis prevents incorrect occlusion in VR.");
}
ImGui::EndDisabled();
} else {
Expand Down
Loading
Loading