projects
/
clouds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Some typo fixes
[clouds.git]
/
billboardfrag.glsl
diff --git
a/billboardfrag.glsl
b/billboardfrag.glsl
index 16e074e616aae9ea8101b38a11564982e249c894..b4cfd511464569ea23c577cda41a5b261c7ba288 100644
(file)
--- a/
billboardfrag.glsl
+++ b/
billboardfrag.glsl
@@
-5,10
+5,15
@@
in vec2 texCoord;
out vec4 FragColor;
uniform bool modulate;
uniform bool debug;
out vec4 FragColor;
uniform bool modulate;
uniform bool debug;
+uniform bool debugColor;
uniform float debugVal;
void main() {
uniform float debugVal;
void main() {
+ if (debugColor) {
+ FragColor = color;
+ return;
+ }
if (debug) {
if (debug) {
- FragColor = mix(vec4(1, 1, 1,
1
), vec4(1, 0, 0, 1), debugVal);
+ FragColor = mix(vec4(1, 1, 1,
0
), vec4(1, 0, 0, 1), debugVal);
return;
}
// Cf = color from fragment, Ct = color from texture
return;
}
// Cf = color from fragment, Ct = color from texture
@@
-20,8
+25,13
@@
void main() {
// GL_MODULATE: C
// C = Cf * Ct
// A = Af * At
// GL_MODULATE: C
// C = Cf * Ct
// A = Af * At
- FragColor = color * f;
+ // the +0.06 is a hack to get lighter clouds!
+ // can be thought of as ambient light
+ FragColor = color * (f + 0.02);
} else {
} 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
// GL_BLEND:
// C = Cf * (1-Ct) + Cc * Ct
// A = Af * At