-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Omni shadows for clustered lights #3537
Conversation
This is amazing! I've checked recently clustered for Omni lights and noticed it supports only linear falloff. |
@@ -37,5 +37,5 @@ vec3 getCookie2DClustered(sampler2D tex, mat4 transform, float intensity, bool i | |||
vec4 projPos = transform * vec4(vPositionW, 1.0); | |||
projPos.xy /= projPos.w; | |||
vec4 pixel = mix(vec4(1.0), texture2D(tex, projPos.xy), intensity); | |||
return isRgb ? pixel.rgb : vec3(dot(pixel, cookieChannel)); | |||
return isRgb == true ? pixel.rgb : vec3(dot(pixel, cookieChannel)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need to add the == true
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to be honest, I'm not sure, but have noticed one branch was not taken correctly unless I added it. So I added it to all. I could not find a different workaround.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TBH, if I was refactoring this code, I would delete this. So if it's important, I would add a comment to say why it's there.
Co-authored-by: Will Eastcott <will@playcanvas.com>
Co-authored-by: Will Eastcott <will@playcanvas.com>
Co-authored-by: Will Eastcott <will@playcanvas.com>
Clustered omni lights now support shadows by rendering them to the shadow atlas (shared with the spot lights)