Module OgamlGraphics.Uniform

Encapsulates a group of uniforms for rendering

This module encapsulates a set of uniforms that can be passed to GLSL programs.

exception Invalid_uniform of string
Raised when an error occurs while creating or when drawing using a uniform.
type t
Type of a set of uniforms
val empty : t
Empty set of uniforms
val vector3f : string -> OgamlMath.Vector3f.t -> t -> t
vector3f name vec set adds the uniform vec to set . the uniform should be refered to as name in a glsl program. Raises Invalid_uniform if name is already bound in set . Type : vec3.
See : OgamlMath.Vector3f
val vector2f : string -> OgamlMath.Vector2f.t -> t -> t
See vector3f. Type : vec2.
See : OgamlMath.Vector2f
val vector3i : string -> OgamlMath.Vector3i.t -> t -> t
See vector3f. Type : vec3i.
See : OgamlMath.Vector3i
val vector2i : string -> OgamlMath.Vector2i.t -> t -> t
See vector3f. Type : vec2i.
See : OgamlMath.Vector2i
val int : string -> int -> t -> t
See vector3f. Type : int.
val float : string -> float -> t -> t
See vector3f. Type : float.
val matrix3D : string -> OgamlMath.Matrix3D.t -> t -> t
See vector3f. Type : mat3.
See : OgamlMath.Matrix3D
val matrix2D : string -> OgamlMath.Matrix2D.t -> t -> t
See vector3f. Type : mat2.
See : OgamlMath.Matrix2D
val color : string -> Color.t -> t -> t
See vector3f. Type : vec4.
See : OgamlGraphics.Color
val texture2D : string -> ?tex_unit:int -> Texture.Texture2D.t -> t -> t
See vector3f. Type : sampler2D.
The optional parameter tex_unit corresponds to the texture unit that is used to bind this texture. If not provided, it defaults to the next available unit. If no additional units are available, or if a unit is explicitly bound twice, drawing with the uniform will raise Invalid_uniform .
See Context.capabilities for the number of available units.
See : OgamlGraphics.Texture.Texture2D
See : OgamlGraphics.Context
val texture2Darray : string -> ?tex_unit:int -> Texture.Texture2DArray.t -> t -> t
See texture2D. Type : sampler2Darray.

See : OgamlGraphics.Texture.Texture2DArray
val cubemap : string -> ?tex_unit:int -> Texture.Cubemap.t -> t -> t
See texture2D. Type : samplerCube.

See : OgamlGraphics.Texture.Cubemap