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
WebGPURenderer: Initial commit. #20254
Conversation
I'm also planning to invest a certain amount of my future development time in enhancing this renderer. Over time, more and more features will be added which will make @mrdoob is it okay if I commit smaller changes and bug fixes related to |
Excellent!!
Sounds good! 👌 |
Thanks!! |
Yay! WebGPU is coming!!! |
Exciting! Yes, using /cc @sunag @martinRenou |
FYI: The current GLSL 4.5 shaders in I can of course help with the integration of a node material system since writing shaders for Besides, the renderer already expects the uniform data of a material as an array of |
Regarding decode image and send data to WebGPU texture. Does anyone know whether WebGPU plans to directly take image or not? If it doesn't and we need to keep doing that manually, maybe we would ideally better to offload image decoding from main thread to workers (and make |
I think that can start in |
Would be good to know. Unfortunately, I couldn't fine something in the spec or elsewhere. |
Yeah, it seems we need to decode by ourselves for now. |
|
||
} else if ( uniform.isMatrix3 ) { | ||
|
||
size = 36; |
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.
If I'm right, it's 48 here?
In my webgpu renderer experience, I found matrix3 seems being 4columns x 3rows in WebGPU memory and fourth columns seem ignored.
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.
I did not had a chance to test this so far (the shaders do no use a normal matrix yet^^). I have similar code like you in my WebGL2/UBO PR but I wanted to verify first if a sizing of 48 is still required.
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.
Mine uses normal matrix so it seems to take actually 48 bytes (at least in my demos). But yeah verification should be first. I didn't find the mention about sizing of 48 yet neither.
They say we have to use |
Thanks, I had missed that function. |
This PR introduces a very basic implementation of a new renderer targeting WebGPU.
The new renderer only provides three basic shaders (mesh, points lines) but already some building blocks for handling geometries, UBOs and textures. Compared to
WebGLRenderer
the API ofWebGPURenderer
is very limited and most engine features are not supported yet. However, I think it's a good starting point for further developments and for interested WebGPU devs^^.I've invested no time in a material system up to now since I've planned to suggest the usage of node based materials right from the beginning.