mirror of
https://github.com/RetroDECK/Supermodel.git
synced 2024-11-22 22:05:38 +00:00
Fix the sky in harley in first person mode where pixels in the sky are culled when they shouldn't be with the quad renderer. Basically we were running out of precision in a rare corner case. Doing the maths with double precision and casting back to float was enough to fix the issue.
This commit is contained in:
parent
a5858e635d
commit
605dad2c02
|
@ -82,7 +82,7 @@ out GS_OUT
|
||||||
flat vec4 color;
|
flat vec4 color;
|
||||||
} gs_out;
|
} gs_out;
|
||||||
|
|
||||||
float area(vec2 a, vec2 b)
|
double area(dvec2 a, dvec2 b)
|
||||||
{
|
{
|
||||||
return a.x*b.y - a.y*b.x;
|
return a.x*b.y - a.y*b.x;
|
||||||
}
|
}
|
||||||
|
@ -124,13 +124,15 @@ void main(void)
|
||||||
//
|
//
|
||||||
int reorder[4] = int[]( 1, 0, 2, 3 );
|
int reorder[4] = int[]( 1, 0, 2, 3 );
|
||||||
int ii = reorder[i];
|
int ii = reorder[i];
|
||||||
|
dvec2 vector[4];
|
||||||
|
|
||||||
for (j=0; j<4; j++) {
|
for (j=0; j<4; j++) {
|
||||||
gs_out.v[j] = v[j] - v[ii];
|
vector[j] = dvec2(v[j]) - dvec2(v[ii]);
|
||||||
|
gs_out.v[j] = vec2(vector[j]);
|
||||||
}
|
}
|
||||||
for (j=0; j<4; j++) {
|
for (j=0; j<4; j++) {
|
||||||
j_next = (j+1) % 4;
|
j_next = (j+1) % 4;
|
||||||
gs_out.area[j] = area(gs_out.v[j], gs_out.v[j_next]);
|
gs_out.area[j] = float(area(vector[j], vector[j_next]));
|
||||||
}
|
}
|
||||||
|
|
||||||
gl_Position = gl_in[ii].gl_Position;
|
gl_Position = gl_in[ii].gl_Position;
|
||||||
|
@ -276,9 +278,9 @@ void QuadraticInterpolation()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (abs(lambdaSignCount) != 4) {
|
if (lambdaSignCount != 4) {
|
||||||
if(!gl_HelperInvocation) {
|
if(!gl_HelperInvocation) {
|
||||||
discard; // need to revisit this
|
discard;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue