makeFrame (cam :: Mat 4 4 Float) (skybox :: Texture) (skypoints :: PrimitiveStream Point ((Vec 3 Float))) = imageFrame (emptyDepthImage 1, emptyColorImage (V4 0 0 0.4 1)) `overlay` skypoints & mapPrimitives (\((p)) -> ( cam *. V4 p%x p%y p%z 1, V3 p%x (-p%y) (-p%z) ) ) & rasterizePrimitives (PointCtx (PointSize 1.0) 1.0 -- GL_POINT_FADE_THRESHOLD UpperLeft) -- texture y increases downward ((Smooth)) & mapFragments (\((d)) -> ((texture2D (Sampler PointFilter MirroredRepeat skybox) d%xy ))) & accumulateWith (DepthOp Always True, ColorOp NoBlending (V4 True True True True)) textureCubeSlot s = Texture2DSlot s main = renderFrame $ makeFrame (Uniform "Cam") (textureCubeSlot "Skybox") (fetch "skypoints" ((Attribute "position")))