From a81c69c34eb4bb64a0b8f6d7623323e011b0d674 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Thu, 28 Dec 2017 11:46:44 -0500 Subject: [PATCH] Document the blit shaders --- shaders/gles2/blit-gamma.fs.glsl | 7 ++++++- shaders/gles2/blit-linear.fs.glsl | 4 +++- shaders/gles2/blit.vs.glsl | 8 +++++--- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/shaders/gles2/blit-gamma.fs.glsl b/shaders/gles2/blit-gamma.fs.glsl index 6562cc8d..edc41910 100644 --- a/shaders/gles2/blit-gamma.fs.glsl +++ b/shaders/gles2/blit-gamma.fs.glsl @@ -8,15 +8,20 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -/// Blits a texture, applying gamma correction. +//! Blits a texture, applying gamma correction. precision mediump float; +/// The source texture to blit. uniform sampler2D uSource; +/// The approximate background color, in linear RGB. uniform vec3 uBGColor; + +/// The gamma LUT. uniform sampler2D uGammaLUT; +/// The incoming texture coordinate. varying vec2 vTexCoord; void main() { diff --git a/shaders/gles2/blit-linear.fs.glsl b/shaders/gles2/blit-linear.fs.glsl index 9693c8e8..69b4aafc 100644 --- a/shaders/gles2/blit-linear.fs.glsl +++ b/shaders/gles2/blit-linear.fs.glsl @@ -8,12 +8,14 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -/// A trivial shader that does nothing more than blit a texture. +//! A trivial shader that does nothing more than blit a texture. precision mediump float; +/// The source texture to blit. uniform sampler2D uSource; +/// The incoming texture coordinate. varying vec2 vTexCoord; void main() { diff --git a/shaders/gles2/blit.vs.glsl b/shaders/gles2/blit.vs.glsl index 55b5d8f0..02b62bec 100644 --- a/shaders/gles2/blit.vs.glsl +++ b/shaders/gles2/blit.vs.glsl @@ -8,21 +8,23 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -/// A trivial shader that does nothing more than blit a texture. +//! A trivial shader that does nothing more than blit a texture. precision mediump float; /// A 3D transform to apply to the scene. uniform mat4 uTransform; -/// A fixed scaling to be applied to the texture coordinates. + +/// 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; -/// The scaled texture coordinate. +/// The outgoing texture coordinate. varying vec2 vTexCoord; void main() {