Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: put effect shader lighting changes behind defines #635

Merged
merged 2 commits into from
Oct 12, 2024
Merged
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
13 changes: 11 additions & 2 deletions package/Shaders/Effect.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -522,9 +522,10 @@ float3 GetLightingColor(float3 msPosition, float3 worldPosition, float4 screenPo
float4 lightFadeMul = 1.0.xxxx - saturate(PLightingRadiusInverseSquared * lightDistanceSquared);

float3 color = DLightColor.xyz;
# if defined(EFFECT_WEATHER)
# if defined(EFFECT_SHADOWS)
if (!InInterior && !InMapMenu && (ExtraShaderDescriptor & _InWorld)) {
float3 viewDirection = normalize(worldPosition);
color = DirLightColorShared * GetEffectShadow(worldPosition, viewDirection, screenPosition, eyeIndex) * 0.5;
color = DirLightColorShared * GetEffectShadow(worldPosition, normalize(worldPosition), screenPosition, eyeIndex) * 0.5;

float3 directionalAmbientColor = DirectionalAmbientShared._14_24_34;
color += directionalAmbientColor;
Expand All @@ -534,6 +535,14 @@ float3 GetLightingColor(float3 msPosition, float3 worldPosition, float4 screenPo
float3 directionalAmbientColor = DirectionalAmbientShared._14_24_34;
color += directionalAmbientColor;
}
# else
color = DirLightColorShared * 0.5;

float3 directionalAmbientColor = DirectionalAmbientShared._14_24_34;
color += directionalAmbientColor;
# endif
# endif

color.x += dot(PLightColorR * lightFadeMul, 1.0.xxxx);
color.y += dot(PLightColorG * lightFadeMul, 1.0.xxxx);
color.z += dot(PLightColorB * lightFadeMul, 1.0.xxxx);
Expand Down
Loading