X-Git-Url: https://git.lukelau.me/?a=blobdiff_plain;f=billboardfrag.glsl;h=c2e480bf88a930278ffe6f472f8be86c02b1bddd;hb=e4bfe561fba2c32bf5ecdbf6a96067676ab313a2;hp=046b7bd3bca6e335cd847e6e6dc4151f4edf03fa;hpb=0258cd283dc666dd89f620179f57343662ab5d1a;p=clouds.git diff --git a/billboardfrag.glsl b/billboardfrag.glsl index 046b7bd..c2e480b 100644 --- a/billboardfrag.glsl +++ b/billboardfrag.glsl @@ -4,11 +4,16 @@ uniform sampler2D tex; in vec2 texCoord; out vec4 FragColor; uniform bool modulate; -uniform bool debugContDist; -uniform float density; +uniform bool debug; +uniform bool debugColor; +uniform float debugVal; void main() { - if (debugContDist) { - FragColor = mix(vec4(1, 1, 1, 1), vec4(1, 0, 0, 1), density); + if (debugColor) { + FragColor = color; + return; + } + if (debug) { + FragColor = mix(vec4(1, 1, 1, 1), vec4(1, 0, 0, 1), debugVal); return; } // Cf = color from fragment, Ct = color from texture @@ -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