Remove tweakz shader
This commit is contained in:
@@ -8,7 +8,6 @@ module Picture.Base (
|
|||||||
blank,
|
blank,
|
||||||
polygon,
|
polygon,
|
||||||
polygonWire,
|
polygonWire,
|
||||||
polygonZ,
|
|
||||||
polygonCol,
|
polygonCol,
|
||||||
poly3,
|
poly3,
|
||||||
poly3Col,
|
poly3Col,
|
||||||
@@ -73,12 +72,6 @@ polygon = map f . polyToTris
|
|||||||
where
|
where
|
||||||
f (V2 x y) = Verx (V3 x y 0) black [] BottomLayer polyNum
|
f (V2 x y) = Verx (V3 x y 0) black [] BottomLayer polyNum
|
||||||
|
|
||||||
polygonZ :: [Point2] -> Float -> Picture
|
|
||||||
{-# INLINE polygonZ #-}
|
|
||||||
polygonZ ps z = map (f . zeroZ) $ polyToTris ps
|
|
||||||
where
|
|
||||||
f pos = Verx pos black [z] BottomLayer polyzNum
|
|
||||||
|
|
||||||
polygonCol :: [(Point2, RGBA)] -> Picture
|
polygonCol :: [(Point2, RGBA)] -> Picture
|
||||||
{-# INLINE polygonCol #-}
|
{-# INLINE polygonCol #-}
|
||||||
polygonCol = polyToTris . map f
|
polygonCol = polyToTris . map f
|
||||||
|
|||||||
+6
-9
@@ -1,5 +1,5 @@
|
|||||||
{-# LANGUAGE DeriveGeneric #-}
|
|
||||||
{-# LANGUAGE DeriveAnyClass #-}
|
{-# LANGUAGE DeriveAnyClass #-}
|
||||||
|
{-# LANGUAGE DeriveGeneric #-}
|
||||||
{-# LANGUAGE StrictData #-}
|
{-# LANGUAGE StrictData #-}
|
||||||
{-# LANGUAGE TemplateHaskell #-}
|
{-# LANGUAGE TemplateHaskell #-}
|
||||||
|
|
||||||
@@ -36,7 +36,6 @@ numLayers = length [minBound :: Layer .. maxBound]
|
|||||||
|
|
||||||
data ShadNum
|
data ShadNum
|
||||||
= PolyShad
|
= PolyShad
|
||||||
| PolyzShad
|
|
||||||
| BezShad
|
| BezShad
|
||||||
| TextShad
|
| TextShad
|
||||||
| ArcShad
|
| ArcShad
|
||||||
@@ -52,19 +51,17 @@ _unShadNum = fromEnum
|
|||||||
toShadNum :: Int -> ShadNum
|
toShadNum :: Int -> ShadNum
|
||||||
toShadNum = toEnum
|
toShadNum = toEnum
|
||||||
|
|
||||||
polyNum, polyzNum, bezNum, textNum, arcNum, ellNum :: ShadNum
|
polyNum, bezNum, textNum, arcNum, ellNum :: ShadNum
|
||||||
{-# INLINE polyNum #-}
|
{-# INLINE polyNum #-}
|
||||||
{-# INLINE polyzNum #-}
|
|
||||||
{-# INLINE bezNum #-}
|
{-# INLINE bezNum #-}
|
||||||
{-# INLINE textNum #-}
|
{-# INLINE textNum #-}
|
||||||
{-# INLINE arcNum #-}
|
{-# INLINE arcNum #-}
|
||||||
{-# INLINE ellNum #-}
|
{-# INLINE ellNum #-}
|
||||||
polyNum = toShadNum 0
|
polyNum = toShadNum 0
|
||||||
polyzNum = toShadNum 1
|
bezNum = toShadNum 1
|
||||||
bezNum = toShadNum 2
|
textNum = toShadNum 2
|
||||||
textNum = toShadNum 3
|
arcNum = toShadNum 3
|
||||||
arcNum = toShadNum 4
|
ellNum = toShadNum 4
|
||||||
ellNum = toShadNum 5
|
|
||||||
|
|
||||||
type Picture = [Verx]
|
type Picture = [Verx]
|
||||||
|
|
||||||
|
|||||||
@@ -133,8 +133,6 @@ preloadRender = do
|
|||||||
makeShader "dualTwoD/character" [vert, frag] [3, 4, 2] pmTriangles
|
makeShader "dualTwoD/character" [vert, frag] [3, 4, 2] pmTriangles
|
||||||
>>= _1 (vaddTextureNoFilter "data/texture/charMap.png")
|
>>= _1 (vaddTextureNoFilter "data/texture/charMap.png")
|
||||||
-- this should really be a 2d texture array
|
-- this should really be a 2d texture array
|
||||||
basicTweakZShad <- makeShader "dualTwoD/basicTweakZ" [vert, frag] [4, 4] pmTriangles
|
|
||||||
-- texture shaders, no textures attached
|
|
||||||
|
|
||||||
screentexturevbo <- mglCreate glCreateBuffers
|
screentexturevbo <- mglCreate glCreateBuffers
|
||||||
withArray (concat cornerList) $ \ptr ->
|
withArray (concat cornerList) $ \ptr ->
|
||||||
@@ -196,12 +194,11 @@ preloadRender = do
|
|||||||
-- reset to default framebuffer, ready for drawing direct to screen
|
-- reset to default framebuffer, ready for drawing direct to screen
|
||||||
glBindFramebuffer GL_FRAMEBUFFER 0
|
glBindFramebuffer GL_FRAMEBUFFER 0
|
||||||
|
|
||||||
shadV <- MV.new 6
|
shadV <- MV.new 5
|
||||||
zipWithM_
|
zipWithM_
|
||||||
(MV.write shadV)
|
(MV.write shadV)
|
||||||
[0 .. 5]
|
[0 .. 4]
|
||||||
[ bslist -- note the ordering is very important
|
[ bslist -- note the ordering is very important
|
||||||
, basicTweakZShad -- ShadNum
|
|
||||||
, bezierQuadShader
|
, bezierQuadShader
|
||||||
, cslist
|
, cslist
|
||||||
, aslist
|
, aslist
|
||||||
|
|||||||
+4
-5
@@ -427,11 +427,10 @@ pokeLayVerx vbos counts vx = do
|
|||||||
pokeStride :: Int -> Int
|
pokeStride :: Int -> Int
|
||||||
{-# INLINE pokeStride #-}
|
{-# INLINE pokeStride #-}
|
||||||
pokeStride 0 = 7
|
pokeStride 0 = 7
|
||||||
pokeStride 1 = 8
|
pokeStride 1 = 11
|
||||||
pokeStride 2 = 11
|
pokeStride 2 = 9
|
||||||
pokeStride 3 = 9
|
pokeStride 3 = 10
|
||||||
pokeStride 4 = 10
|
pokeStride 4 = 7
|
||||||
pokeStride 5 = 7
|
|
||||||
pokeStride _ = undefined
|
pokeStride _ = undefined
|
||||||
|
|
||||||
poke34 :: Ptr Float -> Point3 -> Point4 -> IO ()
|
poke34 :: Ptr Float -> Point3 -> Point4 -> IO ()
|
||||||
|
|||||||
Reference in New Issue
Block a user