summaryrefslogtreecommitdiff
path: root/testdata/bug/checksame01.wip.lc
blob: b88b825631350e875e1ffd4bb54d3b37d9f4aff4 (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,uv) :: (Vec 4 Float,Vec 2 Float)) -> x) -- HERE !!!!
        & accumulateWith (DepthOp Less True, ColorOp NoBlending (V4 True True True True))

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