Pipeline { info = "" , backend = OpenGL33 , textures = [ TextureDescriptor { textureType = Texture2D (FloatT Red) 1 , textureSize = VV2U (V2 1024 768) , textureSemantic = Depth , textureSampler = SamplerDescriptor { samplerWrapS = Repeat , samplerWrapT = Nothing , samplerWrapR = Nothing , samplerMinFilter = Linear , samplerMagFilter = Linear , samplerBorderColor = VV4F (V4 0.0 0.0 0.0 1.0) , samplerMinLod = Nothing , samplerMaxLod = Nothing , samplerLodBias = 0.0 , samplerCompareFunc = Nothing } , textureBaseLevel = 0 , textureMaxLevel = 0 } , TextureDescriptor { textureType = Texture2D (FloatT RGBA) 1 , textureSize = VV2U (V2 1024 768) , textureSemantic = Color , textureSampler = SamplerDescriptor { samplerWrapS = Repeat , samplerWrapT = Nothing , samplerWrapR = Nothing , samplerMinFilter = Linear , samplerMagFilter = Linear , samplerBorderColor = VV4F (V4 0.0 0.0 0.0 1.0) , samplerMinLod = Nothing , samplerMaxLod = Nothing , samplerLodBias = 0.0 , samplerCompareFunc = Nothing } , textureBaseLevel = 0 , textureMaxLevel = 0 } ] , samplers = [] , targets = [ RenderTarget { renderTargets = [ TargetItem { targetSemantic = Depth , targetRef = Just (Framebuffer Depth) } , TargetItem { targetSemantic = Color , targetRef = Just (Framebuffer Color) } ] } , RenderTarget { renderTargets = [ TargetItem { targetSemantic = Depth , targetRef = Just (TextureImage 0 0 Nothing) } , TargetItem { targetSemantic = Color , targetRef = Just (TextureImage 1 0 Nothing) } ] } ] , programs = [ Program { programUniforms = fromList [ ( "MVP2" , M44F ) ] , programStreams = fromList [ ( "vi1" , Parameter { name = "position" , ty = V3F } ) ] , programInTextures = fromList [] , programOutput = [ Parameter { name = "f0" , ty = V4F } ] , vertexShader = """ #version 330 core vec4 texture2D(sampler2D s,vec2 uv) { return texture(s,uv); } uniform mat4 MVP2; in vec3 vi1; void main() { gl_Position = (MVP2) * (vec4 ((vi1).x,(vi1).y,(vi1).z,1.0)); } """ , geometryShader = Nothing , fragmentShader = """ #version 330 core vec4 texture2D(sampler2D s,vec2 uv) { return texture(s,uv); } out vec4 f0; void main() { f0 = vec4 (0.0,0.4,0.0,1.0); } """ } , Program { programUniforms = fromList [ ( "MVP2" , M44F ) ] , programStreams = fromList [ ( "vi1" , Parameter { name = "position" , ty = V3F } ) ] , programInTextures = fromList [] , programOutput = [ Parameter { name = "f0" , ty = V4F } ] , vertexShader = """ #version 330 core vec4 texture2D(sampler2D s,vec2 uv) { return texture(s,uv); } uniform mat4 MVP2; in vec3 vi1; smooth out vec4 vo1; void main() { gl_Position = (MVP2) * (vec4 ((vi1).x,(vi1).y,(vi1).z,1.0)); vo1 = vec4 ((vi1).x,(vi1).y,(vi1).z,1.0); } """ , geometryShader = Nothing , fragmentShader = """ #version 330 core vec4 texture2D(sampler2D s,vec2 uv) { return texture(s,uv); } smooth in vec4 vo1; out vec4 f0; void main() { f0 = (vo1) + (vec4 (1.0,1.4,1.0,0.6)); } """ } , Program { programUniforms = fromList [ ( "MVP" , M44F ) ] , programStreams = fromList [ ( "vi1" , Parameter { name = "position4" , ty = V4F } ) , ( "vi2" , Parameter { name = "vertexUV" , ty = V2F } ) ] , programInTextures = fromList [ ( "s0" , FTexture2D ) ] , programOutput = [ Parameter { name = "f0" , ty = V4F } ] , vertexShader = """ #version 330 core vec4 texture2D(sampler2D s,vec2 uv) { return texture(s,uv); } uniform mat4 MVP; in vec4 vi1; in vec2 vi2; smooth out vec2 vo1; void main() { gl_Position = (MVP) * (vi1); vo1 = vi2; } """ , geometryShader = Nothing , fragmentShader = """ #version 330 core vec4 texture2D(sampler2D s,vec2 uv) { return texture(s,uv); } uniform sampler2D s0; smooth in vec2 vo1; out vec4 f0; void main() { f0 = (texture2D (s0,(vo1).xy)) * (0.7); } """ } ] , slots = [ Slot { slotName = "stream" , slotStreams = fromList [ ( "position" , V3F ) ] , slotUniforms = fromList [ ( "MVP2" , M44F ) ] , slotPrimitive = Triangles , slotPrograms = [ 0 , 1 , 0 ] } , Slot { slotName = "stream4" , slotStreams = fromList [ ( "position4" , V4F ) , ( "vertexUV" , V2F ) ] , slotUniforms = fromList [ ( "MVP" , M44F ) ] , slotPrimitive = Triangles , slotPrograms = [ 2 ] } ] , streams = [] , commands = [ SetRenderTarget 1 , ClearRenderTarget [ ClearImage { imageSemantic = Depth , clearValue = VFloat 1000.0 } , ClearImage { imageSemantic = Color , clearValue = VV4F (V4 0.1 0.0 0.3 1.0) } ] , SetProgram 0 , SetRasterContext (TriangleCtx CullNone (PolygonLine 20.0) NoOffset FirstVertex) , SetAccumulationContext AccumulationContext { accViewportName = Nothing , accOperations = [ DepthOp Always False , ColorOp NoBlending (VV4B (V4 True True False False)) ] } , RenderSlot 0 , SetRenderTarget 0 , ClearRenderTarget [ ClearImage { imageSemantic = Depth , clearValue = VFloat 1000.0 } , ClearImage { imageSemantic = Color , clearValue = VV4F (V4 0.5 0.0 0.4 1.0) } ] , SetProgram 2 , SetTexture 0 1 , SetSamplerUniform "s0" 0 , SetRasterContext (TriangleCtx CullNone PolygonFill NoOffset LastVertex) , SetAccumulationContext AccumulationContext { accViewportName = Nothing , accOperations = [ DepthOp Less False , ColorOp Blend { colorEqSrc = FuncAdd , alphaEqSrc = FuncAdd , colorFSrc = SrcAlpha , colorFDst = OneMinusSrcAlpha , alphaFSrc = SrcAlpha , alphaFDst = OneMinusSrcAlpha , color = V4 1.0 1.0 1.0 1.0 } (VV4B (V4 True True True True)) ] } , RenderSlot 1 , SetProgram 1 , SetRasterContext (TriangleCtx CullNone PolygonFill NoOffset FirstVertex) , SetAccumulationContext AccumulationContext { accViewportName = Nothing , accOperations = [ DepthOp Less False , ColorOp NoBlending (VV4B (V4 True True False False)) ] } , RenderSlot 0 , SetProgram 0 , SetRasterContext (TriangleCtx CullNone (PolygonLine 20.0) NoOffset FirstVertex) , SetAccumulationContext AccumulationContext { accViewportName = Nothing , accOperations = [ DepthOp Always False , ColorOp NoBlending (VV4B (V4 True True False False)) ] } , RenderSlot 0 ] }