react-babylonjs icon indicating copy to clipboard operation
react-babylonjs copied to clipboard

Enable webgpu support

Open DenysAshikhin opened this issue 2 years ago • 7 comments

Hi,

I apolgize for the rough initial pull request, but I would like to help enable webgpu support and get the ball rolling. Please advise on any next steps to make this all work together nicely!

DenysAshikhin avatar May 11 '23 17:05 DenysAshikhin

this is a great idea. let me have a look this weekend! i'll need to verify the async nature - wonder if it's better with <Suspense .../> and also the async behaviour before rendering starts and how the observables are passed. Additionally, it needs to be the ref to the canvas (not a selector). I'll check more this weekend. cheers.

brianzinn avatar May 13 '23 02:05 brianzinn

I did have a look on the weekend. The main issue is that the create is async, so there is nothing to create the render loop on. Did you have this working on webgpu? You can npm/yarn link your local build if you want to try it out in a real project. Otherwise you can use the storybook or gatsby site in docs. I think we'll need webgpu options as a param- they look different than regular EngineOptions. i'm quite busy this week, but definitely would like to add webgpu support. thanks

brianzinn avatar May 15 '23 15:05 brianzinn

some news about this pr?

buuhvprojects avatar Jan 01 '24 17:01 buuhvprojects

Hi, Is there any update on this PR? Not being able to leverage the GPU will force me to move to plain Babylonjs implementation. Thanks. EL.

emilx-cell avatar Apr 04 '24 14:04 emilx-cell

Would this PR meet your needs? I haven't tried it out - not sure how the async part will playout. I originally had in mind a separate <WebGPUEngine .../> component and then a wrapper that would do the check for support and render children. Maybe this way is better?

brianzinn avatar Apr 04 '24 20:04 brianzinn

Hi, Yes, that sounds great. I would love to try it! Thanks, EL.

emilx-cell avatar Apr 05 '24 08:04 emilx-cell

I wanted to provide more options including explicit <WebGPUEngine .. />. Thank-you @DenysAshikhin - I really appreciate your efforts to get the ball rolling and apologize for taking so long to move things along. I have started a different way here #315 - there is also a FallbackEngine component. Looking for community feedback on which way is better.

brianzinn avatar Apr 06 '24 22:04 brianzinn

thanks @DenysAshikhin for your contribution. it helped move this long overdue feature along. there wasn't much feedback on a preferred way! 😄 i need to wait for my PR on @babylonjs/core and then it will be live - instead of extra props as you were proposing - new Components will be:

<WebGPUEngine .../>

and

<FallbackEngine .../>

brianzinn avatar Jun 01 '24 03:06 brianzinn