Fixed glow AO

This commit is contained in:
Joshua Barretto 2020-11-21 16:56:08 +00:00
parent b4e3dbc719
commit bb9e593a44
5 changed files with 15 additions and 4 deletions

View File

@ -181,7 +181,7 @@ void main() {
float ao = f_ao * sqrt(f_ao);//0.25 + f_ao * 0.75; ///*pow(f_ao, 0.5)*/f_ao * 0.85 + 0.15;
vec3 glow = pow(model_light.y, 2) * GLOW_COLOR;
vec3 glow = pow(model_light.y, 3) * 4 * GLOW_COLOR;
emitted_light += glow;
reflected_light *= ao;

View File

@ -90,6 +90,7 @@ vec4 cloud_at(vec3 pos, float dist, out vec3 emission) {
// Prevent clouds and mist appearing underground (but fade them out gently)
float not_underground = clamp(1.0 - (alt_at(pos.xy - focus_off.xy) - (pos.z - focus_off.z)) / 80.0, 0, 1);
air *= not_underground;
float vapor_density = (mist + cloud) * not_underground;
if (emission_strength <= 0.0) {

View File

@ -44,7 +44,7 @@ const float UNDERWATER_MIST_DIST = 100.0;
const float PERSISTENT_AMBIANCE = 1.0 / 32.0;// 1.0 / 80; // 1.0 / 512; // 0.00125 // 0.1;// 0.025; // 0.1;
const vec3 GLOW_COLOR = vec3(1, 0.8, 0.5);
const vec3 GLOW_COLOR = vec3(1, 0.35, 0.05);
//vec3 get_sun_dir(float time_of_day) {
// const float TIME_FACTOR = (PI * 2.0) / (3600.0 * 24.0);

View File

@ -174,7 +174,7 @@ void main() {
reflected_light += point_light; */
// float ao = /*pow(f_ao, 0.5)*/f_ao * 0.85 + 0.15;
vec3 glow = pow(f_inst_light.y, 2) * GLOW_COLOR;
vec3 glow = pow(f_inst_light.y, 3) * 4 * GLOW_COLOR;
emitted_light += glow;
float ao = f_ao;

View File

@ -586,9 +586,19 @@ fn draw_col_lights<D>(
0.0
}
) / 4.0;
let glowiness = (
get_glow(data, light_pos)
+ get_glow(data, light_pos - uv.x)
+ get_glow(data, light_pos - uv.y)
+ if direct_u_opacity || direct_v_opacity {
get_glow(data, light_pos - uv.x - uv.y)
} else {
0.0
}
) / 4.0;
let col = get_color(data, pos);
let light = (darkness * 31.5) as u8;
let glow = (get_glow(data, light_pos) * 31.5) as u8;
let glow = (glowiness * 31.5) as u8;
*col_light = make_col_light(light, glow, col);
});
});