Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
201 commits
Select commit Hold shift + click to select a range
8e8ac2a
feat: upscaling based drs
doodlum Aug 3, 2025
4222109
fix: dont use ultra performance
doodlum Aug 3, 2025
c0f4448
chore: reduce taa jitter
doodlum Aug 3, 2025
7e5a237
fix: only add tearing for fsrfg
doodlum Aug 3, 2025
d46b22b
feat: synced DLSS mode with FSR
doodlum Aug 3, 2025
5c0e25f
revert: does not fix
doodlum Aug 3, 2025
58531c3
fix: fix jitters amount
doodlum Aug 3, 2025
5279f43
fix: fix screenshot screen size
doodlum Aug 3, 2025
0dfd244
chore: cleanup
doodlum Aug 3, 2025
3e9f2ce
chore: pixel perfect upscaling
doodlum Aug 3, 2025
4932dc4
fix: fix menus with upscaling
doodlum Aug 3, 2025
fd59a80
chore: move upscale preset above sharpness
doodlum Aug 3, 2025
021520b
chore: update ui
doodlum Aug 3, 2025
bee4855
feat: hdr space upscaling
doodlum Aug 3, 2025
b63464c
chore: cleanup
doodlum Aug 3, 2025
c85d039
fix: fix allow upscaling setting
doodlum Aug 3, 2025
d627ed8
fix: missing semicolon
doodlum Aug 3, 2025
affd104
feat: depth upscaling
doodlum Aug 3, 2025
1ff5deb
feat: shadow fix
doodlum Aug 3, 2025
277208e
chore: cleanup
doodlum Aug 3, 2025
1f78f2f
chore: settings cleanup and working taa
doodlum Aug 4, 2025
5f9cb47
chore: remove skyrim upscaler detection
doodlum Aug 4, 2025
80b9c58
fix: fix precipitation and skylighting
doodlum Aug 4, 2025
aa03bb5
chore: plugin init things
doodlum Aug 4, 2025
ac2e85b
chore: most ae work
doodlum Aug 4, 2025
3b10e7c
feat: ae support
doodlum Aug 4, 2025
0e23d6e
chore: remove upscaler checks
doodlum Aug 4, 2025
60962e5
fix: add VR addresses
alandtse Aug 4, 2025
c97e34a
fix: fix some shaders to use upscaling
doodlum Aug 4, 2025
b757fe5
fix: fix facegen with upscaling
doodlum Aug 4, 2025
28f36c0
chore: use actual name
doodlum Aug 4, 2025
1c3f78c
chore: do depth upscale alongside other upscaling
doodlum Aug 4, 2025
1c5e2d9
chore: disable fg
doodlum Aug 4, 2025
7011c98
chore: slightly sharper screenspace shadows
doodlum Aug 4, 2025
2df32ea
chore: remove update viewport, not needed
doodlum Aug 4, 2025
7034fbb
chore: update streamline, remove dlssg
doodlum Aug 5, 2025
6dfdc1c
chore: update dlss dll
doodlum Aug 5, 2025
430f049
chore: cleanup plugins
doodlum Aug 5, 2025
5cffc1e
chore: update ui info
doodlum Aug 5, 2025
93434b8
chore: more streamline updates
doodlum Aug 5, 2025
74e177d
chore: lock off flatrim specific hooks
doodlum Aug 5, 2025
4c7610b
chore: start on vr upscale
doodlum Aug 5, 2025
4a1e49d
chore: reduce skylighting blur with drs
doodlum Aug 5, 2025
726692a
feat: transparency mask
doodlum Aug 5, 2025
999e43d
chore: cleanup
doodlum Aug 5, 2025
84c7e94
chore: xess dx11
doodlum Aug 5, 2025
2f7e000
feat: xess working but vibecode
doodlum Aug 6, 2025
57a8925
chore: use winrt
doodlum Aug 6, 2025
487c824
chore: add wrapped resource destructor
doodlum Aug 6, 2025
74f3acd
chore: use throwiffailed
doodlum Aug 6, 2025
8bb5f3a
chore: clean up nonsense
doodlum Aug 6, 2025
2613a1e
chore: set resource states
doodlum Aug 6, 2025
1f87e82
feat: working xess
doodlum Aug 6, 2025
97d013c
chore: cleanup
doodlum Aug 6, 2025
555d39f
chore: optimise copies
doodlum Aug 6, 2025
3063848
chore: minimise copies
doodlum Aug 6, 2025
d454631
chore: move interop into upscaling, cleanup xess
doodlum Aug 6, 2025
6c0c2cb
chore: try to optimise xess
doodlum Aug 6, 2025
ae9e3b7
fix: xess performance
doodlum Aug 6, 2025
fb1ca5c
chore: cleanup xess
doodlum Aug 6, 2025
652c052
chore: cleanup settings changes
doodlum Aug 6, 2025
2b8743a
chore: add back sharpening
doodlum Aug 6, 2025
625ae2b
feat: fsr via api
doodlum Aug 6, 2025
2a3421a
chore: cleanup
doodlum Aug 6, 2025
f4e906f
chore: cleanup
doodlum Aug 6, 2025
86ef855
fix: crash nonsense
doodlum Aug 6, 2025
b93d70d
chore: match sharpness between upscalers
doodlum Aug 7, 2025
623d53c
chore: use xess resolution scale
doodlum Aug 7, 2025
2df9b51
chore: use dlss resolution scale
doodlum Aug 7, 2025
b115617
chore: remove fsr upscaling
doodlum Aug 7, 2025
8ff3d37
chore: remove xess vk
doodlum Aug 7, 2025
d7d750c
chore: cleanup
doodlum Aug 7, 2025
931319c
chore: cleanup
doodlum Aug 7, 2025
1779d1e
chore: optimise encode textures
doodlum Aug 7, 2025
4bf8627
chore: xess tweaks
doodlum Aug 7, 2025
90dcdfd
chore: clean up sss related issues
doodlum Aug 7, 2025
df05084
chore: cleanup vr depth
doodlum Aug 7, 2025
02a5ecd
fix: use minimum to pass on edges
doodlum Aug 7, 2025
533ee6e
chore: disable ui taa
doodlum Aug 7, 2025
fa664b2
fix: fix upscaling on vr
doodlum Aug 8, 2025
360d036
chore(xess): add debug logging
alandtse Aug 8, 2025
a773769
fix(VR): add FrameBufferCache
alandtse Aug 8, 2025
687d2f2
feat: add taa drs
doodlum Aug 8, 2025
3ef9572
style: 🎨 apply pre-commit.ci formatting
pre-commit-ci[bot] Aug 8, 2025
2059636
chore: optimise vr copies
doodlum Aug 8, 2025
cd026d3
Merge branch 'upscaling-drs-xess' into vr_xess_upscaler
doodlum Aug 8, 2025
7299f15
fix(VR): add FrameBufferCache (#1374)
doodlum Aug 8, 2025
42e9b5c
chore: do not sharpen vr
doodlum Aug 8, 2025
0a6f4cd
chore: depth optimisations
doodlum Aug 8, 2025
fa22772
fix: taa not being disabled
doodlum Aug 8, 2025
813e7f3
chore: mostly finalise upscaling
doodlum Aug 8, 2025
61f1807
chore: max out sharpness for xess
doodlum Aug 8, 2025
8edf2a9
fix: fix reactive mask
doodlum Aug 8, 2025
7ae118d
fix: less aggressive encode
doodlum Aug 8, 2025
a0ec63a
chore: less aggressive sharpening, too scene dependant
doodlum Aug 8, 2025
58e2f05
fix: fix movie videos
doodlum Aug 8, 2025
638dbdf
fix: flickering on water
doodlum Aug 8, 2025
86c58a3
fix: sort of fix shadows
doodlum Aug 9, 2025
b402521
chore: scale both axis
doodlum Aug 9, 2025
2bb5a63
chore: increase sample count
doodlum Aug 9, 2025
836b50a
fix: fix shadow artifacts
doodlum Aug 9, 2025
19f09c6
chore: restore shadow blur to fix issues
doodlum Aug 9, 2025
6e08057
fix: fix ConvertToDynamic on menus
doodlum Aug 9, 2025
b7ba1cb
chore: remove rcas due to flicker complaints
doodlum Aug 9, 2025
5d19ca6
refactor: simplify redundant code
alandtse Aug 9, 2025
23f8cf0
style: 🎨 apply pre-commit.ci formatting
pre-commit-ci[bot] Aug 9, 2025
fe713e7
chore: address ai comments
alandtse Aug 9, 2025
78e0d03
Merge branch 'upscaling_sss_refactor' of https://github.com/alandtse/…
alandtse Aug 9, 2025
2ba4f44
refactor(sss): simplify redundant code (#1379)
doodlum Aug 9, 2025
6651ddd
build: use portfile for xess (#1378)
alandtse Aug 9, 2025
6f97033
chore: add back fsr
doodlum Aug 9, 2025
2409ce5
fix: fix xess/fsr crash
doodlum Aug 9, 2025
ee678f7
chore: clean up fsr
doodlum Aug 9, 2025
e83d949
fix(VR): reenable upscaling
alandtse Aug 9, 2025
b546861
feat: cursed denoising of shadows
doodlum Aug 10, 2025
e5c9e77
chore: add fidelityfx resolution ratio
doodlum Aug 10, 2025
2baee12
chore: completely remove dx11 fsr
doodlum Aug 10, 2025
9268933
Update src/Upscaling.cpp
doodlum Aug 10, 2025
c6d379a
Update src/Upscaling.cpp
doodlum Aug 10, 2025
d99c47e
Update src/Upscaling.cpp
doodlum Aug 10, 2025
15eee31
fix(VR): SSS
alandtse Aug 10, 2025
ff78074
chore: kill claude
doodlum Aug 10, 2025
ac7a91d
fix: fix load screens
doodlum Aug 10, 2025
a116600
chore: revert skylighting
doodlum Aug 10, 2025
09926a5
chore: add drs support for llf
doodlum Aug 10, 2025
06aaf82
feat: upscaling working again
doodlum Aug 10, 2025
7d40095
fix: fix fg on loading screens
doodlum Aug 10, 2025
23913d2
feat: separate ui from framegen
doodlum Aug 10, 2025
4c5c9f5
chore: mitigate tree flicker
doodlum Aug 10, 2025
c784af2
chore: jitter taa for consistency
doodlum Aug 10, 2025
c439bbc
fix: fix llf padding
doodlum Aug 10, 2025
ab445f4
fix: fix padding
doodlum Aug 10, 2025
6250d0b
fix: utility compile error
doodlum Aug 11, 2025
629fdac
chore: upscaling vr updates (#1389)
doodlum Aug 11, 2025
197a7c2
Merge branch 'upscaling-drs-xess' of https://github.com/doodlum/skyri…
doodlum Aug 11, 2025
1042162
feat: offset fg menu latency
doodlum Aug 11, 2025
c5eef85
chore: clean up hooks
doodlum Aug 11, 2025
f599a0f
chore: only on flatrim
doodlum Aug 11, 2025
09aaac7
chore: fg fixes
doodlum Aug 11, 2025
c7f0a8a
chore: remove taa as upscale compatible
doodlum Aug 11, 2025
e575415
feat: add ultra performance option
doodlum Aug 11, 2025
9ef4d31
chore: remove uneeded swapchain replacement
doodlum Aug 11, 2025
f356dd4
fix: dlss memory leak
doodlum Aug 11, 2025
d45eefd
fix: revert dlss file
doodlum Aug 11, 2025
69f79f5
fix: actually fix memory leak
doodlum Aug 11, 2025
656e210
chore: clean up fg code
doodlum Aug 11, 2025
da4967d
chore: better latency handling
doodlum Aug 11, 2025
5ba653d
chore: optimise menus resolution
doodlum Aug 11, 2025
448fed7
chore: add back optimised swapchain type
doodlum Aug 11, 2025
0ee8d09
chore: mostly move upscaling to its own feature
doodlum Aug 11, 2025
4cfbd9c
chore: more work porting to feature
doodlum Aug 11, 2025
1efbf69
chore: ai based cleanup
doodlum Aug 11, 2025
19253a8
fix: fix most upscaling issues with features system
doodlum Aug 11, 2025
bda9446
chore: move upscaling features inside
doodlum Aug 11, 2025
c42cd61
chore: minor cleanup
doodlum Aug 11, 2025
a6e2950
chore: abbreviate taa
doodlum Aug 11, 2025
d98382a
chore: kill claude again
doodlum Aug 11, 2025
1413a49
chore: remove swap effect, fg handles this
doodlum Aug 11, 2025
a6fc42c
fix: fix dynamic sample count
doodlum Aug 12, 2025
a70893b
chore: move dx12 swapchain
doodlum Aug 12, 2025
a3d509c
chore: less upscaling complaints
doodlum Aug 12, 2025
98937b8
fix: fix reshade issues
doodlum Aug 12, 2025
f8842f7
chore: change upscaling category
doodlum Aug 12, 2025
8574829
chore: less spaghetti upscaling code
doodlum Aug 12, 2025
a32b571
chore: remove display menu
doodlum Aug 12, 2025
c8ee838
chore: address some rabbit comments
doodlum Aug 12, 2025
ed9a92f
chore: load fidelityfx from root dir first
doodlum Aug 13, 2025
8196ae1
fix: fix shader issues
doodlum Aug 14, 2025
bf05bde
fix: maybe fix vr sss
doodlum Aug 14, 2025
6170471
chore: add vr eye bounds
doodlum Aug 14, 2025
d8444fb
fix: correct write behaviour
doodlum Aug 14, 2025
3a2dbc7
chore: make compiler happy
doodlum Aug 14, 2025
eaa8b34
fix: sss
doodlum Aug 14, 2025
65c25a9
fix(VR): hanging on startup
alandtse Aug 14, 2025
7ca3f85
refactor: add Load Hook
alandtse Aug 14, 2025
ab0bf53
style: 🎨 apply pre-commit.ci formatting
pre-commit-ci[bot] Aug 14, 2025
4905ae3
chore: try to make compiler tests happy
doodlum Aug 14, 2025
4e6c8e2
chore: maybe quicker compile
doodlum Aug 14, 2025
1fd9552
fix(VR): hanging on startup (#1394)
doodlum Aug 14, 2025
29a2fa3
Merge branch 'upscaling-drs-xess' of https://github.com/doodlum/skyri…
doodlum Aug 14, 2025
181a843
fix: vr motion vector fixes
doodlum Aug 14, 2025
6237f6f
fix: and clean up graphics hooks
doodlum Aug 14, 2025
a0e2c45
fix: fix vr mipbias
doodlum Aug 14, 2025
494ffe8
fix: fix sss not compiling
doodlum Aug 14, 2025
e3e9efe
fix: fixed vr sss
doodlum Aug 14, 2025
98c5e6f
chore: dont reduce screensize or too small range on vr
doodlum Aug 14, 2025
d72f1c5
fix: vr drs on sss
doodlum Aug 16, 2025
92263c9
fix: fix vr composite for drs
doodlum Aug 16, 2025
143a772
fix: fix vr culling
doodlum Aug 16, 2025
b1b10d0
chore: disable vr jitter
doodlum Aug 16, 2025
294b917
fix: fix flat drs idk why
doodlum Aug 16, 2025
ba1dd37
chore: upscale buffers instead of shader changes
doodlum Aug 16, 2025
85c210b
chore: move plugins location
doodlum Aug 16, 2025
4b24a4a
chore: optimisations
doodlum Aug 16, 2025
62377a9
fix: fix bad style pop
doodlum Aug 16, 2025
56593e8
fix: add nullptr to frametoken
doodlum Aug 16, 2025
d757bc5
fix: logic fixes
doodlum Aug 16, 2025
eb5960a
chore: use comptrs for safety
doodlum Aug 16, 2025
52526f0
fix(VR): hooks for refraction and underwater
alandtse Aug 16, 2025
a6189e0
style: 🎨 apply pre-commit.ci formatting
pre-commit-ci[bot] Aug 16, 2025
8077891
fix(VR): hooks for refraction and underwater (#1399)
doodlum Aug 16, 2025
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ shadertoolsconfig.json

# Folder view configuration files
**/.DS_Store
.claude/settings.local.json
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
[submodule "extern/CommonLibSSE-NG"]
path = extern/CommonLibSSE-NG
url = https://github.com/alandtse/CommonLibVR.git
[submodule "extern/FidelityFX-SDK"]
path = extern/FidelityFX-SDK
url = https://github.com/MapleHinata/FidelityFX-SDK.git
[submodule "extern/Streamline-DX12"]
path = extern/Streamline-DX12
url = https://github.com/NVIDIAGameWorks/Streamline.git
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ find_package(cppwinrt CONFIG REQUIRED)
find_package(unordered_dense CONFIG REQUIRED)
find_package(efsw CONFIG REQUIRED)
find_package(Tracy CONFIG REQUIRED)
find_package(directx-headers CONFIG REQUIRED)
add_subdirectory(${CMAKE_SOURCE_DIR}/cmake/Streamline)
include(FidelityFX-SDK)
include(XeSS-SDK)

target_compile_definitions(
${PROJECT_NAME}
Expand Down Expand Up @@ -92,6 +93,7 @@ target_link_libraries(
Tracy::TracyClient
Streamline
d3d12.lib
Microsoft::DirectX-Headers
)

# https://gitlab.kitware.com/cmake/cmake/-/issues/24922#note_1371990
Expand Down
15 changes: 0 additions & 15 deletions cmake/FidelityFX-SDK.cmake

This file was deleted.

35 changes: 35 additions & 0 deletions cmake/XeSS-SDK.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# XeSS SDK Configuration
# This file configures the Intel XeSS SDK integration for the project

# XeSS is dynamically loaded at runtime, so we don't need to link against static libraries
# The XeSS DLL (libxess.dll) should be placed in the Data/SKSE/Plugins/XeSS directory

# Find XeSS headers installed by vcpkg port
find_path(INTEL_XESS_INCLUDE_DIRS "xess/xess.h")

if(INTEL_XESS_INCLUDE_DIRS)
message(STATUS "XeSS SDK headers found via vcpkg at ${INTEL_XESS_INCLUDE_DIRS}")
target_include_directories(
${PROJECT_NAME}
PRIVATE
${INTEL_XESS_INCLUDE_DIRS}
)
else()
message(WARNING "XeSS SDK headers not found - XeSS compilation may fail")
message(STATUS "Make sure intel-xess is installed via vcpkg")
endif()

# Link required D3D12 libraries for interop
target_link_libraries(
${PROJECT_NAME}
PRIVATE
d3d12.lib
dxgi.lib
)

# Add preprocessor definition to enable XeSS support
target_compile_definitions(
${PROJECT_NAME}
PRIVATE
XESS_SUPPORT=1
)
Comment on lines +7 to +35
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Define XESS_SUPPORT only when headers are found; otherwise build may break

XESS_SUPPORT is currently defined unconditionally, which can cause compilation failures when xess headers are missing. Define it only when headers are found; optionally define XESS_SUPPORT=0 in the else branch.

Apply this diff:

 find_path(INTEL_XESS_INCLUDE_DIRS "xess/xess.h")

 if(INTEL_XESS_INCLUDE_DIRS)
     message(STATUS "XeSS SDK headers found via vcpkg at ${INTEL_XESS_INCLUDE_DIRS}")
     target_include_directories(
         ${PROJECT_NAME}
         PRIVATE
         ${INTEL_XESS_INCLUDE_DIRS}
     )
+    # Add preprocessor definition to enable XeSS support when headers are available
+    target_compile_definitions(
+        ${PROJECT_NAME}
+        PRIVATE
+        XESS_SUPPORT=1
+    )
 else()
     message(WARNING "XeSS SDK headers not found - XeSS compilation may fail")
     message(STATUS "Make sure intel-xess is installed via vcpkg")
+    # Optionally set to 0 so code can guard on #if XESS_SUPPORT
+    target_compile_definitions(
+        ${PROJECT_NAME}
+        PRIVATE
+        XESS_SUPPORT=0
+    )
 endif()

 # Link required D3D12 libraries for interop
 target_link_libraries(
     ${PROJECT_NAME}
     PRIVATE
     d3d12.lib
     dxgi.lib
 )
-
-# Add preprocessor definition to enable XeSS support
-target_compile_definitions(
-    ${PROJECT_NAME}
-    PRIVATE
-    XESS_SUPPORT=1
-)

Optional: Add PATH_SUFFIXES to find_path to improve robustness with some toolchains:

find_path(INTEL_XESS_INCLUDE_DIRS "xess/xess.h" PATH_SUFFIXES include)
🤖 Prompt for AI Agents
In cmake/XeSS-SDK.cmake around lines 7 to 35, XESS_SUPPORT is unconditionally
defined which can break builds when xess headers are missing; change the logic
so target_compile_definitions(XESS_SUPPORT=1) is added only inside the
if(INTEL_XESS_INCLUDE_DIRS) branch, and in the else branch either omit the
definition or explicitly add a definition setting XESS_SUPPORT=0; also improve
header discovery by adding PATH_SUFFIXES include to the find_path call (e.g.
find_path(... "xess/xess.h" PATH_SUFFIXES include).

15 changes: 15 additions & 0 deletions cmake/ports/intel-xess/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Intel XeSS SDK - headers only
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO intel/xess
REF v2.1.0
SHA512 6129abf9a271c366e8d04f2676ec8f39858cd8e1530b0178911a0c5e1c616db56bc6c577aa3cec2d63f23310cedb658f5e7b463469bb467482bb40af59ed155a
HEAD_REF main
)

# Install only the necessary header files (not the entire repo)
set(XESS_HEADERS_SOURCE ${SOURCE_PATH}/inc/xess)
file(INSTALL ${XESS_HEADERS_SOURCE} DESTINATION ${CURRENT_PACKAGES_DIR}/include)

# Install copyright
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt")
8 changes: 8 additions & 0 deletions cmake/ports/intel-xess/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "intel-xess",
"version": "2.1.0",
"port-version": 1,
"description": "Intel Xe Super Sampling (XeSS) SDK - AI-based upscaling technology (headers only)",
"homepage": "https://github.com/intel/xess",
"supports": "windows"
}
1 change: 0 additions & 1 deletion extern/FidelityFX-SDK
Submodule FidelityFX-SDK deleted from 8138c9
2 changes: 1 addition & 1 deletion extern/Streamline-DX12

This file was deleted.

Binary file not shown.
Binary file not shown.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[Info]
Version = 2-2-0
Version = 2-2-1
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

cbuffer PerFrame : register(b0)
{
row_major float4x4 InvProjMatrix[2];
float LightsNear;
float LightsFar;
row_major float4x4 InvProjMatrix[2];
float LightsNear;
float LightsFar;
uint2 pad0;
uint4 ClusterSize;
}

float3 GetPositionVS(float2 texcoord, float depth, int eyeIndex = 0)
Expand Down Expand Up @@ -46,10 +48,10 @@ float3 IntersectionZPlane(float3 B, float z_dist)
uint groupIndex
: SV_GroupIndex) {
uint clusterIndex = groupId.x +
groupId.y * CLUSTER_BUILDING_DISPATCH_SIZE_X +
groupId.z * (CLUSTER_BUILDING_DISPATCH_SIZE_X * CLUSTER_BUILDING_DISPATCH_SIZE_Y);
groupId.y * ClusterSize.x +
groupId.z * (ClusterSize.x * ClusterSize.y);

float2 clusterSize = rcp(float2(CLUSTER_BUILDING_DISPATCH_SIZE_X, CLUSTER_BUILDING_DISPATCH_SIZE_Y));
float2 clusterSize = rcp(float2(ClusterSize.x, ClusterSize.y));

float2 texcoordMax = (groupId.xy + 1) * clusterSize;
float2 texcoordMin = groupId.xy * clusterSize;
Expand All @@ -61,8 +63,8 @@ float3 IntersectionZPlane(float3 B, float z_dist)
float3 minPointVS = min(GetPositionVS(texcoordMin, 1.0f, 0), GetPositionVS(texcoordMin, 1.0f, 1));
#endif // !VR

float clusterNear = LightsNear * pow(LightsFar / LightsNear, groupId.z / float(CLUSTER_BUILDING_DISPATCH_SIZE_Z));
float clusterFar = LightsNear * pow(LightsFar / LightsNear, (groupId.z + 1) / float(CLUSTER_BUILDING_DISPATCH_SIZE_Z));
float clusterNear = LightsNear * pow(LightsFar / LightsNear, groupId.z / float(ClusterSize.z));
float clusterFar = LightsNear * pow(LightsFar / LightsNear, (groupId.z + 1) / float(ClusterSize.z));

float3 minPointNear = IntersectionZPlane(minPointVS, clusterNear);
float3 minPointFar = IntersectionZPlane(minPointVS, clusterFar);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

cbuffer PerFrame : register(b0)
{
uint LightCount;
uint LightCount;
uint3 pad;
uint4 ClusterSize;
}

//references
Expand Down Expand Up @@ -31,15 +33,15 @@ bool LightIntersectsCluster(float3 position, float radius, ClusterAABB cluster)
: SV_DispatchThreadID, uint3 groupThreadId
: SV_GroupThreadID, uint groupIndex
: SV_GroupIndex) {
if (any(dispatchThreadId >= uint3(CLUSTER_BUILDING_DISPATCH_SIZE_X, CLUSTER_BUILDING_DISPATCH_SIZE_Y, CLUSTER_BUILDING_DISPATCH_SIZE_Z)))
if (any(dispatchThreadId >= uint3(ClusterSize.x, ClusterSize.y, ClusterSize.z)))
return;

uint visibleLightCount = 0;
uint visibleLightIndices[MAX_CLUSTER_LIGHTS];

uint clusterIndex = dispatchThreadId.x +
dispatchThreadId.y * CLUSTER_BUILDING_DISPATCH_SIZE_X +
dispatchThreadId.z * (CLUSTER_BUILDING_DISPATCH_SIZE_X * CLUSTER_BUILDING_DISPATCH_SIZE_Y);
dispatchThreadId.y * ClusterSize.x +
dispatchThreadId.z * (ClusterSize.x * ClusterSize.y);

ClusterAABB cluster = clusters[clusterIndex];

Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[Info]
Version = 1-2-1
Version = 1-2-2
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ cbuffer PerFrame : register(b1)

float2 DynamicRes;

uint DynamicSampleCount;
uint DynamicReadCount;
float2 pad0;

float SurfaceThickness;
float BilinearThreshold;
float ShadowContrast;
Expand Down Expand Up @@ -52,5 +56,8 @@ cbuffer PerFrame : register(b1)

parameters.DynamicRes = DynamicRes;

parameters.DynamicSampleCount = DynamicSampleCount;
parameters.DynamicReadCount = DynamicReadCount;

WriteScreenSpaceShadow(parameters, groupID, groupThreadID);
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace ScreenSpaceShadows
float4 shadowSamples = 0;
float4 depthSamples = 0;

# if defined(DEFERRED) && !defined(DO_ALPHA_TEST)
# if defined(DEFERRED)
depthSamples[0] = screenPosition.z;
# else
depthSamples[0] = SharedData::DepthTexture.Load(int3(int2(screenPosition.xy + 0.5f), 0)).x;
Expand Down Expand Up @@ -64,4 +64,4 @@ namespace ScreenSpaceShadows
return shadow;
#endif
}
}
}
Loading