X-Git-Url: https://git.lukelau.me/?p=clouds.git;a=blobdiff_plain;f=billboardfrag.glsl;h=c2e480bf88a930278ffe6f472f8be86c02b1bddd;hp=16e074e616aae9ea8101b38a11564982e249c894;hb=e4bfe561fba2c32bf5ecdbf6a96067676ab313a2;hpb=92594780db1f9bb51b97e68457c526fa4287a29e diff --git a/billboardfrag.glsl b/billboardfrag.glsl index 16e074e..c2e480b 100644 --- a/billboardfrag.glsl +++ b/billboardfrag.glsl @@ -5,8 +5,13 @@ in vec2 texCoord; out vec4 FragColor; uniform bool modulate; uniform bool debug; +uniform bool debugColor; uniform float debugVal; void main() { + if (debugColor) { + FragColor = color; + return; + } if (debug) { FragColor = mix(vec4(1, 1, 1, 1), vec4(1, 0, 0, 1), debugVal); return; @@ -22,6 +27,9 @@ void main() { // A = Af * At FragColor = color * f; } else { + // "That is, the colors in the frame buffer are multiplied by the + // attenuation ratio of the billboard texture and then the colors in + // the texture are added" // GL_BLEND: // C = Cf * (1-Ct) + Cc * Ct // A = Af * At