Tweaking shaders a bit.

This commit is contained in:
Joshua Yanovski 2020-08-20 08:31:13 +02:00
parent 7d19259078
commit 561e25778a
2 changed files with 4 additions and 4 deletions

View File

@ -173,7 +173,7 @@ void main() {
// vec3 cam_to_frag = normalize(f_pos - cam_pos.xyz); // vec3 cam_to_frag = normalize(f_pos - cam_pos.xyz);
// Squared to account for prior saturation. // Squared to account for prior saturation.
float f_light = 1.0;// pow(f_light, 1.5); float f_light = 1.0;// pow(f_light, 1.5);
vec3 reflect_color = get_sky_color(/*reflect_ray_dir*/beam_view_dir, time_of_day.x, f_pos, vec3(-100000), 0.25, false, _clouds) * f_light; vec3 reflect_color = get_sky_color(/*reflect_ray_dir*/beam_view_dir, time_of_day.x, f_pos, vec3(-100000), 0.25, true, _clouds) * f_light;
// /*const */vec3 water_color = srgb_to_linear(vec3(0.2, 0.5, 1.0)); // /*const */vec3 water_color = srgb_to_linear(vec3(0.2, 0.5, 1.0));
// /*const */vec3 water_color = srgb_to_linear(vec3(0.8, 0.9, 1.0)); // /*const */vec3 water_color = srgb_to_linear(vec3(0.8, 0.9, 1.0));
// NOTE: Linear RGB, attenuation coefficients for water at roughly R, G, B wavelengths. // NOTE: Linear RGB, attenuation coefficients for water at roughly R, G, B wavelengths.
@ -309,7 +309,7 @@ void main() {
// float log_cam = log(min(cam_attenuation.r, min(cam_attenuation.g, cam_attenuation.b))); // float log_cam = log(min(cam_attenuation.r, min(cam_attenuation.g, cam_attenuation.b)));
float min_refl = min(emitted_light.r, min(emitted_light.g, emitted_light.b)); float min_refl = min(emitted_light.r, min(emitted_light.g, emitted_light.b));
vec4 color = vec4(surf_color, passthrough * 1.0 / (1.0 + min_refl));// * (1.0 - /*log(1.0 + cam_attenuation)*//*cam_attenuation*/1.0 / (2.0 - log_cam))); vec4 color = vec4(surf_color, (1.0 - passthrough) * 1.0 / (1.0 + min_refl));// * (1.0 - /*log(1.0 + cam_attenuation)*//*cam_attenuation*/1.0 / (2.0 - log_cam)));
// vec4 color = vec4(surf_color, mix(1.0, 1.0 / (1.0 + /*0.25 * *//*diffuse_light*/(/*f_light * point_shadow*/reflected_light_point)), passthrough)); // vec4 color = vec4(surf_color, mix(1.0, 1.0 / (1.0 + /*0.25 * *//*diffuse_light*/(/*f_light * point_shadow*/reflected_light_point)), passthrough));
// vec4 color = vec4(surf_color, mix(1.0, length(cam_attenuation), passthrough)); // vec4 color = vec4(surf_color, mix(1.0, length(cam_attenuation), passthrough));

View File

@ -41,7 +41,7 @@ const float SUN_COLOR_FACTOR = 5.0;//6.0;// * 1.5;//1.8;
const float UNDERWATER_MIST_DIST = 100.0; const float UNDERWATER_MIST_DIST = 100.0;
const float PERSISTENT_AMBIANCE = 1.0 / 80.0;// 1.0 / 512; // 0.00125 // 0.1;// 0.025; // 0.1; const float PERSISTENT_AMBIANCE = 1.0 / 32.0;// 1.0 / 80; // 1.0 / 512; // 0.00125 // 0.1;// 0.025; // 0.1;
//vec3 get_sun_dir(float time_of_day) { //vec3 get_sun_dir(float time_of_day) {
// const float TIME_FACTOR = (PI * 2.0) / (3600.0 * 24.0); // const float TIME_FACTOR = (PI * 2.0) / (3600.0 * 24.0);
@ -308,7 +308,7 @@ float get_sun_diffuse2(DirectionalLight sun_info, DirectionalLight moon_info, ve
// float ambient_sides = clamp(mix(0.5, 0.0, abs(dot(-norm, sun_dir)) * mix(0.0, 1.0, abs(sun_dir.z) * 10000.0) * 10000.0), 0.0, 0.5); // float ambient_sides = clamp(mix(0.5, 0.0, abs(dot(-norm, sun_dir)) * mix(0.0, 1.0, abs(sun_dir.z) * 10000.0) * 10000.0), 0.0, 0.5);
// float ambient_sides = clamp(mix(0.5, 0.0, abs(dot(-norm, sun_dir)) * mix(0.0, 1.0, abs(sun_dir.z) * 10000.0) * 10000.0), 0.0, 0.5); // float ambient_sides = clamp(mix(0.5, 0.0, abs(dot(-norm, sun_dir)) * mix(0.0, 1.0, abs(sun_dir.z) * 10000.0) * 10000.0), 0.0, 0.5);
emitted_light = light_frac + k_a * PERSISTENT_AMBIANCE; emitted_light = light_frac + k_a * PERSISTENT_AMBIANCE * MU_SCATTER;
// emitted_light = k_a * light_frac * (/*ambient_sides + */SUN_AMBIANCE * /*sun_light*/sun_chroma + /*vec3(moon_light)*/MOON_AMBIANCE * moon_chroma) + PERSISTENT_AMBIANCE; // emitted_light = k_a * light_frac * (/*ambient_sides + */SUN_AMBIANCE * /*sun_light*/sun_chroma + /*vec3(moon_light)*/MOON_AMBIANCE * moon_chroma) + PERSISTENT_AMBIANCE;
reflected_light = R_t_r * ( reflected_light = R_t_r * (