-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Shadow Catcher Script #7299
base: main
Are you sure you want to change the base?
Shadow Catcher Script #7299
Conversation
The first link is not correct me thinks. |
Ah yep. Needs V2 engine. updating comment |
Great that we will add a shadow catcher to the engine's esm script library. It's a little different from the Web Components copy though: https://github.com/playcanvas/web-components/blob/main/examples/assets/scripts/shadow-catcher.mjs How come this version doesn't require a custom layer? cc @slimbuck |
Co-authored-by: Will Eastcott <[email protected]>
Co-authored-by: Will Eastcott <[email protected]>
scripts/esm/shadow-catcher.mjs
Outdated
shadowBias: 0, | ||
shadowDistance: this.shadowDistance, | ||
shadowResolution: 1024, | ||
shadowType: SHADOW_VSM_16F, |
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.
few/most of the light properties should be exposed as attributes, allowing user control. Lets say I want soft shadows.
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.
Yep valid point
also please expose soft shadow properties now that the shadow type is exposed, see public in description here: #7258 |
Instead of just proxying lots of light properties, why not just stipulate that the script has to be applied to an entity with a light component? Better yet, the script could collect all lights below the entity and bake them all into the shadow catcher. |
Yep I like this, although we have a custom shader at the moment that just picks the internal light litArgs_opacity = mix(light0_shadowIntensity, 0.0, shadow0);
gl_FragColor.rgb = vec3(0.0); We'd need that for each shadow and dynamically generate that shader, or could introduce some |
Consolidates the various Shadow Catcher implementations into a single version that can be used across editor/react/web components.
See demo and editor
I confirm I have read the contributing guidelines and signed the Contributor License Agreement.