diff --git a/package/Shaders/Common/ShadowSampling.hlsli b/package/Shaders/Common/ShadowSampling.hlsli index ad3fa3804..e2f12572c 100644 --- a/package/Shaders/Common/ShadowSampling.hlsli +++ b/package/Shaders/Common/ShadowSampling.hlsli @@ -57,8 +57,8 @@ float Get3DFilteredShadow(float3 positionWS, float3 viewDirection, float2 screen float r = rnd.z; float4 sincos_phi; sincos(phi, sincos_phi.y, sincos_phi.x); - float3 sampleOffset = viewDirection * i * 128 * rcpSampleCount; - sampleOffset += (float3(r * sin_theta * sincos_phi.x, r * sin_theta * sincos_phi.y, r * cos_theta) * 0.5 + 0.5) * 128; + float3 sampleOffset = viewDirection * i * 64 * rcpSampleCount; + sampleOffset += (float3(r * sin_theta * sincos_phi.x, r * sin_theta * sincos_phi.y, r * cos_theta) * 0.5 + 0.5) * 64; uint cascadeIndex = sD.EndSplitDistances.x < GetShadowDepth(positionWS.xyz + viewDirection * (sampleOffset.x + sampleOffset.y), eyeIndex); // Stochastic cascade sampling diff --git a/package/Shaders/Effect.hlsl b/package/Shaders/Effect.hlsl index 5c34ecfc5..105167f36 100644 --- a/package/Shaders/Effect.hlsl +++ b/package/Shaders/Effect.hlsl @@ -793,9 +793,7 @@ PS_OUTPUT main(PS_INPUT input) psout.ScreenSpaceNormals.xy = screenSpaceNormal.xy + 0.5.xx; psout.ScreenSpaceNormals.zw = 0.0.xx; # else - psout.Normal.xyz = float3(!(ExtendedFlags & Effect_Shadows), 0, 0); - psout.Normal.w = finalColor.w; - + psout.Normal = float4(!(ExtendedFlags & Effect_Shadows), 0, 0, finalColor.w); psout.Color2 = finalColor; # endif diff --git a/src/Hooks.cpp b/src/Hooks.cpp index f38a22dfd..f60e1fae8 100644 --- a/src/Hooks.cpp +++ b/src/Hooks.cpp @@ -492,6 +492,7 @@ namespace Hooks if (state->enabledClasses[type - 1]) { RE::BSGraphics::VertexShader* vertexShader = shaderCache.GetVertexShader(*currentShader, state->modifiedVertexDescriptor); if (vertexShader) { + a_vertexShader = vertexShader; state->context->VSSetShader(reinterpret_cast(vertexShader->shader), NULL, NULL); auto shadowState = RE::BSGraphics::RendererShadowState::GetSingleton(); GET_INSTANCE_MEMBER(currentVertexShader, shadowState) @@ -523,6 +524,7 @@ namespace Hooks if (state->enabledClasses[type - 1]) { RE::BSGraphics::PixelShader* pixelShader = shaderCache.GetPixelShader(*currentShader, state->modifiedPixelDescriptor); if (pixelShader) { + a_pixelShader = pixelShader; state->context->PSSetShader(reinterpret_cast(pixelShader->shader), NULL, NULL); auto shadowState = RE::BSGraphics::RendererShadowState::GetSingleton(); GET_INSTANCE_MEMBER(currentPixelShader, shadowState)