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

[WIP] switch to WebGPU #4939

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

[WIP] switch to WebGPU #4939

wants to merge 4 commits into from

Conversation

elalish
Copy link
Contributor

@elalish elalish commented Nov 13, 2024

Now that Three.js supports WebGPU, and better yet, WebGPURenderer automatically falls back to WebGL2Renderer on unsupported platforms, it's probably about time we started migrating. Amazingly, it sort of already works! Main problems I've noticed so far are with our custom shaders:

  1. custom blur shader for the generated environment. I think we can delete all this code and start using getTextureLevel instead, but that means we'll also have to transition from scene.environment to scene.environmentNode`.

  2. custom shadow shader. Just rewrite this in TSL - shouldn't be too complex.

We'll see how the rest goes... FYI @mrdoob.

@elalish elalish self-assigned this Nov 13, 2024
@CDerrell-ADT
Copy link

CDerrell-ADT commented Dec 11, 2024

Does it help if I say I don't care about shaders much (for now) for my use cases? Out of curiosity how do I test your PR?

@elalish
Copy link
Contributor Author

elalish commented Dec 11, 2024

You may not care about shaders, but they're the heart of how MV (and 3D rendering in general) works, so If they aren't working, you'll definitely miss them. You can pull my branch and serve locally, but you'll mostly get black models.

@CDerrell-ADT
Copy link

CDerrell-ADT commented Dec 11, 2024 via email

const cubeTarget = new CubeRenderTarget(256);
(cubeTarget as any)
.fromCubeTexture(
this.threeRenderer, tmpTarget.texture, GENERATED_SIGMA);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here I'm relying on a WIP three.js PR: mrdoob/three.js#30165. There's still some problem, probably in that PR, because randomly the generated environment either throws or creates a black texture.

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

Successfully merging this pull request may close these issues.

2 participants