makeFrame (time :: Float) (vertexstream :: PrimitiveStream Triangle (Vec 4 Float,Vec 2 Float)) = imageFrame (emptyDepthImage 1, emptyColorImage navy) `overlay` fragments where projmat = perspective 0.1 100.0 (30 * pi / 180) 1.0 .*. lookat (V3 3.0 1.3 0.3) (V3 0.0 0.0 0.0) (V3 0.0 1.0 0.0) .*. rotMatrixY (pi / 24.0 * time) sampler = Sampler LinearFilter MirroredRepeat $ Texture2DSlot "Diffuse" fragments = vertexstream & mapPrimitives (\(x,uv) -> (scale 0.5 (projmat *. x), uv)) & rasterizePrimitives (TriangleCtx CullNone PolygonFill NoOffset LastVertex) ((Smooth)) & mapFragments (\((x)) -> ((texture2D sampler x))) & accumulateWith (DepthOp Less True, ColorOp NoBlending (V4 True True True True)) main = renderFrame $ makeFrame (Uniform "Time") (fetch "stream4" (Attribute "position4", Attribute "vertexUV"))