1
0
Fork 0
mirror of https://git.coom.tech/drummyfish/small3dlib.git synced 2024-11-21 20:39:57 +01:00

Add persp. corr. depth

This commit is contained in:
Miloslav Číž 2019-05-21 16:27:13 +02:00
parent 0084e48b2c
commit 15df512cc9
2 changed files with 5 additions and 1 deletions

4
s3l.h
View file

@ -1421,6 +1421,10 @@ void _S3L_drawFilledTriangle(
*barycentric1 = *barycentric1 =
S3L_interpolateByUnitFrom0(lT,S3L_FRACTIONS_PER_UNIT - rowT); S3L_interpolateByUnitFrom0(lT,S3L_FRACTIONS_PER_UNIT - rowT);
#if S3L_COMPUTE_DEPTH
p->depth = S3L_interpolateByUnit(lDepth,rDepth,rowT);
#endif
#else #else
*barycentric0 = S3L_getFastLerpValue(b0FLS); *barycentric0 = S3L_getFastLerpValue(b0FLS);
*barycentric1 = S3L_getFastLerpValue(b1FLS); *barycentric1 = S3L_getFastLerpValue(b1FLS);

View file

@ -13,7 +13,7 @@
#define S3L_RESOLUTION_Y 480 #define S3L_RESOLUTION_Y 480
#define S3L_COMPUTE_DEPTH 1 #define S3L_COMPUTE_DEPTH 1
#define S3L_PERSPECTIVE_CORRECTION 0 #define S3L_PERSPECTIVE_CORRECTION 1
#include "s3l.h" #include "s3l.h"