libgarbage: clamp lighting to 0..1
This commit is contained in:
parent
fb2ee82f67
commit
6f07643431
2 changed files with 3 additions and 3 deletions
|
@ -1007,7 +1007,7 @@ MonoBehaviour:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
type: 3
|
type: 3
|
||||||
objectId: dfb56a47-2b0b-4814-a4b0-950b5054b182
|
objectId: dfb56a47-2b0b-4814-a4b0-950b5054b182
|
||||||
randomNum: 27659988
|
randomNum: 95618923
|
||||||
unityVersion: 2021.3.41f1
|
unityVersion: 2021.3.41f1
|
||||||
cckVersion: 3.10:132
|
cckVersion: 3.10:132
|
||||||
--- !u!114 &649783671
|
--- !u!114 &649783671
|
||||||
|
|
|
@ -181,7 +181,7 @@ FragOut frag (V2F i) {
|
||||||
first_hit = ray.hit_pos;
|
first_hit = ray.hit_pos;
|
||||||
inside_shape = ray.steps == 0;
|
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);
|
col_acc *= ray.mat.col * lerp(light, 1, ray.mat.gloss);
|
||||||
ray_num++;
|
ray_num++;
|
||||||
if (ray.missed || ray.mat.gloss < 0.01) {
|
if (ray.missed || ray.mat.gloss < 0.01) {
|
||||||
|
@ -291,7 +291,7 @@ float3 default_lighting(Ray ray) {
|
||||||
return SKY_FN(ray.dir);
|
return SKY_FN(ray.dir);
|
||||||
float3 light = lSun(ray.normal, sun_dir);
|
float3 light = lSun(ray.normal, sun_dir);
|
||||||
light *= lShadow(ray.hit_pos + ray.normal * SURF_DIST, sun_dir, 50);
|
light *= lShadow(ray.hit_pos + ray.normal * SURF_DIST, sun_dir, 50);
|
||||||
light += lSky(ray.normal);
|
light += lSky(ray.normal);
|
||||||
return light;
|
return light;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue