Skip to content
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

Switch to using ThreeJS WebGPU renderer? #509

Open
martinRenou opened this issue Oct 21, 2024 · 1 comment
Open

Switch to using ThreeJS WebGPU renderer? #509

martinRenou opened this issue Oct 21, 2024 · 1 comment

Comments

@martinRenou
Copy link
Member

With the recent changes in ThreeJS, and the introduction of NodeMaterials in core ThreeJS accessible when using the WebGPURenderer, it may be interesting to look into switching to using it.

Though after a quick look, it seems the stencil buffer is not usable yet using this renderer? So this may be a no-go as of today.

Using node materials could eventually allow us to fix the z-fighting issue when using the logarithmic depth buffer (failed attempt in #503 with using the default renderer).
Node materials would allow tweaking the depth computation in the fragment shader, by extending MeshBasicNodeMaterial.

@martinRenou
Copy link
Member Author

For reference, this is where the logarithmic depth computation is performed using the new ThreeJS shading language (TSL) https://github.com/mrdoob/three.js/blob/48e6e2ee4e769013b911a079a433aecc2686d5b2/src/nodes/display/ViewportDepthNode.js#L119.

We could then simply offset the result of this function, and pass this to the depth parameter of the NodeMaterial.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant