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

Array uniforms feature request #8

Open
shinomontaz opened this issue May 7, 2022 · 0 comments
Open

Array uniforms feature request #8

shinomontaz opened this issue May 7, 2022 · 0 comments

Comments

@shinomontaz
Copy link

It would be nice to have an array uniforms. Useful for dynamic shadows when obstacles are many.
Seems it's can be done by calling gl.Uniform1fv with second param equals to desired array size in shader.go.
Something like this:

case Float:
		value := value.(float32)
		gl.Uniform1fv(s.uniformLoc[uniform], 1, &value)
case FloatArr:
                value := value.([]float32)
		length := int32(len(value))
		gl.Uniform1fv(s.uniformLoc[uniform], length, &value[0])
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

No branches or pull requests

1 participant