tinyrenderer: disable triangle backface culling (doesn't work well, cull triangles that should be visible)

GLInstancingRenderer: allow to set the light position
This commit is contained in:
Erwin Coumans
2017-04-23 07:35:13 -07:00
parent e8c1602232
commit 4759e5a590
10 changed files with 99 additions and 55 deletions

View File

@@ -426,14 +426,6 @@ static bool clipTriangleAgainstNearplane(const mat<4,3,float>& triangleIn, b3Ali
{
float orientation = (triangleIn[0][1] - triangleIn[0][0]) * (triangleIn[1][2] - triangleIn[1][0])
- (triangleIn[1][1] - triangleIn[1][0]) * (triangleIn[0][2] - triangleIn[0][0]);
if (orientation < 0.0)
{
return true;
}
//discard triangle if all vertices are behind near-plane
if (triangleIn[3][0]<0 && triangleIn[3][1] <0 && triangleIn[3][2] <0)
{