Shader objects
GPU-accelerated rendering

Prev:Framebuffer objects
Next:Rendering


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-instance> ( 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-array

<multi-vertex-array> ( vertex-formats program-instance -- vertex-array )

<vertex-array*> ( vertex-buffer program-instance format -- vertex-array )

<vertex-array> ( vertex-buffer program-instance -- vertex-array )

VERTEX-FORMAT: