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

ssreflections: perspective reflection for sunlight, planar reflection for ssreflection

parent 145ffe0d
No related branches found
No related tags found
No related merge requests found
...@@ -282,13 +282,13 @@ void main() ...@@ -282,13 +282,13 @@ void main()
{ {
// the old infinite-sky shiny reflection // the old infinite-sky shiny reflection
// //
vec3 refnorm = normalize(reflect(vec3(0,0,-1), norm.xyz)); vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz));
//vec3 refnorm = normalize(reflect(pos.xyz, norm.xyz)); float sa = dot(refnormpersp, vary_light.xyz);
float sa = dot(refnorm, vary_light.xyz);
vec3 dumbshiny = vary_SunlitColor*scol_ambocc.r*texture2D(lightFunc, vec2(sa, spec.a)).a; vec3 dumbshiny = vary_SunlitColor*scol_ambocc.r*texture2D(lightFunc, vec2(sa, spec.a)).a;
// screen-space cheap fakey reflection map // screen-space cheap fakey reflection map
// //
vec3 refnorm = normalize(reflect(vec3(0,0,-1), norm.xyz));
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 = (0.25 * screen_res.y) * (refnorm.xy) * abs(refnorm.z) / depth; vec2 ref2d = (0.25 * screen_res.y) * (refnorm.xy) * abs(refnorm.z) / depth;
......
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