-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
WebGL2: can't render StandardMaterial #12081
Comments
@superdump the error is
|
@mockersf if this is super important to fix ASAP, I can whip up a hotfix right now by passing slightly less optimized data structures to the standard material. Just let me know :) |
# Objective - Fixes #12081 ## Solution Passing the `Affine2` as a neatly packed `mat3x2` breaks WebGL with `drawElementsInstanced: Buffer for uniform block is smaller than UNIFORM_BLOCK_DATA_SIZE.` I fixed this by using a `mat3x3` instead. Alternative solutions that come to mind: - Pass in a `mat3x2` on non-webgl targets and a `mat3x3` otherwise. I guess I could use `#ifdef SIXTEEN_BYTE_ALIGNMENT` for this, but it doesn't seem quite right? This would be more efficient, but decrease code quality. - Do something about `UNIFORM_BLOCK_DATA_SIZE`. I don't know how, so I'd need some guidance here. @superdump let me know if you'd like me to implement other variants. Otherwise, I vote for merging this as a quick fix for `main` and then improving the packing in subsequent PRs :) ## Additional notes Ideally we should merge this before @JMS55 rebases #10164 so that they don't have to rebase everything a second time.
# Objective - Fixes bevyengine#12081 ## Solution Passing the `Affine2` as a neatly packed `mat3x2` breaks WebGL with `drawElementsInstanced: Buffer for uniform block is smaller than UNIFORM_BLOCK_DATA_SIZE.` I fixed this by using a `mat3x3` instead. Alternative solutions that come to mind: - Pass in a `mat3x2` on non-webgl targets and a `mat3x3` otherwise. I guess I could use `#ifdef SIXTEEN_BYTE_ALIGNMENT` for this, but it doesn't seem quite right? This would be more efficient, but decrease code quality. - Do something about `UNIFORM_BLOCK_DATA_SIZE`. I don't know how, so I'd need some guidance here. @superdump let me know if you'd like me to implement other variants. Otherwise, I vote for merging this as a quick fix for `main` and then improving the packing in subsequent PRs :) ## Additional notes Ideally we should merge this before @JMS55 rebases bevyengine#10164 so that they don't have to rebase everything a second time.
# Objective - Fixes bevyengine#12081 ## Solution Passing the `Affine2` as a neatly packed `mat3x2` breaks WebGL with `drawElementsInstanced: Buffer for uniform block is smaller than UNIFORM_BLOCK_DATA_SIZE.` I fixed this by using a `mat3x3` instead. Alternative solutions that come to mind: - Pass in a `mat3x2` on non-webgl targets and a `mat3x3` otherwise. I guess I could use `#ifdef SIXTEEN_BYTE_ALIGNMENT` for this, but it doesn't seem quite right? This would be more efficient, but decrease code quality. - Do something about `UNIFORM_BLOCK_DATA_SIZE`. I don't know how, so I'd need some guidance here. @superdump let me know if you'd like me to implement other variants. Otherwise, I vote for merging this as a quick fix for `main` and then improving the packing in subsequent PRs :) ## Additional notes Ideally we should merge this before @JMS55 rebases bevyengine#10164 so that they don't have to rebase everything a second time.
Bevy version
main since #11904
[Optional] Relevant system information
This is on Wasm on WebGL2
What you did
Try to run an example using
StandardMaterial
likelighting
orload_gltf
What went wrong
Nothing renders
The text was updated successfully, but these errors were encountered: