Bad fake lighting in caves

This commit is contained in:
Joshua Barretto 2022-02-09 13:28:07 +00:00
parent 8888190eb4
commit 0facac68b4
5 changed files with 10 additions and 4 deletions

View File

@ -97,7 +97,7 @@ void main() {
vec3 f_col = greedy_extract_col_light_attr(t_col_light, s_col_light, f_uv_pos, f_ao, f_glow, material);
#ifdef EXPERIMENTAL_BAREMINIMUM
tgt_color = vec4(f_col * f_ao, 1);
tgt_color = vec4(simple_lighting(f_pos.xyz, f_col, f_ao), 1);
return;
#endif

View File

@ -689,4 +689,10 @@ vec3 illuminate(float max_light, vec3 view_dir, /*vec3 max_light, */vec3 emitted
// return /*srgb_to_linear*/(/*0.5*//*0.125 * */vec3(pow(color.x, gamma), pow(color.y, gamma), pow(color.z, gamma)));
}
vec3 simple_lighting(vec3 pos, vec3 col, float shade) {
// Bad fake lantern so we can see in caves
vec3 d = pos.xyz - focus_pos.xyz;
return col * clamp(2.5 / dot(d, d), shade * get_sun_brightness(), 1);
}
#endif

View File

@ -47,7 +47,7 @@ void main() {
// vec3 view_dir = normalize(-vec3(vert_pos4)/* / vert_pos4.w*/);
#ifdef EXPERIMENTAL_BAREMINIMUM
tgt_color = vec4(lod_col(f_pos.xy), 1);
tgt_color = vec4(lod_col(f_pos.xy) * get_sun_brightness(), 1);
return;
#endif

View File

@ -44,7 +44,7 @@ void main() {
vec3 f_col = greedy_extract_col_light_glow(t_col_light, s_col_light, f_uv_pos, f_ao, f_glow);
#ifdef EXPERIMENTAL_BAREMINIMUM
tgt_color = vec4(f_col * f_ao, 1);
tgt_color = vec4(simple_lighting(f_pos.xyz, f_col, f_ao), 1);
return;
#endif

View File

@ -88,7 +88,7 @@ void main() {
vec3 f_col = greedy_extract_col_light_glow(t_col_light, s_col_light, f_uv_pos, f_light, f_glow);
#ifdef EXPERIMENTAL_BAREMINIMUM
tgt_color = vec4(f_col * f_light, 1);
tgt_color = vec4(simple_lighting(f_pos.xyz, f_col, f_light), 1);
return;
#endif