glhf icon indicating copy to clipboard operation
glhf copied to clipboard

Array uniforms feature request

Open shinomontaz opened this issue 2 years ago • 0 comments

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])

shinomontaz avatar May 07 '22 22:05 shinomontaz