Skip to content

Conversation

@Oletus
Copy link
Contributor

@Oletus Oletus commented Jan 1, 2019

Uniforms of materials should be set and accessed by indexing with a string rather than using the dot operator.

This makes the code more compatible with JavaScript tools such as Closure compiler. If the uniform names are not strings, Closure compiler might try to optimize the uniform names, which would create a mismatch between the shader code and the JS code.

This commit should fix the majority of instances where uniforms were being accessed using the dot operator.

Uniforms of materials should be set and accessed by indexing with a string rather than using the dot operator.

This makes the code more compatible with JavaScript tools such as Closure compiler. If the uniform names are not strings, Closure compiler might try to optimize the uniform names, which would create a mismatch between the shader code and the JS code.

This commit should fix the majority of instances where uniforms were being accessed using the dot operator.
@mrdoob mrdoob added this to the r101 milestone Jan 2, 2019
@mrdoob
Copy link
Owner

mrdoob commented Jan 2, 2019

Interesting...

@mrdoob mrdoob merged commit f62b2a8 into mrdoob:dev Jan 2, 2019
@mrdoob
Copy link
Owner

mrdoob commented Jan 2, 2019

Thanks!

@Oletus
Copy link
Contributor Author

Oletus commented Jan 2, 2019

Thanks for the review!

@Oletus Oletus deleted the cleanup-addressing-uniforms-in-examples branch January 2, 2019 09:06
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

Successfully merging this pull request may close these issues.

2 participants