Commit 0470ca5b authored by amandaghassaei's avatar amandaghassaei

colors

parent f2753dd5
......@@ -64,21 +64,23 @@
if (val > 1.0) val = 1.0;
if (val < 0.0) val = 0.0;
float numColors = 3.0;
vec3 color = vec3(0.0);
if (val < 0.25) {
val *= 4.0;
if (val <= 1.0/numColors) {
val *= numColors;
color = background*(1.0-val) + material1*val;
} else if (val < 0.5) {
val -= 0.25;
val *= 4.0;
} else if (val <= 2.0/numColors) {
val -= 1.0/numColors;
val *= numColors;
color = material1*(1.0-val) + material2*val;
} else if (val < 0.75) {
val -= 0.50;
val *= 4.0;
} else if (val <= 3.0/numColors) {
val -= 2.0/numColors;
val *= numColors;
color = material2*(1.0-val) + material3*val;
} else {
val -= 0.75;
val *= 4.0;
val -= 3.0/numColors;
val *= numColors;
color = material3*(1.0-val) + material4*val;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment