bevy_webgl2 icon indicating copy to clipboard operation
bevy_webgl2 copied to clipboard

GLTF objects are sometimes all blue or colored red

Open lights0123 opened this issue 3 years ago • 7 comments

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: Screenshot from 2021-04-23 22-49-21 However, sometimes, it will appear completely blue: Screenshot from 2021-04-23 22-49-36 And sometimes, colored red: Screenshot from 2021-04-23 22-49-27

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).

lights0123 avatar Apr 24 '21 03:04 lights0123

Demo: https://asteroids-3d.netlify.app/

lights0123 avatar Apr 24 '21 21:04 lights0123

What are the versions of bevy / webgl2?

mrk-its avatar Apr 26 '21 17:04 mrk-its

Cargo.lock

[[package]]
name = "bevy"
version = "0.5.0"

[[package]]
name = "bevy_webgl2"
version = "0.5.2"

lights0123 avatar Apr 26 '21 17:04 lights0123

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?

mockersf avatar Apr 26 '21 21:04 mockersf

https://github.com/lights0123/asteroids_3d/tree/simple-web

lights0123 avatar Apr 26 '21 22:04 lights0123

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.

lights0123 avatar Apr 26 '21 22:04 lights0123

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.

lights0123 avatar Apr 26 '21 22:04 lights0123