-
Notifications
You must be signed in to change notification settings - Fork 481
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
allow arrays for uniforms #348
Conversation
a3444b1
to
6a4231d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fantastic thks!
I've made a minor refactoring in the JS part, I think you will approve.
I also seen that we do a flat(4) at the end but that's actually a bit random right? (my original thinking was like vec4 -> flat(4) but that's not how it works 😂
| Vector | ||
| readonly [number, number] | ||
| readonly [number, number, number] | ||
| readonly [number, number, number, number]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you replace ReadonlyArray<number>[]
?
The current types do not allow e.g. uniform float3 colors[12];
When trying to pass in a number[][]
as a uniform, I get:
Type 'number[][]' is not assignable to type 'Uniform'.
Type 'number[][]' is not assignable to type 'readonly UniformValue[]'.
Type 'number[]' is not assignable to type 'UniformValue'.
Type 'number[]' is not assignable to type 'readonly [number, number, number]'.
Target requires 3 element(s) but source may have fewer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we want to allow for number[][]
? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you send the example where you need number[][]
? I would love to check it.
Yes, I guess a normal |
No description provided.