makeFrame (time :: Float) (texture :: Texture) (prims :: Stream (Primitive Triangle (Vec 2 Float, Vec 2 Float))) = imageFrame (emptyColorImage (V4 0 0 0.4 1)) `overlay` prims & mapPrimitives (\(p,uv) -> (rotMatrixZ time *. (V4 p%x p%y (-1) 1), uv)) & rasterizePrimitives (TriangleCtx CullNone PolygonFill NoOffset LastVertex) Smooth & mapFragments (\uv -> texture2D (Sampler PointFilter MirroredRepeat texture) uv) & accumulateWith (ColorOp NoBlending (V4 True True True True)) main = renderFrame $ makeFrame (Uniform "time") (Texture2DSlot "diffuseTexture") (fetch_ "objects" (Attribute "position", Attribute "uv"))