Technically backface culling should cull polys when the dot product = 0, since when it equals 0 the polys is perpendicular to the camera and thus invisible. When you complete sega rally2 (if you can get that far lol) the champagne is invisible. The reason is because all the face normals are 0. So when multiplied by the model matrix they are still 0 and get culled. Tweaking the condition to only cull polys when greater than 0 fixes this, and allows these 'bad' polys to render as they do on the model3.

This commit is contained in:
Ian Curtis 2019-01-16 01:07:56 +00:00
parent 98106df68b
commit 864bb36b5a
2 changed files with 10 additions and 10 deletions

View file

@ -89,7 +89,7 @@ float area(vec2 a, vec2 b)
void main(void)
{
if(gs_in[0].discardPoly>=0) {
if(gs_in[0].discardPoly > 0) {
return; //emulate back face culling here (all vertices in poly have same value)
}

View file

@ -280,7 +280,7 @@ void main()
vec4 finalData;
vec4 fogData;
if(fsDiscard>=0) {
if(fsDiscard > 0) {
discard; //emulate back face culling here
}