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

debug ssreflection blur direction. minor.

parent c5c62b30
No related branches found
No related tags found
No related merge requests found
...@@ -289,7 +289,7 @@ void main() ...@@ -289,7 +289,7 @@ void main()
// //
depth -= 0.5; // unbias depth depth -= 0.5; // unbias depth
// first figure out where we'll make our 2D guess from // first figure out where we'll make our 2D guess from
vec2 ref2d = tc.xy + (0.25 * screen_res.y) * (refnorm.xy) * abs(refnorm.z) / depth; vec2 ref2d = (0.25 * screen_res.y) * (refnorm.xy) * abs(refnorm.z) / depth;
// Offset the guess source a little according to a trivial // Offset the guess source a little according to a trivial
// checkerboard dither function and spec.a. // checkerboard dither function and spec.a.
// This is meant to be similar to sampling a blurred version // This is meant to be similar to sampling a blurred version
...@@ -298,6 +298,7 @@ void main() ...@@ -298,6 +298,7 @@ void main()
// 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); ref2d += normalize(ref2d)*14.0*(1.0-spec.a)*(checkerboard-0.5);
ref2d += tc.xy; // use as offset from destination
// get attributes from the 2D guess point // get attributes from the 2D guess point
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;
......
...@@ -292,7 +292,7 @@ void main() ...@@ -292,7 +292,7 @@ void main()
// //
depth -= 0.5; // unbias depth depth -= 0.5; // unbias depth
// first figure out where we'll make our 2D guess from // first figure out where we'll make our 2D guess from
vec2 ref2d = tc.xy + (0.25 * screen_res.y) * (refnorm.xy) * abs(refnorm.z) / depth; vec2 ref2d = (0.25 * screen_res.y) * (refnorm.xy) * abs(refnorm.z) / depth;
// Offset the guess source a little according to a trivial // Offset the guess source a little according to a trivial
// checkerboard dither function and spec.a. // checkerboard dither function and spec.a.
// This is meant to be similar to sampling a blurred version // This is meant to be similar to sampling a blurred version
...@@ -301,6 +301,7 @@ void main() ...@@ -301,6 +301,7 @@ void main()
// 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); ref2d += normalize(ref2d)*14.0*(1.0-spec.a)*(checkerboard-0.5);
ref2d += tc.xy; // use as offset from destination
// get attributes from the 2D guess point // get attributes from the 2D guess point
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;
......
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