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

Shader uniforms not updated when using an array of values #5670

Closed
telinc1 opened this issue Apr 25, 2021 · 1 comment
Closed

Shader uniforms not updated when using an array of values #5670

telinc1 opened this issue Apr 25, 2021 · 1 comment

Comments

@telinc1
Copy link

telinc1 commented Apr 25, 2021

Version

  • Phaser Version: 3.54

Description

When updating a shader's uniform using arrays of values (e.g. set4fv instead of set4f, or any of the matrix methods), the uniform will not actually be updated. This causes #5660 (and perhaps other issues?).

All uniform setters, both on WebGLPipelines and WebGLShaders, call the lower-level setUniform2/3/4 methods to update the values. These methods check for identity between the old and the new values, which is a good optimization when using scalar values. For arrays, however, if the same object is passed in, the uniform isn't updated even if the values in the array are the different.

This has been an issue since 3.50. I'd assumed this was intended, but I'm no longer sure considering Phaser gets confused by it, too. In the case of #5660, a setMatrix3fv call gets ignored.

@photonstorm
Copy link
Collaborator

Thank you for submitting this issue. We have fixed this and the fix has been pushed to the master branch. It will be part of the next release. If you get time to build and test it for yourself we would appreciate that.

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

No branches or pull requests

3 participants