diff --git a/extern/CommonLibSSE-NG b/extern/CommonLibSSE-NG index 8e4237136..e83b23bdd 160000 --- a/extern/CommonLibSSE-NG +++ b/extern/CommonLibSSE-NG @@ -1 +1 @@ -Subproject commit 8e42371362b17770a6ad389f48f4a6fdca998e55 +Subproject commit e83b23bddb893d44b8f3cf3e6379b9087ad25cc9 diff --git a/features/Screen-Space Shadows/Shaders/ScreenSpaceShadows/NormalMappingShadowsCS.hlsl b/features/Screen-Space Shadows/Shaders/ScreenSpaceShadows/NormalMappingShadowsCS.hlsl index f4c92874f..e88e4239c 100644 --- a/features/Screen-Space Shadows/Shaders/ScreenSpaceShadows/NormalMappingShadowsCS.hlsl +++ b/features/Screen-Space Shadows/Shaders/ScreenSpaceShadows/NormalMappingShadowsCS.hlsl @@ -63,14 +63,14 @@ half2 ViewToUV(half3 position, bool is_position, uint a_eyeIndex) uint eyeIndex = GetEyeIndexFromTexCoord(uv); - half3 viewPosition = DepthToView(uv, rawDepth, eyeIndex); + half3 viewPosition = DepthToView(ConvertFromStereoUV(uv, eyeIndex), rawDepth, eyeIndex); // viewPosition is in VR nonstereospace viewPosition.z = depth; half3 endPosVS = viewPosition + DirLightDirectionVS[eyeIndex].xyz * 5; half2 endPosUV = ViewToUV(endPosVS, false, eyeIndex); - half2 startPosPixel = clamp(uv * BufferDim, 0, BufferDim); - half2 endPosPixel = clamp(endPosUV * BufferDim, 0, BufferDim); + half2 startPosPixel = clamp(uv * BufferDim, 0, BufferDim); // uv is in VR stereo space + half2 endPosPixel = clamp(ConvertToStereoUV(endPosUV, eyeIndex) * BufferDim, 0, BufferDim); // convert back to stereospace since derived from viewPosition half NdotL = dot(normalVS, DirLightDirectionVS[eyeIndex].xyz); @@ -89,7 +89,7 @@ half2 ViewToUV(half3 position, bool is_position, uint a_eyeIndex) half slope = -NdotL; for (int i = 0; i < 5; i++) { - uint2 tmpCoords = lerp(startPosPixel, endPosPixel, pos); + uint2 tmpCoords = lerp(startPosPixel, endPosPixel, pos); // coords are in stereo space to access Textures half3 tmpNormal = DecodeNormal(NormalRoughnessTexture[tmpCoords].xy); half tmpDepth = GetScreenDepth(DepthTexture[tmpCoords]); half tmpNdotL = dot(tmpNormal, DirLightDirectionVS[eyeIndex].xyz); diff --git a/package/Shaders/Common/VR.hlsli b/package/Shaders/Common/VR.hlsli index 4a92aa412..cd784504d 100644 --- a/package/Shaders/Common/VR.hlsli +++ b/package/Shaders/Common/VR.hlsli @@ -124,7 +124,7 @@ uint GetEyeIndexVS(uint instanceID = 0) /** Gets VR Output -@param texCoord Texcoord on the screen [0,1] +@param clipPos clipPosition. Typically the VSHADER position at SV_POSITION0 @param a_eyeIndex The eyeIndex; 0 is left, 1 is right @returns VR_OUTPUT with VR values */