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

webgpu? #193

Open
bryanhpchiang opened this issue May 30, 2023 · 3 comments
Open

webgpu? #193

bryanhpchiang opened this issue May 30, 2023 · 3 comments

Comments

@bryanhpchiang
Copy link

do you think switching the engine to webgpu would help with performance?

babylon is supposed to support webgpu out of the box

@fenomas
Copy link
Owner

fenomas commented Jun 4, 2023

Hi, thanks for the reminder! It looks like the feature is still experimental, but this engine should be able to support it without any effects on the game client. I'll try it out soon and see if there's any performance difference yet.

@fenomas
Copy link
Owner

fenomas commented Jun 14, 2023

@JaegerBomBYT I've looked into this enough to find that it's not an easy change. Babylon doesn't have any built-in support for texture arrays (i.e. texture atlases), but they're a big win for voxels so this engine uses a custom shader for them. That shader doesn't work as-is in webGPU, though I don't know how hard it will be to convert or rewrite.

Also using webGPU means that Babylon's core init becomes async, which winds up meaning a lot of grunt work - basically noa's constructor and/or init methods will need to change signature, and some changes to internals to make sure that various initialization doesn't happen until after babylon's engine init finishes.

The latter changes can be hacked around for testing, but the shader rewrite is thornier - because without that bit, there's no easy way to test whether webGPU improves performance or not.

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

3 participants
@fenomas @bryanhpchiang and others