libgarbage: clamp lighting to 0..1
This commit is contained in:
parent
fb2ee82f67
commit
6f07643431
2 changed files with 3 additions and 3 deletions
|
@ -181,7 +181,7 @@ FragOut frag (V2F i) {
|
|||
first_hit = ray.hit_pos;
|
||||
inside_shape = ray.steps == 0;
|
||||
}
|
||||
float3 light = LIGHT_FN(ray);
|
||||
float3 light = clamp(LIGHT_FN(ray), 0, 1);
|
||||
col_acc *= ray.mat.col * lerp(light, 1, ray.mat.gloss);
|
||||
ray_num++;
|
||||
if (ray.missed || ray.mat.gloss < 0.01) {
|
||||
|
@ -291,7 +291,7 @@ float3 default_lighting(Ray ray) {
|
|||
return SKY_FN(ray.dir);
|
||||
float3 light = lSun(ray.normal, sun_dir);
|
||||
light *= lShadow(ray.hit_pos + ray.normal * SURF_DIST, sun_dir, 50);
|
||||
light += lSky(ray.normal);
|
||||
light += lSky(ray.normal);
|
||||
return light;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue