Put rainbows behind experimental

This commit is contained in:
IsseW 2022-03-14 13:01:53 +01:00
parent 86814eba04
commit e37f2be820
2 changed files with 7 additions and 1 deletions

View File

@ -247,11 +247,13 @@ vec3 get_cloud_color(vec3 surf_color, vec3 dir, vec3 origin, const float time_of
int i;
#if (CLOUD_MODE >= CLOUD_MODE_MEDIUM)
#ifdef EXPERIMENTAL_RAINBOWS
// TODO: Make it a double rainbow
float rainbow_t = (0.7 - dot(sun_dir.xyz, dir)) * 8 / 0.05;
int rainbow_c = int(floor(rainbow_t));
rainbow_t = fract(rainbow_t);
#endif
#endif
for (i = 0; cdist > min_dist && i < 250; i ++) {
ldist = cdist;
@ -287,6 +289,7 @@ vec3 get_cloud_color(vec3 surf_color, vec3 dir, vec3 origin, const float time_of
// Rainbow
#if (CLOUD_MODE >= CLOUD_MODE_MEDIUM)
#ifdef EXPERIMENTAL_RAINBOWS
if (rainbow_c >= 0 && rainbow_c < 8) {
float rain = rain_density_at(pos.xy);
vec3 colors[9] = {
@ -307,6 +310,7 @@ vec3 get_cloud_color(vec3 surf_color, vec3 dir, vec3 origin, const float time_of
);
}
#endif
#endif
}
#ifdef IS_POSTPROCESS
}

View File

@ -467,6 +467,8 @@ pub enum ExperimentalShader {
/// Display grid lines to visualize the distribution of shadow map texels
/// for the directional light from the sun.
DirectionalShadowMapTexelGrid,
// Enable rain, unfinished and goes through blocks
/// Enable rain, unfinished and goes through blocks
Rain,
/// Enable rainbows
Rainbows,
}