From 2344d2af7eb3e5515408d134a074b989e7b5efde Mon Sep 17 00:00:00 2001 From: Csaba Hruska Date: Sun, 10 Jan 2016 22:58:12 +0100 Subject: update example --- examples/hello.lc | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 examples/hello.lc (limited to 'examples/hello.lc') diff --git a/examples/hello.lc b/examples/hello.lc new file mode 100644 index 0000000..1087fbe --- /dev/null +++ b/examples/hello.lc @@ -0,0 +1,12 @@ +sampler = Sampler PointFilter MirroredRepeat (Texture2DSlot "diffuseTexture") +main = let + emptyFB = FrameBuffer (colorImage1 (V4 0.0 0.0 0.4 1.0)) + rasterCtx = TriangleCtx CullNone PolygonFill NoOffset LastVertex + fragmentCtx = AccumulationContext (ColorOp NoBlending (V4 True True True True)) + vertexShader (p,uv) = VertexOut (V4 p%x p%y (-1) 1) 1.0 () (Smooth uv) + vertexStream = Fetch "objects" Triangles (Attribute "position" :: Vec 2 Float, Attribute "uv" :: Vec 2 Float) + primitiveStream = Transform vertexShader vertexStream + fragmentStream = Rasterize rasterCtx primitiveStream + fragmentShader uv = FragmentOut $ texture2D sampler uv + frame = Accumulate fragmentCtx PassAll fragmentShader fragmentStream emptyFB + in ScreenOut frame -- cgit v1.2.3