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

Color changes when rotating the scene on on the web. #2

Closed
FrankenApps opened this issue Oct 18, 2021 · 7 comments
Closed

Color changes when rotating the scene on on the web. #2

FrankenApps opened this issue Oct 18, 2021 · 7 comments
Labels
bug Something isn't working

Comments

@FrankenApps
Copy link
Owner

FrankenApps commented Oct 18, 2021

When rotating the scene using the WebGL2 backend the color of my texture somehow changes constantly.
I am pretty sure this is a wgpu bug on WebGL2 or I am using something that is not yet supported.

GIFs

WebGL2

webgl2

Native

How it should behave (the yellow circle is only there to indicate that the mouse is pressed).
native

@kvark
Copy link

kvark commented Oct 18, 2021

Interestingly, GL backend runs correctly. So this is something specific to WebGL.

@FrankenApps
Copy link
Owner Author

The problem is related to the value of light.color changing when the view is rotated. Guess I'll just hardcode the color to white in the shader for now.

@FrankenApps
Copy link
Owner Author

This might be related to gfx-rs/wgpu#2072 (comment)? I tried changing the LightUniform to include another offset, but that did not do the trick.

@kvark
Copy link

kvark commented Oct 18, 2021

Any warnings like that in your console?

@FrankenApps
Copy link
Owner Author

No, I am only getting two unrelated warnings.

@kvark
Copy link

kvark commented Oct 19, 2021

wgpu is confused by the fact your entry points are both named main. This isn't valid in WGSL today.
Fixing this, it bumps into gfx-rs/wgpu#2072 (comment)

@FrankenApps
Copy link
Owner Author

Thank you very much.

With the recent changes I made yesterday to align the uniform to 16 bytes, I only had to change the names of the entry point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants