Better AO, fixed cloud pixelation

This commit is contained in:
Joshua Barretto 2020-02-21 10:51:59 +00:00
parent d91d66027a
commit df5aa93fd7
3 changed files with 3 additions and 6 deletions

View File

@ -16,15 +16,12 @@ vec2 cloud_at(vec3 pos) {
float tick_offs = 0.0
+ texture(t_noise, scaled_pos * 0.0005 - time_of_day.x * 0.00002).x * 0.5
+ texture(t_noise, scaled_pos * 0.000015).x * 5.0;
+ texture(t_noise, scaled_pos * 0.0015).x * 0.25;
float value = (
0.0
+ texture(t_noise, scaled_pos * 0.0003 + tick_offs).x
+ texture(t_noise, scaled_pos * 0.0015 - tick_offs * 2.0).x * 0.5
//+ texture(t_noise, scaled_pos * 0.0025 - time_of_day.x * 0.0002).x * 0.25
//+ texture(t_noise, scaled_pos * 0.008 + time_of_day.x * 0.0004).x * 0.15
//+ texture(t_noise, scaled_pos * 0.02 + tick_offs + time_of_day.x * 0.0004).x * 0.2
) / 3.0;
value += (0.0

View File

@ -87,7 +87,7 @@ impl Meshable<SpritePipeline, SpritePipeline> for Segment {
SpriteVertex::new(
origin,
norm,
linear_to_srgb(srgb_to_linear(col) * ao * light),
linear_to_srgb(srgb_to_linear(col) * light.min(ao)),
)
},
&[[[1.0; 3]; 3]; 3],

View File

@ -112,7 +112,7 @@ fn create_quad<P: Pipeline, F: Fn(Vec3<f32>, Vec3<f32>, Rgb<f32>, f32, f32) -> P
let darkness = darkness_ao.map(|e| e.0);
let ao = darkness_ao.map(|e| e.1);
let ao_map = ao;
let ao_map = ao * 0.75 + 0.25;
if ao[0].min(ao[2]).min(darkness[0]).min(darkness[2])
< ao[1].min(ao[3]).min(darkness[1]).min(darkness[3])