Handbook
Glossary
raytrace-uniforms
Vocabulary
gpu
.
demos
.
raytrace
Definition
USING:
gpu.render
math
sequences
;
IN:
gpu.demos.raytrace
TUPLE:
raytrace-uniforms
<
uniform-tuple
{
mv-inv-matrix
sequence
initial:
f
}
{
fov
sequence
initial:
f
}
{
spheres
sequence
initial:
f
}
{
floor-height
float
initial:
0.0
}
{
floor-color
sequence
initial:
f
}
{
background-color
sequence
initial:
f
}
{
light-direction
sequence
initial:
f
}
;
Methods
USING:
combinators
gpu.demos.raytrace
gpu.render.private
kernel
;
M:
raytrace-uniforms
(bind-uniform-textures)
nip
{
}
cleave
;
USING:
accessors
combinators
gpu.demos.raytrace
gpu.render
gpu.render.private
gpu.shaders
kernel
opengl.gl
sequences
;
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
;