Skip to content

GlslViewer UNIFORMS

Patricio Gonzalez Vivo edited this page Jan 27, 2022 · 10 revisions

Native UNIFORMS

  • uniform int u_frame;: frame number

  • uniform float u_time;: shader playback time (in seconds)

  • uniform float u_delta;: delta time between frames (in seconds)

  • uniform vec4 u_date;: year, month, day and seconds

  • uniform vec2 u_resolution;: viewport resolution (in pixels)

  • uniform vec2 u_mouse;: mouse pixel coords

  • uniform vec3 u_camera: Position of the camera

  • uniform float u_cameraFarClip: far clipping

  • uniform float u_cameraNearClip: near clipping

  • uniform float u_cameraDistance: camera distance to target (0,0,0)

  • uniform bool u_cameraChange: true when the camera change position

  • uniform mat3 u_normalMatrix: Normal Matrix

  • uniform mat4 u_modelMatrix: Model Matrix

  • uniform mat4 u_viewMatrix: View Matrix

  • uniform mat4 u_projectionMatrix: Projection Matrix

  • uniform mat4 u_modelViewProjectionMatrix: Model + View + Projection Matrix

  • uniform vec3 u_light: Position of the light

  • uniform vec3 u_lightColor: Color of the light

  • uniform mat4 u_lightMatrix: Light Matrix for reprojecting shadows

  • uniform sampler2D u_tex[number]: default textures names

  • uniform sampler2D u_buffer[number]: extra buffers forked with the define flag BUFFER_[number] on a subshaders. learn more about this here

  • uniform sampler2D u_doubleBuffer[number]: extra double buffers forked with the define flag DOUBLE_BUFFER_[number] on a subshaders. learn more about this here

  • uniform sampler2D u_convolutionPyramid[number]: perform convolution pyramids on a buffer with the define flag CONVOLUTION_PYRAMID_[number] on a subshaders. learn more about this here

Only on 3D scenes (when you load a geometry)

  • uniform sampler2D u_scene: color texture buffer of the scene, available on POSTPROCESSING subshader. Learn more about it here

  • uniform sampler2D u_sceneDepth: color texture buffer of the scene, available on POSTPROCESSING subshader. Learn more about it here

  • uniform sampler2D u_ligthShadowMap: Shadow map

  • uniform samplerCube u_cubeMap: loaded cubemap

  • uniform vec3 u_SH[9]: Pre computed Spherical Harmonics of the loaded cubemap