GLUtil-0.2.1: Miscellaneous OpenGL utilities.

Safe HaskellNone

Graphics.GLUtil.Shaders

Description

Utilities for working with fragment and vertex shader programs.

Synopsis

Documentation

loadShader :: Shader s => FilePath -> IO sSource

Load a shader program from a file.

linkShaderProgram :: [VertexShader] -> [FragmentShader] -> IO ProgramSource

Link vertex and fragment shaders into a Program.

namedUniform :: Uniform a => String -> StateVar aSource

Work with a named uniform shader parameter. Note that this looks up the variable name on each access, so uniform parameters that will be accessed frequently should instead be resolved to a UniformLocation.

uniformVec :: UniformLocation -> SettableStateVar [GLfloat]Source

Set a UniformLocation from a list representation of a low-dimensional vector of GLfloats. Only 2, 3, and 4 dimensional vectors are supported.

uniformMat :: UniformLocation -> SettableStateVar [[GLfloat]]Source

Set a uniform shader location from a nested list matrix representation. Only 3x3 and 4x4 matrices are supported.

namedUniformMat :: String -> SettableStateVar [[GLfloat]]Source

Set a named uniform shader parameter from a nested list matrix representation. Only 3x3 and 4x4 matrices are supported.

uniformGLMat4 :: UniformLocation -> SettableStateVar (GLmatrix GLfloat)Source

Set a uniform shader location with a 4x4 GLmatrix.