Skip to content

Commit

Permalink
Add a couple more lines on passing array uniforms
Browse files Browse the repository at this point in the history
The syntax for arrays took me a bit to figure out and I'm still not 100% sure whether or not there's a more compact way (`colors: [[0, 1, 0, 1], [0, 0, 1, 1]]`? This PR adds another uniform example to help communicate what's possible.
  • Loading branch information
rreusser authored Dec 29, 2016
1 parent b45738b commit ebd62a0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion API.md
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,7 @@ var command = regl({
uniform vec4 someUniform;
uniform int anotherUniform;
uniform SomeStruct nested;
uniform vec4 colors[2];
void main() {
gl_Position = vec4(1, 0, 0, 1);
Expand All @@ -642,7 +643,9 @@ var command = regl({
uniforms: {
someUniform: [1, 0, 0, 1],
anotherUniform: regl.prop('myProp'),
'nested.value': 5.3
'nested.value': 5.3,
'colors[0]': [0, 1, 0, 1],
'colors[1]': [0, 0, 1, 1]
},

// ...
Expand Down

0 comments on commit ebd62a0

Please sign in to comment.