summaryrefslogtreecommitdiff
path: root/testdata/parser01.lc
blob: b9b32ea98e286bf5300ae82c28fbb9d694cfc292 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
makeFrame (projmat :: Mat 4 4 Float)
          (vertexstream :: PrimitiveStream Triangle (Vec 4 Float,Vec 2 Float))

          = imageFrame (emptyDepthImage 1, emptyColorImage navy)
  `overlay` fragments
  where
    fragments =
          vertexstream
        & mapPrimitives (\(x,uv) -> (scale 0.5 (projmat *. x), x, uv))
        & rasterizePrimitives (TriangleCtx CullNone PolygonFill NoOffset LastVertex) (Smooth,Smooth)
        & mapFragments (\(x::Vec 4 Float,uv::Vec 2 Float) -> ((x)))
        & accumulateWith (DepthOp Less True, ColorOp NoBlending (V4 True True True True))

main = renderFrame $
   makeFrame (Uniform "MVP")
             (fetch "stream4" (Attribute "position4", Attribute "vertexUV"))