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

Add fog to level

This commit is contained in:
Miloslav Číž 2019-06-22 04:55:00 +02:00
parent 4cce0d9eda
commit a89f3c192f

View file

@ -116,6 +116,12 @@ void drawPixel(S3L_PixelInfo *p)
sampleTxture(uv[0],uv[1],&r,&g,&b); sampleTxture(uv[0],uv[1],&r,&g,&b);
S3L_Unit fog = (p->depth * 8) / S3L_FRACTIONS_PER_UNIT;
r = S3L_clamp(((S3L_Unit) r) - fog,0,255);
g = S3L_clamp(((S3L_Unit) g) - fog,0,255);
b = S3L_clamp(((S3L_Unit) b) - fog,0,255);
setPixel(p->x,p->y,r,g,b); setPixel(p->x,p->y,r,g,b);
} }