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:
parent
4cce0d9eda
commit
a89f3c192f
1 changed files with 6 additions and 0 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue