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
Use shader material written in wgsl as shadow depth wrapper #14755
Conversation
Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s). |
Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s). |
Snapshot stored with reference name: Test environment: To test a playground add it to the URL, for example: https://babylonsnapshots.z22.web.core.windows.net/refs/pull/14755/merge/index.html#WGZLGJ#4600 Links to test babylon tools with this snapshot: https://playground.babylonjs.com/?snapshot=refs/pull/14755/merge To test the snapshot in the playground with a playground ID add it after the snapshot query string: https://playground.babylonjs.com/?snapshot=refs/pull/14755/merge#BCU1XR#0 |
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.
Only a small change!
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.
Just missing a doc and we are ready to merge!
Allow ShaderMaterial written in WGSL to be used as shadow depth wrapper.
Original issue discussion
Changes involved
doNotInjectCode=false
, BJS will log error in dev tool console about missing shader includes by default. The reason is BJS does not yet have full support for StandardMaterial or PBRMaterial implemented in WGSL. It is a lot of work to setup WGSL shader from scratch with transparent shadows, self shadow, etc to test the missing shader includes for shadow map. The idea is: for now, if a developer has implement a complete WGSL shader that require these shader includes, this developer can create these shader includes in WGSL, and include them in ShaderStore.IncludesShadersStoreWGSL. This example has been tested with some dumm WGSL code included into final runtime WGSL shader. If I later on need these shader includes and I have a test case, I will implement them and add to BJS WGSL shader include.The shader includes that could be added in the future (WGSL version) mentioned above refers to:
Example outcome
See dev branch for test scenario setup in dev host.
Screenshot of local test result as shown below. A WGSL vertex shader is applied to animate both sphere and shadow vertex displacement.