Skip to content

Commit

Permalink
add clamps to fix hud alpha glitch
Browse files Browse the repository at this point in the history
  • Loading branch information
csabahruska committed Jun 6, 2014
1 parent 9ffe589 commit f5d3fc4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hStunts/GameGraphics.hs
Expand Up @@ -146,7 +146,7 @@ stuntsGFX = {-blurVH $ PrjFrameBuffer "blur" tix0 $ -}Accumulate fragCtx (Filter
(_lightViewPos,_colour,pos,_eyePos,_normal,pattern,_zBias,_shiny) = untup8 attr

frag :: Exp F (M44F,V4F,V3F,V3F,V3F,Int32,Float,Float) -> FragmentOut (Depth Float :+: Color V4F :+: ZZ)
frag attr = FragmentOutDepth adjustedDepth (litColour :. ZT)
frag attr = FragmentOutDepth adjustedDepth (clamp' litColour (floatF 0) (floatF 1) :. ZT)
where
l = normalize' (trimV4 (worldView @*. snoc lightDirection 0))
e = normalize' (neg' eyePos)
Expand Down Expand Up @@ -475,7 +475,7 @@ lightProjection nearDepth farDepth fieldOfView aspectRatio worldViewMat =

addHUD fb = renderScreen frag
where
frag uv = FragmentOutRastDepth $ smp :. ZT
frag uv = FragmentOutRastDepth $ clamp' smp (floatF 0) (floatF 1) :. ZT
where
uv' = pack' (V2 u (floatF 1 @- v))
V2 u v = unpack' uv
Expand Down

0 comments on commit f5d3fc4

Please sign in to comment.