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
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ namespace LightFlags
static const uint Disabled = (1 << 9);
static const uint InverseSquare = (1 << 10);
static const uint Linear = (1 << 11);
static const uint Particle = (1 << 12);
}

struct ClusterAABB
Expand Down
3 changes: 2 additions & 1 deletion package/Shaders/Common/SharedData.hlsli
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ namespace SharedData
// Debug (last)
uint EnableLightsVisualisation;
uint LightsVisualisationMode;
uint2 pad0;
uint EnableParticleContactShadows;
uint pad0;
};

struct WetnessEffectsSettings
Expand Down
9 changes: 8 additions & 1 deletion package/Shaders/Lighting.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -2801,8 +2801,15 @@ PS_OUTPUT main(PS_INPUT input, bool frontFace : SV_IsFrontFace)
# endif
}

// Particle lights carry both Simple and Particle bits. Simple-only lights are
// clustered fallbacks (no real emitter) and never trace; particle lights trace
// only when the user opted in via EnableParticleContactShadows.
const bool isParticleLight = (light.lightFlags & LightLimitFix::LightFlags::Particle) != 0;
const bool canShadow = isParticleLight ?
SharedData::lightLimitFixSettings.EnableParticleContactShadows :
!(light.lightFlags & LightLimitFix::LightFlags::Simple);
[branch] if (
!(light.lightFlags & LightLimitFix::LightFlags::Simple) &&
canShadow &&
shadowComponent != 0.0 &&
lightAngle > 0.0 &&
passesIntensityGate)
Expand Down
Loading
Loading