{-# LANGUAGE OverloadedLists #-} module SavedPipeline where import LambdaCube.IR import LambdaCube.Linear import Data.Vector (Vector) import Data.Map (Map) import GHC.Exts savedPipeline :: Pipeline savedPipeline = Pipeline { info = "Generated by lambdacube-compiler 0.6.1.0, edited to support TextureCube." , backend = OpenGL33 , textures = [] , samplers = [] , targets = [ RenderTarget { renderTargets = [ TargetItem { targetSemantic = Depth , targetRef = Just (Framebuffer Depth) } , TargetItem { targetSemantic = Color , targetRef = Just (Framebuffer Color) } ] } ] , programs = [ Program { programUniforms = fromList [ ( "ViewProjection" , M44F ) ] , programStreams = fromList [ ( "vi1" , Parameter { name = "position" , ty = V4F } ) ] , programInTextures = fromList [] , programOutput = [ Parameter { name = "f0" , ty = V4F } ] , vertexShader = "#version 330 core\nvec4 texture2D(sampler2D s,vec2 uv) {\n return texture(s,uv);\n}\nuniform mat4 ViewProjection;\nin vec4 vi1;\nsmooth out vec2 vo1;\nvec4 coordmap(mat4 z0,vec4 z1) {\n return (z0) * (z1);\n}\nvoid main() {\n gl_Position = coordmap (ViewProjection,vi1);\n vo1 = (vi1).xz;\n}" , geometryShader = Nothing , fragmentShader = "#version 330 core\nvec4 texture2D(sampler2D s,vec2 uv) {\n return texture(s,uv);\n}\nsmooth in vec2 vo1;\nout vec4 f0;\nvoid main() {\n f0 = ((vec4 (1.0,1.0,1.0,0.0)) * (max ((mix (vec2 (0.0,0.0)\n ,vec2 (1.0,1.0)\n ,greaterThanEqual (fract (vo1),(vec2 (1.0,1.0)) * (0.95)))).x\n ,(mix (vec2 (0.0,0.0)\n ,vec2 (1.0,1.0)\n ,greaterThanEqual (fract (vo1),(vec2 (1.0,1.0)) * (0.95)))).y))) + (vec4 (0.0\n ,0.0\n ,0.0\n ,0.8));\n}" } , Program { programUniforms = fromList [ ( "ViewProjection" , M44F ) , ( "diffuseColor" , V4F ) , ( "diffuseTexture" , FTexture2D ) ] , programStreams = fromList [ ( "vi1" , Parameter { name = "position" , ty = V4F } ) , ( "vi2" , Parameter { name = "normal" , ty = V3F } ) , ( "vi3" , Parameter { name = "uvw" , ty = V3F } ) ] , programInTextures = fromList [ ( "diffuseTexture" , FTexture2D ) ] , programOutput = [ Parameter { name = "f0" , ty = V4F } ] , vertexShader = "#version 330 core\nvec4 texture2D(sampler2D s,vec2 uv) {\n return texture(s,uv);\n}\nuniform mat4 ViewProjection;\nin vec4 vi1;\nin vec3 vi2;\nin vec3 vi3;\nsmooth out vec2 vo1;\nvec4 coordmap(mat4 z0,vec4 z1) {\n return (z0) * (z1);\n}\nvoid main() {\n gl_Position = coordmap (ViewProjection,vi1);\n vo1 = vec2 ((vi3).x,(1.0) - ((vi3).y));\n}" , geometryShader = Nothing , fragmentShader = "#version 330 core\nvec4 texture2D(sampler2D s,vec2 uv) {\n return texture(s,uv);\n}\nuniform vec4 diffuseColor;\nuniform sampler2D diffuseTexture;\nsmooth in vec2 vo1;\nout vec4 f0;\nvoid main() {\n f0 = (diffuseColor) * (texture2D (diffuseTexture,vo1));\n}" } , Program { programUniforms = fromList [ ( "CameraPosition" , V3F ) , ( "CubeMap" , FTextureCube ) , ( "ViewProjection" , M44F ) ] , programStreams = fromList [ ( "vi1" , Parameter { name = "position" , ty = V3F } ) ] , programInTextures = fromList [ ( "CubeMap" , FTextureCube ) ] , programOutput = [ Parameter { name = "f0" , ty = V4F } ] , vertexShader = "#version 330 core\nvec4 texture2D(sampler2D s,vec2 uv) {\n return texture(s,uv);\n}\nuniform vec3 CameraPosition;\nuniform mat4 ViewProjection;\nin vec3 vi1;\nsmooth out vec3 vo1;\nvec4 point(vec3 z0) {\n return vec4 ((z0).x,(z0).y,(z0).z,1.0);\n}\nvoid main() {\n gl_Position = (ViewProjection) * (point ((vi1) + (CameraPosition)));\n vo1 = vec3 ((vi1).x,(vi1).y,(vi1).z);\n}" , geometryShader = Nothing , fragmentShader = "#version 330 core\nvec4 texture2D(sampler2D s,vec2 uv) {\n return texture(s,uv);\n}\nuniform samplerCube CubeMap;\nsmooth in vec3 vo1;\nout vec4 f0;\nvoid main() {\n f0 = texture (CubeMap,vo1);\n}" } ] , slots = [ Slot { slotName = "plane" , slotStreams = fromList [ ( "position" , V4F ) ] , slotUniforms = fromList [ ( "ViewProjection" , M44F ) ] , slotPrimitive = Triangles , slotPrograms = [ 0 ] } , Slot { slotName = "objects" , slotStreams = fromList [ ( "normal" , V3F ) , ( "position" , V4F ) , ( "uvw" , V3F ) ] , slotUniforms = fromList [ ( "ViewProjection" , M44F ) , ( "diffuseColor" , V4F ) , ( "diffuseTexture" , FTexture2D ) ] , slotPrimitive = Triangles , slotPrograms = [ 1 ] } , Slot { slotName = "SkyCube" , slotStreams = fromList [ ( "position" , V3F ) ] , slotUniforms = fromList [ ( "CameraPosition" , V3F ) , ( "CubeMap" , FTextureCube ) , ( "ViewProjection" , M44F ) ] , slotPrimitive = Triangles , slotPrograms = [ 2 ] } ] , streams = [] , commands = [ SetRenderTarget 0 , ClearRenderTarget [ ClearImage { imageSemantic = Depth , clearValue = VFloat 1.0 } , ClearImage { imageSemantic = Color , clearValue = VV4F (V4 0.0 0.0 0.4 1.0) } ] , SetProgram 2 -- This command is wrong. It causes the diffuseTexture mapping to fail. -- , SetSamplerUniform "CubeMap" 1 , SetRasterContext (TriangleCtx CullNone PolygonFill NoOffset LastVertex) , SetAccumulationContext AccumulationContext { accViewportName = Nothing , accOperations = [ DepthOp Always False , ColorOp NoBlending (VV4B (V4 True True True True)) ] } , RenderSlot 2 -- This doesn't help. -- , ClearRenderTarget [ ClearImage { imageSemantic = Depth , clearValue = VFloat 1.0 } ] , SetProgram 1 , SetSamplerUniform "diffuseTexture" 2 , SetRasterContext (TriangleCtx (CullBack CCW) PolygonFill NoOffset LastVertex) , SetAccumulationContext AccumulationContext { accViewportName = Nothing , accOperations = [ DepthOp Less True , ColorOp NoBlending (VV4B (V4 True True True True)) ] } , RenderSlot 1 , SetProgram 0 , SetRasterContext (TriangleCtx CullNone PolygonFill NoOffset LastVertex) , SetAccumulationContext AccumulationContext { accViewportName = Nothing , accOperations = [ DepthOp Less True , ColorOp Blend { colorEqSrc = FuncAdd , alphaEqSrc = FuncAdd , colorFSrc = One , colorFDst = SrcAlpha , alphaFSrc = DstAlpha , alphaFDst = DstAlpha , color = V4 0.0 0.0 0.0 0.0 } (VV4B (V4 True True True True)) ] } , RenderSlot 0 ] }