TinyRenderer: discard pixels beyond farplane

pybullet: printf build date/time
This commit is contained in:
Erwin Coumans
2017-05-25 17:25:14 -07:00
parent dcdb3d40ba
commit 2b9c67b07c
4 changed files with 12 additions and 3 deletions

View File

@@ -180,6 +180,9 @@ void triangle(mat<4,3,float> &clipc, IShader &shader, TGAImage &image, float *zb
zbuffer[P.x+P.y*image.get_width()]>frag_depth)
continue;
bool discard = shader.fragment(bc_clip, color);
if (frag_depth<-shader.m_farPlane)
discard=true;
if (!discard) {
zbuffer[P.x+P.y*image.get_width()] = frag_depth;
if (segmentationMaskBuffer)