-
Notifications
You must be signed in to change notification settings - Fork 3.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
NME: multiple changes to support ray marching in the NME #13272
Conversation
… nme-raymarching
… nme-raymarching
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/13272/merge/index.html#WGZLGJ#4600 Links to test babylon tools with this snapshot: https://playground.babylonjs.com/?snapshot=refs/pull/13272/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/13272/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.
Looks good to me only minor comments and mostly the same 3 in various places :-)
packages/dev/core/src/Engines/WebGPU/webgpuShaderProcessorsGLSL.ts
Outdated
Show resolved
Hide resolved
packages/dev/core/src/Engines/WebGPU/webgpuShaderProcessorsGLSL.ts
Outdated
Show resolved
Hide resolved
packages/dev/core/src/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.ts
Outdated
Show resolved
Hide resolved
packages/dev/core/src/Materials/Node/Blocks/Dual/reflectionTextureBlock.ts
Show resolved
Hide resolved
packages/dev/core/src/Materials/Node/Blocks/Dual/reflectionTextureBlock.ts
Show resolved
Hide resolved
packages/dev/core/src/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.ts
Show resolved
Hide resolved
NME: multiple changes to support ray marching in the NME Former-commit-id: 5cf123d8b5c26173a3fec0c2865506018f0cb5d7
The main changes are that some blocks can be configured to generate their code in the fragments shader only (
Lights
,PBRMetallicRoughness
,Reflection
).New blocks have also been added:
FragDepthBlock
to write fragment depth,ShadowMapBlock
to generate depth in a shadow map.The
ShadowDepthWrapper
has also been updated to work with materials using aShadowMapBlock
.A couple of helper blocks have also been created:
TriPlanarBlock
andBiPlanarBlock
for sampling a texture with a tri/bi planar mapping (ray marching does not usually produce uvs, so we need to be able to sample a texture with a position+normal instead).Note that we haven't created a ray marching node itself, but it's now possible for users to create one. In the PG demo below, we have implemented a very basic one with a
CustomBlock
.Here is a PG that uses all these new features:
https://playground.babylonjs.com/#M3QR7E#34