Closed rparrett closed 3 years ago
Up to date with current bevy master, but the new wgpu stuff was rough on me and I've done the bare minimum only to get my 2d game working.
Oops! Thanks for that.
I'm super happy to keep working on this. But if someone with any experience at all with opengl wants to take the reins, that's great too.
Some of the examples are looking to be in pretty bad shape now that I've actually even run them.
The biggest known problem I have is here: https://github.com/mrk-its/bevy_webgl2/pull/24/commits/d30ac8ee23a78dc987425e6e7a1c9409e9b3586a#diff-a731f7f5f708022a34572ab832954c802f7fd77de1e8c38418ed7049717912f7R150
Which (I think) is resulting in a glGenerateMipmap / GL_INVALID_OPERATION in my project (but no visible problems weirdly), but must be causing all sorts of other issues, right?
Here's a survey of the examples:
Example | Status (This PR) | Status (0.4) | Status (Bevy Master/Native) |
---|---|---|---|
font_atlas_debug | panic | same | bit broken but no panic |
z_sort_debug | broken | working | broken |
Everything else seems to be working.
font_atlas_debug (same panic in master branch)
wasm.js:338 panicked at 'called `Option::unwrap()` on a `None` value', src/webgl2_render_pass.rs:227:89
z_sort_debug - cubes appear completely black
Oops. I wanted PerspectiveCameraBundle, not a 3d orthographic camera. Will fix that up.
I am not sure why I've been manually fixing examples instead of just copying them and using fix_bevy_example.sh
.
edit: oh, that strategy doesn't quite work for shader/*
and contributors
Issue with the contributors example was fixed in bevy
Thanks, you've done a lot of work! I'll take a closer look tomorrow.
load_gltf
appears to work, but GL_INVALID_OPERATION : glGenerateMipmap: in console
Do you still have this warning? I cannot reproduce it
I am (chrome 88, macos).
But my assumption that this is caused by my having basically removed support for anything but the default textureformat is a totally blind one.
I'm pretty sure that I don't remember seeing this with bevy 0.4 / bevy_webgl2 but I could be wrong.
The only place mipmaps are generated is https://github.com/mrk-its/bevy_webgl2/blob/637ca07c75ffbd29ab4661aed54f148eb11a39b4/src/renderer/webgl2_render_context.rs#L117 - It seems we can simply remove it because mipmaps are not used at all (because of hardcoded TEXTURE_MIN_FILTER = Gl::NEAREST). All texture filtering support has yet to be implemented - so let's remove this mipmap generation now (It would be great to run all texture-related examples after that, but I think everything should work exactly the same way)
Cool. That seems to resolve the scary error message. I double checked load_gltf
, sprite
, sprite_sheet
, texture
and they continue to work.
Any leads on what might be going on with z_sort_debug
?
Cool. That seems to resolve the scary error message. I double checked
load_gltf
,sprite
,sprite_sheet
,texture
and they continue to work.Any leads on what might be going on with
z_sort_debug
?
Not yet, will take a look
It seems z_order_debug in bevy's master is also broken, I've filled an issue: https://github.com/bevyengine/bevy/issues/1411
Nice work @rparrett. It looks like this PR is ready to review/merge, correct? cc @mrk-its.
It's probably not a goal to get this merged until we're much closer to bevy 0.5 being released.
Got it. Makes sense. I'll just point to this branch meanwhile 👍
@rparrett @JeanMertz I think it is good idea to merge it (if everything still works with current bevy master), and we can keep syncing with bevy in separate PR's. Some time ago I've created separate branch https://github.com/mrk-its/bevy_webgl2/tree/v0.4 for 0.4.x version of bevy_webgl2, so we can sync with bevy's master on master branch here.
Let's simply check few examples with current bevy - if it works I'll merge it.
Looks like all bevy_webgl2
examples that are expected to work (everything but font_atlas_debug
) are working on my end.
Fixes #23.
But in a pretty half-assed way. I do not know how to implement the render/render resource context stuff, so they are just stubs.
Providing this for anyone else who's tracking bevy master and just wants to get this working again.
CI obviously failing because this won't work with bevy 0.4.