1
0
Fork 0
mirror of https://git.coom.tech/drummyfish/small3dlib.git synced 2024-11-21 20:39:57 +01:00
This commit is contained in:
Miloslav Číž 2019-06-14 04:19:38 +02:00
parent ca4e42c511
commit 0587870c0f
2 changed files with 10 additions and 2 deletions

View file

@ -3,7 +3,7 @@
#define S3L_PIXEL_FUNCTION drawPixel #define S3L_PIXEL_FUNCTION drawPixel
#define S3L_PERSPECTIVE_CORRECTION 0 #define S3L_PERSPECTIVE_CORRECTION 1
#define S3L_SORT 0 #define S3L_SORT 0
#define S3L_Z_BUFFER 1 #define S3L_Z_BUFFER 1
@ -135,9 +135,15 @@ void drawPixel(S3L_PixelInfo *p)
color[2] = light / 2 + p->modelIndex * 127; color[2] = light / 2 + p->modelIndex * 127;
} }
/*
color[0] = S3L_clamp(127 + normal.x / 4,0,255); color[0] = S3L_clamp(127 + normal.x / 4,0,255);
color[1] = S3L_clamp(127 + normal.y / 4,0,255); color[1] = S3L_clamp(127 + normal.y / 4,0,255);
color[2] = S3L_clamp(127 + normal.z / 4,0,255); color[2] = S3L_clamp(127 + normal.z / 4,0,255);
*/
color[0] = S3L_clamp(p->depth - 8000,0,255);
color[1] = color[0];
color[2] = color[1];
frameBuffer[index] = color[0]; frameBuffer[index] = color[0];
frameBuffer[index + 1] = color[1]; frameBuffer[index + 1] = color[1];
@ -240,7 +246,7 @@ int main()
GRID_TRIANGLES, GRID_TRIANGLES,
&(models[MODELS - 1])); &(models[MODELS - 1]));
S3L_initScene(models,/*MODELS*/1,&scene); S3L_initScene(models,MODELS,&scene);
animateWater(0); animateWater(0);

View file

@ -77,6 +77,8 @@ bugs:
- b0 + b1 can be > 511, which causes b2 (= 511 - b0 - b1) to be negative! - b0 + b1 can be > 511, which causes b2 (= 511 - b0 - b1) to be negative!
- Depth artifacts with PC != 0, can be seen very well in the HQ offline demo. - Depth artifacts with PC != 0, can be seen very well in the HQ offline demo.
This appear at bigger depths, which makes the reciprocal values more
imprecise.
repeated: repeated: