Document most uniforms in shaders

This commit is contained in:
Patrick Walton 2018-01-04 17:32:20 -08:00
parent aa7e0df514
commit 67d29803b5
11 changed files with 81 additions and 12 deletions

View File

@ -14,13 +14,11 @@ precision mediump float;
/// A 3D transform to apply to the scene.
uniform mat4 uTransform;
/// A pair of fixed scale factors to be applied to the texture coordinates.
uniform vec2 uTexScale;
/// The 2D vertex position.
attribute vec2 aPosition;
/// The texture coordinate.
attribute vec2 aTexCoord;

View File

@ -12,8 +12,11 @@
precision highp float;
/// A concatenated transform to be applied to each point.
uniform mat4 uTransform;
/// The texture coordinates for this glyph.
uniform vec4 uGlyphTexCoords;
/// The size of the glyph in local coordinates.
uniform vec2 uGlyphSize;
attribute vec2 aQuadPosition;

View File

@ -12,7 +12,9 @@
precision mediump float;
/// The 3D projection matrix.
uniform mat4 uProjection;
/// The 3D modelview matrix.
uniform mat4 uModelview;
attribute vec3 aPosition;

View File

@ -21,15 +21,24 @@
precision highp float;
/// A 3D transform to be applied to all points.
uniform mat4 uTransform;
/// Vertical snapping positions.
uniform vec4 uHints;
uniform vec2 uEmboldenAmount;
/// The size of the path colors texture in texels.
uniform ivec2 uPathColorsDimensions;
/// The fill color for each path.
uniform sampler2D uPathColors;
/// 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;
attribute vec2 aPosition;
attribute vec2 aTexCoord;

View File

@ -16,15 +16,24 @@
precision highp float;
/// A 3D transform to be applied to all points.
uniform mat4 uTransform;
/// Vertical snapping positions.
uniform vec4 uHints;
uniform vec2 uEmboldenAmount;
/// The size of the path colors texture in texels.
uniform ivec2 uPathColorsDimensions;
/// The fill color for each path.
uniform sampler2D uPathColors;
/// 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;
attribute vec2 aPosition;
attribute float aPathID;

View File

@ -26,15 +26,25 @@
precision highp float;
/// A 3D transform to be applied to the object.
uniform mat4 uTransform;
/// Vertical snapping positions.
uniform vec4 uHints;
/// The framebuffer size in pixels.
uniform ivec2 uFramebufferSize;
uniform ivec2 uPathTransformSTDimensions;
uniform sampler2D uPathTransformST;
uniform ivec2 uPathTransformExtDimensions;
uniform sampler2D uPathTransformExt;
/// The size of the path bounds texture in texels.
uniform ivec2 uPathBoundsDimensions;
/// The path bounds texture, one rect per path ID.
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;
attribute vec2 aQuadPosition;

View File

@ -24,15 +24,25 @@
precision highp float;
/// A 3D transform to be applied to the object.
uniform mat4 uTransform;
/// Vertical snapping positions.
uniform vec4 uHints;
/// The framebuffer size in pixels.
uniform ivec2 uFramebufferSize;
/// The size of the path bounds texture in texels.
uniform ivec2 uPathBoundsDimensions;
/// The path bounds texture, one rect per path ID.
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;
attribute vec2 aQuadPosition;

View File

@ -30,16 +30,30 @@
precision highp float;
/// A 3D transform to be applied to all points.
uniform mat4 uTransform;
/// Vertical snapping positions.
uniform vec4 uHints;
/// The framebuffer size in pixels.
uniform ivec2 uFramebufferSize;
uniform ivec2 uPathTransformSTDimensions;
uniform sampler2D uPathTransformST;
uniform ivec2 uPathTransformExtDimensions;
uniform sampler2D uPathTransformExt;
/// The size of the path bounds texture in texels.
uniform ivec2 uPathBoundsDimensions;
/// The path bounds texture, one rect per path ID.
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;
/// 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;
attribute vec2 aQuadPosition;

View File

@ -34,13 +34,23 @@
precision highp float;
/// A dilation (scale and translation) to be applied to the object.
uniform vec4 uTransformST;
/// Vertical snapping positions.
uniform vec4 uHints;
/// The framebuffer size in pixels.
uniform ivec2 uFramebufferSize;
/// The size of the path transform buffer texture in texels.
uniform ivec2 uPathTransformSTDimensions;
/// The path transform buffer texture, one dilation per path ID.
uniform sampler2D uPathTransformST;
/// The size of the path colors buffer texture in texels.
uniform ivec2 uPathColorsDimensions;
/// The path colors buffer texture, one color per path ID.
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;
attribute vec2 aQuadPosition;

View File

@ -12,7 +12,9 @@
precision highp float;
/// A dilation (scale and transform) to be applied to the quad.
uniform vec4 uTransformST;
/// A fixed pair of factors to be applied to the texture coordinates.
uniform vec2 uTexScale;
attribute vec2 aPosition;

View File

@ -14,7 +14,9 @@
precision highp float;
/// A dilation (scale and transform) to be applied to the quad.
uniform vec4 uTransformST;
/// A fixed pair of factors to be applied to the texture coordinates.
uniform vec2 uTexScale;
attribute vec2 aPosition;