-
|
Hello ! // Shader code
uniform int myArray[128];# Custom Pipeline code
MaterialShader.uniforms['myArray[0]'].set_value(16)
MaterialShader.uniforms['myArray[1]'].set_value(64)
MaterialShader.uniforms['myArray[2]'].set_value(48)
# versus something like MaterialShader.uniforms['myArray'].set_value([16,64,48]) |
Beta Was this translation helpful? Give feedback.
Answered by
pragma37
Jun 9, 2022
Replies: 1 comment 2 replies
-
|
I think there's no way to set array uniforms like that in OpenGL. In those cases I would use a Uniform Buffer Object: Line 310 in a987506 Line 381 in a987506 |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
panthavma
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think there's no way to set array uniforms like that in OpenGL.
In those cases I would use a Uniform Buffer Object:
https://github.com/bnpr/Malt/blob/Development/Malt/Render/Common.py
Malt/Malt/Pipeline.py
Line 310 in a987506
Malt/Malt/Pipeline.py
Line 381 in a987506