Skip to content
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

Rendering breaks when used with bevy_webgl2 #103

Open
camblomquist opened this issue Jun 17, 2021 · 4 comments
Open

Rendering breaks when used with bevy_webgl2 #103

camblomquist opened this issue Jun 17, 2021 · 4 comments

Comments

@camblomquist
Copy link

I'm running the setup system from the readme example along with the bevy_webgl2_app_template.
In the native build, the shape renders properly.
In the wasm build, the shape is not visible on screen.

For giggles, we can add the shape to the webgl2 template scene. In native, the shape cuts the cube and plane in half as expected. In the wasm build, nothing renders at all!

For completeness, I've tested in Firefox and Edge.
When the shape is included, I see the following warning in the Edge console:
[.WebGL-0000177809F82080] GL_INVALID_OPERATION: It is undefined behaviour to have a used but unbound uniform buffer.
and in the Firefox console:
WebGL warning: drawElementsInstanced: Buffer for uniform block is smaller than UNIFORM_BLOCK_DATA_SIZE.
Though to be honest I don't know if these are relevant.

@Nilirad
Copy link
Owner

Nilirad commented Jun 17, 2021

Given the latest news about the new renderer, I think it's best to wait for it, especially because bevy_webgl2 will be permanently broken by the new design (as bevyengine/bevy#2351 states).

However, if someone wants to fix this now, feel free to make a PR.

@camblomquist
Copy link
Author

After spending too long fiddling around, I have no solutions but will say that I was wrong in including those warning messages. I don't see them in the first test scenario, so they appear to be unrelated.

@rparrett
Copy link
Contributor

rparrett commented Aug 18, 2021

I was able to reproduce this.

However, the main issue seems to be that bevy_webgl2_app_template is depending on an old release of bevy_webgl2. After updating that to 0.5.2, rendering generally works again.

There does seem to be some sort of issue when mixing in PbrBundles (z-fighting?), and with strokes and 3d cameras. But I think the first thing is pretty likely to be a bevy_webgl2 bug and I don't know if very many people are trying to do that.

image

@rparrett
Copy link
Contributor

rparrett commented Aug 18, 2021

It seems bit odd, because it's my understanding thatbevy_webgl2 = {version="0.5.0", optional=true} should bring in 0.5.2.

But the steps of

  • Clone bevy_webgl2_app_template
  • Add bevy_protototype_lyon readme example (minus the 2d camera)
  • Build for web

Seem to get me

   Compiling bevy v0.5.0
   Compiling bevy_prototype_lyon v0.3.1
   Compiling bevy_webgl2 v0.5.0

And explicitly specifying

[dependencies]
bevy_webgl2 = {version="0.5.2", optional=true}

Makes things work

   Compiling bevy_webgl2 v0.5.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants