Atmosphere tweaks
This commit is contained in:
@@ -6,7 +6,8 @@ precision lowp int;
|
||||
#define INTEGER int
|
||||
#endif
|
||||
|
||||
#define gradients false
|
||||
//#define GRADIENTS
|
||||
#define step 0.5
|
||||
|
||||
const int MAX_COLORS = 10;
|
||||
|
||||
@@ -16,14 +17,18 @@ uniform vec4 u_colors[MAX_COLORS];
|
||||
varying float v_height;
|
||||
|
||||
void main() {
|
||||
if(gradients){
|
||||
int from = int(v_height * float(u_colornum));
|
||||
int to = int(clamp(float(int(v_height * float(u_colornum) + 1.0)), 0.0, float(u_colornum)-1.0));
|
||||
float alpha = fract(v_height * float(u_colornum));
|
||||
#ifdef GRADIENTS
|
||||
|
||||
gl_FragColor = vec4(mix(u_colors[from], u_colors[to], alpha));
|
||||
}else{
|
||||
int from = int(v_height * float(u_colornum));
|
||||
gl_FragColor = u_colors[from];
|
||||
}
|
||||
int from = int(v_height * float(u_colornum));
|
||||
int to = int(clamp(float(int(v_height * float(u_colornum) + 1.0)), 0.0, float(u_colornum)-1.0));
|
||||
float alpha = fract(v_height * float(u_colornum));
|
||||
alpha = floor(alpha / step) * step;
|
||||
|
||||
gl_FragColor = vec4(mix(u_colors[from], u_colors[to], alpha));
|
||||
|
||||
#else
|
||||
|
||||
gl_FragColor = u_colors[int(v_height * float(u_colornum))];
|
||||
|
||||
#endif
|
||||
}
|
||||
Reference in New Issue
Block a user