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

apply latest ssreflections tweaks to class2 and class3.

parent 9454398c
No related branches found
No related tags found
No related merge requests found
...@@ -298,12 +298,19 @@ void main() ...@@ -298,12 +298,19 @@ 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
ref2d += normalize(ref2d)*14.0*(1.0-spec.a)*(checkerboard-0.5); vec2 checkoffset = normalize(ref2d)*5.0*(1.0-spec.a)*(checkerboard-0.5);
ref2d += 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.
// We average two samples of diffuse (not of anything else) per
// pixel to try to reduce aliasing some more.
// ---------------------
// ^ ^ ^ ^ ^
// a . b o c . d check=0:avg(a,b) check=1:avg(c,d)
vec3 refcol = 0.5 * (texture2DRect(diffuseRect, ref2d).rgb +
texture2DRect(diffuseRect, ref2d + checkoffset*2.0).rgb);
float refdepth = texture2DRect(depthMap, ref2d).a; float refdepth = texture2DRect(depthMap, ref2d).a;
vec3 refpos = getPosition_d(ref2d, refdepth).xyz; vec3 refpos = getPosition_d(ref2d, refdepth).xyz;
vec3 refcol = texture2DRect(diffuseRect, ref2d).rgb;
float refshad = texture2DRect(lightMap, ref2d).r; float refshad = texture2DRect(lightMap, ref2d).r;
vec3 refn = normalize(texture2DRect(normalMap, ref2d).rgb * 2.0 - 1.0); vec3 refn = normalize(texture2DRect(normalMap, ref2d).rgb * 2.0 - 1.0);
// figure out how appropriate our guess actually was // figure out how appropriate our guess actually was
......
...@@ -301,12 +301,19 @@ void main() ...@@ -301,12 +301,19 @@ 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
ref2d += normalize(ref2d)*14.0*(1.0-spec.a)*(checkerboard-0.5); vec2 checkoffset = normalize(ref2d)*5.0*(1.0-spec.a)*(checkerboard-0.5);
ref2d += 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.
// We average two samples of diffuse (not of anything else) per
// pixel to try to reduce aliasing some more.
// ---------------------
// ^ ^ ^ ^ ^
// a . b o c . d check=0:avg(a,b) check=1:avg(c,d)
vec3 refcol = 0.5 * (texture2DRect(diffuseRect, ref2d).rgb +
texture2DRect(diffuseRect, ref2d + checkoffset*2.0).rgb);
float refdepth = texture2DRect(depthMap, ref2d).a; float refdepth = texture2DRect(depthMap, ref2d).a;
vec3 refpos = getPosition_d(ref2d, refdepth).xyz; vec3 refpos = getPosition_d(ref2d, refdepth).xyz;
vec3 refcol = texture2DRect(diffuseRect, ref2d).rgb;
float refshad = texture2DRect(lightMap, ref2d).r; float refshad = texture2DRect(lightMap, ref2d).r;
vec3 refn = normalize(texture2DRect(normalMap, ref2d).rgb * 2.0 - 1.0); vec3 refn = normalize(texture2DRect(normalMap, ref2d).rgb * 2.0 - 1.0);
// figure out how appropriate our guess actually was // figure out how appropriate our guess actually was
......
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