Skip to content
Snippets Groups Projects
Commit 12e0a745 authored by Tofu Linden's avatar Tofu Linden
Browse files

ssreflections: dampen/blur ssreflections rather more.

parent 8496f267
No related branches found
No related tags found
No related merge requests found
...@@ -299,7 +299,7 @@ void main() ...@@ -299,7 +299,7 @@ void main()
// The goal of the blur is to soften reflections in surfaces // The goal of the blur is to soften reflections in surfaces
// with low shinyness, and also to disguise our lameness. // with low shinyness, and also to disguise our lameness.
float checkerboard = floor(mod(tc.x+tc.y, 2.0)); // 0.0, 1.0 float checkerboard = floor(mod(tc.x+tc.y, 2.0)); // 0.0, 1.0
float checkoffset = 1.0 + (7.0*(1.0-spec.a))*(checkerboard-0.5); float checkoffset = (3.0 + (7.0*(1.0-spec.a)))*(checkerboard-0.5);
ref2d += vec2(checkoffset, checkoffset); ref2d += vec2(checkoffset, checkoffset);
ref2d += tc.xy; // use as offset from destination ref2d += tc.xy; // use as offset from destination
// Get attributes from the 2D guess point. // Get attributes from the 2D guess point.
...@@ -324,6 +324,7 @@ void main() ...@@ -324,6 +324,7 @@ void main()
float refmod = min(refapprop, reflit); float refmod = min(refapprop, reflit);
vec3 refprod = vary_SunlitColor * refcol.rgb * refmod; vec3 refprod = vary_SunlitColor * refcol.rgb * refmod;
vec3 ssshiny = (refprod * spec.a); vec3 ssshiny = (refprod * spec.a);
ssshiny *= 0.3; // dampen it even more
// add the two types of shiny together // add the two types of shiny together
col += (ssshiny + dumbshiny) * spec.rgb; col += (ssshiny + dumbshiny) * spec.rgb;
......
...@@ -298,7 +298,7 @@ void main() ...@@ -298,7 +298,7 @@ void main()
// The goal of the blur is to soften reflections in surfaces // The goal of the blur is to soften reflections in surfaces
// with low shinyness, and also to disguise our lameness. // with low shinyness, and also to disguise our lameness.
float checkerboard = floor(mod(tc.x+tc.y, 2.0)); // 0.0, 1.0 float checkerboard = floor(mod(tc.x+tc.y, 2.0)); // 0.0, 1.0
float checkoffset = 1.0 + (7.0*(1.0-spec.a))*(checkerboard-0.5); float checkoffset = (3.0 + (7.0*(1.0-spec.a)))*(checkerboard-0.5);
ref2d += vec2(checkoffset, checkoffset); ref2d += vec2(checkoffset, checkoffset);
ref2d += tc.xy; // use as offset from destination ref2d += tc.xy; // use as offset from destination
// Get attributes from the 2D guess point. // Get attributes from the 2D guess point.
...@@ -324,6 +324,7 @@ void main() ...@@ -324,6 +324,7 @@ void main()
float refmod = min(refapprop, reflit); float refmod = min(refapprop, reflit);
vec3 refprod = vary_SunlitColor * refcol.rgb * refmod; vec3 refprod = vary_SunlitColor * refcol.rgb * refmod;
vec3 ssshiny = (refprod * spec.a); vec3 ssshiny = (refprod * spec.a);
ssshiny *= 0.3; // dampen it even more
// add the two types of shiny together // add the two types of shiny together
col += (ssshiny + dumbshiny) * spec.rgb; col += (ssshiny + dumbshiny) * spec.rgb;
......
...@@ -301,7 +301,8 @@ void main() ...@@ -301,7 +301,8 @@ void main()
// The goal of the blur is to soften reflections in surfaces // The goal of the blur is to soften reflections in surfaces
// with low shinyness, and also to disguise our lameness. // with low shinyness, and also to disguise our lameness.
float checkerboard = floor(mod(tc.x+tc.y, 2.0)); // 0.0, 1.0 float checkerboard = floor(mod(tc.x+tc.y, 2.0)); // 0.0, 1.0
float checkoffset = 1.0 + (7.0*(1.0-spec.a))*(checkerboard-0.5); float checkoffset = (3.0 + (7.0*(1.0-spec.a)))*(checkerboard-0.5);
ref2d += vec2(checkoffset, checkoffset); ref2d += vec2(checkoffset, checkoffset);
ref2d += tc.xy; // use as offset from destination ref2d += tc.xy; // use as offset from destination
// Get attributes from the 2D guess point. // Get attributes from the 2D guess point.
...@@ -327,6 +328,7 @@ void main() ...@@ -327,6 +328,7 @@ void main()
float refmod = min(refapprop, reflit); float refmod = min(refapprop, reflit);
vec3 refprod = vary_SunlitColor * refcol.rgb * refmod; vec3 refprod = vary_SunlitColor * refcol.rgb * refmod;
vec3 ssshiny = (refprod * spec.a); vec3 ssshiny = (refprod * spec.a);
ssshiny *= 0.3; // dampen it even more
// add the two types of shiny together // add the two types of shiny together
col += (ssshiny + dumbshiny) * spec.rgb; col += (ssshiny + dumbshiny) * spec.rgb;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment