Skip to content
Snippets Groups Projects
Commit 703be164 authored by Geenz's avatar Geenz
Browse files

Code cleanup for BUG-6898

parent 2ffa3875
No related branches found
No related tags found
No related merge requests found
...@@ -311,12 +311,14 @@ void main() ...@@ -311,12 +311,14 @@ 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)
{ {
float fatten = clamp(spec.a*spec.a+spec.a*0.25, 0.25, 1.0); stc /= stc.w;
//float fatten = clamp(spec.a*spec.a+spec.a*0.25, 0.25, 1.0);
stc.xy = (stc.xy - vec2(0.5)) + vec2(0.5); //stc.xy = (stc.xy - vec2(0.25)) * fatten + vec2(0.5);
if (stc.x < 1.0 && if (stc.x < 1.0 &&
stc.y < 1.0 && stc.y < 1.0 &&
......
...@@ -322,12 +322,11 @@ void main() ...@@ -322,12 +322,11 @@ void main()
if (stc.z > 0.0) if (stc.z > 0.0)
{ {
stc.xy /= stc.w; stc /= stc.w;
float fatten = clamp(spec.a*spec.a+spec.a*0.25, 0.25, 1.0); //float fatten = clamp(spec.a*spec.a+spec.a*0.25, 0.25, 1.0);
//stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5); //stc.xy = (stc.xy - vec2(0.25)) * fatten + vec2(0.5);
stc.xy = (stc.xy - vec2(0.5)) + vec2(0.5);
if (stc.x < 1.0 && if (stc.x < 1.0 &&
stc.y < 1.0 && stc.y < 1.0 &&
......
...@@ -334,13 +334,14 @@ void main() ...@@ -334,13 +334,14 @@ 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)
{ {
float fatten = clamp(spec.a*spec.a+spec.a*0.25, 0.25, 1.0); stc /= stc.w;
stc.xy = (stc.xy - vec2(0.5)) + vec2(0.5); //float fatten = clamp(spec.a*spec.a+spec.a*0.25, 0.25, 1.0);
//stc.xy = (stc.xy - vec2(0.25)) * fatten + vec2(0.5);
if (stc.x < 1.0 && if (stc.x < 1.0 &&
stc.y < 1.0 && stc.y < 1.0 &&
...@@ -352,7 +353,6 @@ void main() ...@@ -352,7 +353,6 @@ void main()
} }
} }
} }
//not sure why, but this line prevents MATBUG-194 //not sure why, but this line prevents MATBUG-194
col = max(col, vec3(0.0)); col = max(col, vec3(0.0));
......
...@@ -336,12 +336,11 @@ void main() ...@@ -336,12 +336,11 @@ void main()
if (stc.z > 0.0) if (stc.z > 0.0)
{ {
stc.xy /= stc.w; stc /= stc.w;
float fatten = clamp(spec.a*spec.a+spec.a*0.25, 0.25, 1.0); //float fatten = clamp(spec.a*spec.a+spec.a*0.25, 0.25, 1.0);
//stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5); //stc.xy = (stc.xy - vec2(0.25)) * fatten + vec2(0.5);
stc.xy = (stc.xy - vec2(0.5)) + vec2(0.5);
if (stc.x < 1.0 && if (stc.x < 1.0 &&
stc.y < 1.0 && stc.y < 1.0 &&
......
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