Document most uniforms in shaders
This commit is contained in:
parent
aa7e0df514
commit
67d29803b5
|
@ -14,13 +14,11 @@ precision mediump float;
|
||||||
|
|
||||||
/// A 3D transform to apply to the scene.
|
/// A 3D transform to apply to the scene.
|
||||||
uniform mat4 uTransform;
|
uniform mat4 uTransform;
|
||||||
|
|
||||||
/// A pair of fixed scale factors to be applied to the texture coordinates.
|
/// A pair of fixed scale factors to be applied to the texture coordinates.
|
||||||
uniform vec2 uTexScale;
|
uniform vec2 uTexScale;
|
||||||
|
|
||||||
/// The 2D vertex position.
|
/// The 2D vertex position.
|
||||||
attribute vec2 aPosition;
|
attribute vec2 aPosition;
|
||||||
|
|
||||||
/// The texture coordinate.
|
/// The texture coordinate.
|
||||||
attribute vec2 aTexCoord;
|
attribute vec2 aTexCoord;
|
||||||
|
|
||||||
|
|
|
@ -12,8 +12,11 @@
|
||||||
|
|
||||||
precision highp float;
|
precision highp float;
|
||||||
|
|
||||||
|
/// A concatenated transform to be applied to each point.
|
||||||
uniform mat4 uTransform;
|
uniform mat4 uTransform;
|
||||||
|
/// The texture coordinates for this glyph.
|
||||||
uniform vec4 uGlyphTexCoords;
|
uniform vec4 uGlyphTexCoords;
|
||||||
|
/// The size of the glyph in local coordinates.
|
||||||
uniform vec2 uGlyphSize;
|
uniform vec2 uGlyphSize;
|
||||||
|
|
||||||
attribute vec2 aQuadPosition;
|
attribute vec2 aQuadPosition;
|
||||||
|
|
|
@ -12,7 +12,9 @@
|
||||||
|
|
||||||
precision mediump float;
|
precision mediump float;
|
||||||
|
|
||||||
|
/// The 3D projection matrix.
|
||||||
uniform mat4 uProjection;
|
uniform mat4 uProjection;
|
||||||
|
/// The 3D modelview matrix.
|
||||||
uniform mat4 uModelview;
|
uniform mat4 uModelview;
|
||||||
|
|
||||||
attribute vec3 aPosition;
|
attribute vec3 aPosition;
|
||||||
|
|
|
@ -21,15 +21,24 @@
|
||||||
|
|
||||||
precision highp float;
|
precision highp float;
|
||||||
|
|
||||||
|
/// A 3D transform to be applied to all points.
|
||||||
uniform mat4 uTransform;
|
uniform mat4 uTransform;
|
||||||
|
/// Vertical snapping positions.
|
||||||
uniform vec4 uHints;
|
uniform vec4 uHints;
|
||||||
uniform vec2 uEmboldenAmount;
|
/// The size of the path colors texture in texels.
|
||||||
uniform ivec2 uPathColorsDimensions;
|
uniform ivec2 uPathColorsDimensions;
|
||||||
|
/// The fill color for each path.
|
||||||
uniform sampler2D uPathColors;
|
uniform sampler2D uPathColors;
|
||||||
|
/// The size of the path transform buffer texture in texels.
|
||||||
uniform ivec2 uPathTransformSTDimensions;
|
uniform ivec2 uPathTransformSTDimensions;
|
||||||
|
/// The path transform buffer texture, one path dilation per texel.
|
||||||
uniform sampler2D uPathTransformST;
|
uniform sampler2D uPathTransformST;
|
||||||
|
/// The size of the extra path transform factors buffer texture in texels.
|
||||||
uniform ivec2 uPathTransformExtDimensions;
|
uniform ivec2 uPathTransformExtDimensions;
|
||||||
|
/// The extra path transform factors buffer texture, packed two path transforms per texel.
|
||||||
uniform sampler2D uPathTransformExt;
|
uniform sampler2D uPathTransformExt;
|
||||||
|
/// The amount of faux-bold to apply, in local path units.
|
||||||
|
uniform vec2 uEmboldenAmount;
|
||||||
|
|
||||||
attribute vec2 aPosition;
|
attribute vec2 aPosition;
|
||||||
attribute vec2 aTexCoord;
|
attribute vec2 aTexCoord;
|
||||||
|
|
|
@ -16,15 +16,24 @@
|
||||||
|
|
||||||
precision highp float;
|
precision highp float;
|
||||||
|
|
||||||
|
/// A 3D transform to be applied to all points.
|
||||||
uniform mat4 uTransform;
|
uniform mat4 uTransform;
|
||||||
|
/// Vertical snapping positions.
|
||||||
uniform vec4 uHints;
|
uniform vec4 uHints;
|
||||||
uniform vec2 uEmboldenAmount;
|
/// The size of the path colors texture in texels.
|
||||||
uniform ivec2 uPathColorsDimensions;
|
uniform ivec2 uPathColorsDimensions;
|
||||||
|
/// The fill color for each path.
|
||||||
uniform sampler2D uPathColors;
|
uniform sampler2D uPathColors;
|
||||||
|
/// The size of the path transform buffer texture in texels.
|
||||||
uniform ivec2 uPathTransformSTDimensions;
|
uniform ivec2 uPathTransformSTDimensions;
|
||||||
|
/// The path transform buffer texture, one path dilation per texel.
|
||||||
uniform sampler2D uPathTransformST;
|
uniform sampler2D uPathTransformST;
|
||||||
|
/// The size of the extra path transform factors buffer texture in texels.
|
||||||
uniform ivec2 uPathTransformExtDimensions;
|
uniform ivec2 uPathTransformExtDimensions;
|
||||||
|
/// The extra path transform factors buffer texture, packed two path transforms per texel.
|
||||||
uniform sampler2D uPathTransformExt;
|
uniform sampler2D uPathTransformExt;
|
||||||
|
/// The amount of faux-bold to apply, in local path units.
|
||||||
|
uniform vec2 uEmboldenAmount;
|
||||||
|
|
||||||
attribute vec2 aPosition;
|
attribute vec2 aPosition;
|
||||||
attribute float aPathID;
|
attribute float aPathID;
|
||||||
|
|
|
@ -26,15 +26,25 @@
|
||||||
|
|
||||||
precision highp float;
|
precision highp float;
|
||||||
|
|
||||||
|
/// A 3D transform to be applied to the object.
|
||||||
uniform mat4 uTransform;
|
uniform mat4 uTransform;
|
||||||
|
/// Vertical snapping positions.
|
||||||
uniform vec4 uHints;
|
uniform vec4 uHints;
|
||||||
|
/// The framebuffer size in pixels.
|
||||||
uniform ivec2 uFramebufferSize;
|
uniform ivec2 uFramebufferSize;
|
||||||
uniform ivec2 uPathTransformSTDimensions;
|
/// The size of the path bounds texture in texels.
|
||||||
uniform sampler2D uPathTransformST;
|
|
||||||
uniform ivec2 uPathTransformExtDimensions;
|
|
||||||
uniform sampler2D uPathTransformExt;
|
|
||||||
uniform ivec2 uPathBoundsDimensions;
|
uniform ivec2 uPathBoundsDimensions;
|
||||||
|
/// The path bounds texture, one rect per path ID.
|
||||||
uniform sampler2D uPathBounds;
|
uniform sampler2D uPathBounds;
|
||||||
|
/// The size of the path transform buffer texture in texels.
|
||||||
|
uniform ivec2 uPathTransformSTDimensions;
|
||||||
|
/// The path transform buffer texture, one path dilation per texel.
|
||||||
|
uniform sampler2D uPathTransformST;
|
||||||
|
/// The size of the extra path transform factors buffer texture in texels.
|
||||||
|
uniform ivec2 uPathTransformExtDimensions;
|
||||||
|
/// The extra path transform factors buffer texture, packed two path transforms per texel.
|
||||||
|
uniform sampler2D uPathTransformExt;
|
||||||
|
/// The amount of faux-bold to apply, in local path units.
|
||||||
uniform vec2 uEmboldenAmount;
|
uniform vec2 uEmboldenAmount;
|
||||||
|
|
||||||
attribute vec2 aQuadPosition;
|
attribute vec2 aQuadPosition;
|
||||||
|
|
|
@ -24,15 +24,25 @@
|
||||||
|
|
||||||
precision highp float;
|
precision highp float;
|
||||||
|
|
||||||
|
/// A 3D transform to be applied to the object.
|
||||||
uniform mat4 uTransform;
|
uniform mat4 uTransform;
|
||||||
|
/// Vertical snapping positions.
|
||||||
uniform vec4 uHints;
|
uniform vec4 uHints;
|
||||||
|
/// The framebuffer size in pixels.
|
||||||
uniform ivec2 uFramebufferSize;
|
uniform ivec2 uFramebufferSize;
|
||||||
|
/// The size of the path bounds texture in texels.
|
||||||
uniform ivec2 uPathBoundsDimensions;
|
uniform ivec2 uPathBoundsDimensions;
|
||||||
|
/// The path bounds texture, one rect per path ID.
|
||||||
uniform sampler2D uPathBounds;
|
uniform sampler2D uPathBounds;
|
||||||
|
/// The size of the path transform buffer texture in texels.
|
||||||
uniform ivec2 uPathTransformSTDimensions;
|
uniform ivec2 uPathTransformSTDimensions;
|
||||||
|
/// The path transform buffer texture, one path dilation per texel.
|
||||||
uniform sampler2D uPathTransformST;
|
uniform sampler2D uPathTransformST;
|
||||||
|
/// The size of the extra path transform factors buffer texture in texels.
|
||||||
uniform ivec2 uPathTransformExtDimensions;
|
uniform ivec2 uPathTransformExtDimensions;
|
||||||
|
/// The extra path transform factors buffer texture, packed two path transforms per texel.
|
||||||
uniform sampler2D uPathTransformExt;
|
uniform sampler2D uPathTransformExt;
|
||||||
|
/// The amount of faux-bold to apply, in local path units.
|
||||||
uniform vec2 uEmboldenAmount;
|
uniform vec2 uEmboldenAmount;
|
||||||
|
|
||||||
attribute vec2 aQuadPosition;
|
attribute vec2 aQuadPosition;
|
||||||
|
|
|
@ -30,16 +30,30 @@
|
||||||
|
|
||||||
precision highp float;
|
precision highp float;
|
||||||
|
|
||||||
|
/// A 3D transform to be applied to all points.
|
||||||
uniform mat4 uTransform;
|
uniform mat4 uTransform;
|
||||||
|
/// Vertical snapping positions.
|
||||||
uniform vec4 uHints;
|
uniform vec4 uHints;
|
||||||
|
/// The framebuffer size in pixels.
|
||||||
uniform ivec2 uFramebufferSize;
|
uniform ivec2 uFramebufferSize;
|
||||||
uniform ivec2 uPathTransformSTDimensions;
|
/// The size of the path bounds texture in texels.
|
||||||
uniform sampler2D uPathTransformST;
|
|
||||||
uniform ivec2 uPathTransformExtDimensions;
|
|
||||||
uniform sampler2D uPathTransformExt;
|
|
||||||
uniform ivec2 uPathBoundsDimensions;
|
uniform ivec2 uPathBoundsDimensions;
|
||||||
|
/// The path bounds texture, one rect per path ID.
|
||||||
uniform sampler2D uPathBounds;
|
uniform sampler2D uPathBounds;
|
||||||
|
/// The size of the path transform buffer texture in texels.
|
||||||
|
uniform ivec2 uPathTransformSTDimensions;
|
||||||
|
/// The path transform buffer texture, one path dilation per texel.
|
||||||
|
uniform sampler2D uPathTransformST;
|
||||||
|
/// The size of the extra path transform factors buffer texture in texels.
|
||||||
|
uniform ivec2 uPathTransformExtDimensions;
|
||||||
|
/// The extra path transform factors buffer texture, packed two path transforms per texel.
|
||||||
|
uniform sampler2D uPathTransformExt;
|
||||||
|
/// The amount of faux-bold to apply, in local path units.
|
||||||
uniform vec2 uEmboldenAmount;
|
uniform vec2 uEmboldenAmount;
|
||||||
|
/// The pass index: 0 or 1.
|
||||||
|
///
|
||||||
|
/// This is a multipass algorithm: first, issue a draw call with this value set to 0; then, issue
|
||||||
|
/// an identical draw call with this value set to 1.
|
||||||
uniform int uPassIndex;
|
uniform int uPassIndex;
|
||||||
|
|
||||||
attribute vec2 aQuadPosition;
|
attribute vec2 aQuadPosition;
|
||||||
|
|
|
@ -34,13 +34,23 @@
|
||||||
|
|
||||||
precision highp float;
|
precision highp float;
|
||||||
|
|
||||||
|
/// A dilation (scale and translation) to be applied to the object.
|
||||||
uniform vec4 uTransformST;
|
uniform vec4 uTransformST;
|
||||||
|
/// Vertical snapping positions.
|
||||||
uniform vec4 uHints;
|
uniform vec4 uHints;
|
||||||
|
/// The framebuffer size in pixels.
|
||||||
uniform ivec2 uFramebufferSize;
|
uniform ivec2 uFramebufferSize;
|
||||||
|
/// The size of the path transform buffer texture in texels.
|
||||||
uniform ivec2 uPathTransformSTDimensions;
|
uniform ivec2 uPathTransformSTDimensions;
|
||||||
|
/// The path transform buffer texture, one dilation per path ID.
|
||||||
uniform sampler2D uPathTransformST;
|
uniform sampler2D uPathTransformST;
|
||||||
|
/// The size of the path colors buffer texture in texels.
|
||||||
uniform ivec2 uPathColorsDimensions;
|
uniform ivec2 uPathColorsDimensions;
|
||||||
|
/// The path colors buffer texture, one color per path ID.
|
||||||
uniform sampler2D uPathColors;
|
uniform sampler2D uPathColors;
|
||||||
|
/// True if multiple colors are being rendered; false otherwise.
|
||||||
|
///
|
||||||
|
/// If this is true, then points will be snapped to the nearest pixel.
|
||||||
uniform bool uMulticolor;
|
uniform bool uMulticolor;
|
||||||
|
|
||||||
attribute vec2 aQuadPosition;
|
attribute vec2 aQuadPosition;
|
||||||
|
|
|
@ -12,7 +12,9 @@
|
||||||
|
|
||||||
precision highp float;
|
precision highp float;
|
||||||
|
|
||||||
|
/// A dilation (scale and transform) to be applied to the quad.
|
||||||
uniform vec4 uTransformST;
|
uniform vec4 uTransformST;
|
||||||
|
/// A fixed pair of factors to be applied to the texture coordinates.
|
||||||
uniform vec2 uTexScale;
|
uniform vec2 uTexScale;
|
||||||
|
|
||||||
attribute vec2 aPosition;
|
attribute vec2 aPosition;
|
||||||
|
|
|
@ -14,7 +14,9 @@
|
||||||
|
|
||||||
precision highp float;
|
precision highp float;
|
||||||
|
|
||||||
|
/// A dilation (scale and transform) to be applied to the quad.
|
||||||
uniform vec4 uTransformST;
|
uniform vec4 uTransformST;
|
||||||
|
/// A fixed pair of factors to be applied to the texture coordinates.
|
||||||
uniform vec2 uTexScale;
|
uniform vec2 uTexScale;
|
||||||
|
|
||||||
attribute vec2 aPosition;
|
attribute vec2 aPosition;
|
||||||
|
|
Loading…
Reference in New Issue