Skip to content
Snippets Groups Projects
Commit a3be9d34 authored by Graham Linden's avatar Graham Linden
Browse files

NORSPEC-360 fix issues with mip selection and TCs in projector fake env reflection

parent d8f700d6
No related branches found
No related tags found
No related merge requests found
...@@ -310,14 +310,11 @@ void main() ...@@ -310,14 +310,11 @@ void main()
vec3 pfinal = pos + ref * dot(pdelta, proj_n)/ds; vec3 pfinal = pos + ref * dot(pdelta, proj_n)/ds;
vec4 stc = (proj_mat * vec4(pfinal.xyz, 1.0)); vec4 stc = (proj_mat * vec4(pfinal.xyz, 1.0));
stc /= stc.w;
if (stc.z > 0.0) if (stc.z > 0.0)
{ {
stc.xy /= stc.w; float fatten = clamp(envIntensity*envIntensity+envIntensity*0.25, 0.25, 1.0);
float fatten = clamp(envIntensity*envIntensity+envIntensity*0.5, 0.25, 1.0);
//stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5);
stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5); stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5);
if (stc.x < 1.0 && if (stc.x < 1.0 &&
...@@ -325,7 +322,7 @@ void main() ...@@ -325,7 +322,7 @@ void main()
stc.x > 0.0 && stc.x > 0.0 &&
stc.y > 0.0) stc.y > 0.0)
{ {
col += color.rgb*texture2DLodSpecular(projectionMap, stc.xy, proj_lod-envIntensity*proj_lod).rgb*spec.rgb; col += color.rgb*texture2DLodSpecular(projectionMap, stc.xy, proj_lod).rgb*spec.rgb;
} }
} }
} }
......
...@@ -333,14 +333,12 @@ void main() ...@@ -333,14 +333,12 @@ void main()
vec3 pfinal = pos + ref * dot(pdelta, proj_n)/ds; vec3 pfinal = pos + ref * dot(pdelta, proj_n)/ds;
vec4 stc = (proj_mat * vec4(pfinal.xyz, 1.0)); vec4 stc = (proj_mat * vec4(pfinal.xyz, 1.0));
stc /= stc.w;
if (stc.z > 0.0) if (stc.z > 0.0)
{ {
stc.xy /= stc.w; float fatten = clamp(envIntensity*envIntensity+envIntensity*0.25, 0.25, 1.0);
float fatten = clamp(envIntensity*envIntensity+envIntensity*0.5, 0.25, 1.0);
//stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5);
stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5); stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5);
if (stc.x < 1.0 && if (stc.x < 1.0 &&
...@@ -348,7 +346,7 @@ void main() ...@@ -348,7 +346,7 @@ void main()
stc.x > 0.0 && stc.x > 0.0 &&
stc.y > 0.0) stc.y > 0.0)
{ {
col += color.rgb*texture2DLodSpecular(projectionMap, stc.xy, proj_lod-envIntensity*proj_lod).rgb*shadow*spec.rgb; col += color.rgb*texture2DLodSpecular(projectionMap, stc.xy, proj_lod).rgb*shadow*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