Clean up constants in shaders

This commit is contained in:
Lauri Räsänen 2023-11-11 17:13:14 +02:00
parent 09e0feb4ff
commit 8b99a617f4
3 changed files with 7 additions and 6 deletions

View file

@ -113,16 +113,12 @@ fn fs_main(vert: VertexOutput) -> @location(0) vec4<f32> {
}
// ambient
let ambient_strength = 0.02;
let ambient_color = ambient_strength * albedo;
let ambient_color = PBR_AMBIENT * albedo;
var result = ambient_color + total_radiance;
// tonemap
result = result / (result + vec3(1.0));
// gamma correction
// TODO: seems to already be handled by wgpu?
// result = pow(result, vec3(1.0/2.2));
return vec4<f32>(result, object_color.a);
}