bevy_webgl2
bevy_webgl2 copied to clipboard
GLTF objects are sometimes all blue or colored red
I'm still working on getting my game published, so I'll either get a link to you in an hour or tomorrow. I load three different GLTF files, which you can get here: assets.zip. The file ship.glb should look like this:
However, sometimes, it will appear completely blue:
And sometimes, colored red:
It's pretty much a guessing game as to which will happen.
When this happens, the files ship.glb and Itokawa_1_1.glb (which both have images as their textures) have the same appearance, but cube.glb (which has a material defined by a single color) is completely unaffected. Additionally, any materials with a solid color created directly in Bevy are also unaffected.
This never happens natively, but I've seen it happen on FF and Chrome on Linux (Nvidia and Intel) and Windows (Intel) and Chrome on Chrome OS (Intel).
Demo: https://asteroids-3d.netlify.app/
What are the versions of bevy / webgl2?
Cargo.lock
[[package]]
name = "bevy"
version = "0.5.0"
[[package]]
name = "bevy_webgl2"
version = "0.5.2"
Using your deployed app, I can see the same issue on macOS safari & firefox. But taking your model, I can't reproduce in my own code. Could you share your code with a reproducer as minimal as possible?
https://github.com/lights0123/asteroids_3d/tree/simple-web
Creating a minimal example is... difficult. I had it for a while that removing one plugin would remove the problem, but that plugin did absolutely nothing, e.g. the fn build
within the impl
was completely empty. And then tweaking other stuff brought it back. I'll try to cut it down a little bit further though.
Here's an example: commit ed5bb6e
on that branch will sometimes be red or blue. Commit 4137ea4
will generally always be red—however, comment out either of these two parameters in this empty system, and the problem will now only happen intermittently.