diff --git a/s3l.h b/s3l.h index dedbc45..ba0eb87 100644 --- a/s3l.h +++ b/s3l.h @@ -1421,6 +1421,10 @@ void _S3L_drawFilledTriangle( *barycentric1 = S3L_interpolateByUnitFrom0(lT,S3L_FRACTIONS_PER_UNIT - rowT); + + #if S3L_COMPUTE_DEPTH + p->depth = S3L_interpolateByUnit(lDepth,rDepth,rowT); + #endif #else *barycentric0 = S3L_getFastLerpValue(b0FLS); *barycentric1 = S3L_getFastLerpValue(b1FLS); diff --git a/testSDL.c b/testSDL.c index dde4d92..78857cd 100644 --- a/testSDL.c +++ b/testSDL.c @@ -13,7 +13,7 @@ #define S3L_RESOLUTION_Y 480 #define S3L_COMPUTE_DEPTH 1 -#define S3L_PERSPECTIVE_CORRECTION 0 +#define S3L_PERSPECTIVE_CORRECTION 1 #include "s3l.h"