Shader objects - Factor Documentation (original) (raw)
The gpu.shaders vocabulary supports defining, compiling, and linking shaders into programs that run on the GPU and control rendering. GLSL-PROGRAM:
GLSL-SHADER:
GLSL-SHADER-FILE:
A program must be instantiated for each graphics context it is used in:
( program: program -- instance: program-instance )
Program instances can be updated on the fly, allowing for interactive development of shaders:
refresh-program ( program: program -- )
Render data inside GPU buffers is organized into vertex-arrays for consumption by shader code:
( vertex-formats program-instance -- vertex-array )
<vertex-array*> ( vertex-buffer program-instance format -- vertex-array )
( vertex-buffer program-instance -- vertex-array )
VERTEX-FORMAT: