(bind-uniforms) ( program-instance uniform-tuple -- )


Vocabulary
gpu.render.private

Inputs and outputs
program-instancean object
uniform-tuplean object


Definition

GENERIC: (bind-uniforms) ( program-instance uniform-tuple -- )


Methods






















M: raytrace-uniforms (bind-uniforms)
2dup M\ uniform-tuple (bind-uniforms) {
[
[ "mv_inv_matrix" uniform-index ]
[ mv-inv-matrix>> ] bi* [ 1 0 ] dip
4 4 >uniform-matrix glUniformMatrix4fv
]
[
[ "fov" uniform-index ] [ fov>> ] bi*
bind-uniform-vec2
]
[
spheres>> {
[
0 swap nth
{ ~quotation~ ~quotation~ ~quotation~ }
2cleave
]
[
1 swap nth
{ ~quotation~ ~quotation~ ~quotation~ }
2cleave
]
[
2 swap nth
{ ~quotation~ ~quotation~ ~quotation~ }
2cleave
]
[
3 swap nth
{ ~quotation~ ~quotation~ ~quotation~ }
2cleave
]
} 2cleave
]
[
[ "floor_height" uniform-index ] [ floor-height>> ]
bi* glUniform1f
]
[
[ "floor_color" uniform-index ] [ floor-color>> ]
bi* 2 swap 4 >uniform-vec-array glUniform4fv
]
[
[ "background_color" uniform-index ]
[ background-color>> ] bi* bind-uniform-vec4
]
[
[ "light_direction" uniform-index ]
[ light-direction>> ] bi* bind-uniform-vec3
]
} 2cleave ;