summaryrefslogtreecommitdiff
path: root/testdata/editor-examples/LambdaCube.out
blob: bd059d5068118ed141bf5561b02c2c2ae192b7a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
Pipeline
  { info = "generated by lambdacube-compiler 0.6.0.0"
  , 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 [ ( "Time" , Float ) ]
          , programStreams =
              fromList
                [ ( "vi1" , Parameter { name = "position4" , ty = V4F } ) ]
          , programInTextures = fromList []
          , programOutput = [ Parameter { name = "f0" , ty = V4F } ]
          , vertexShader =
              """
              #version 330 core
              vec4 texture2D(sampler2D s
                            ,vec2 uv) {
                  return texture(s,uv);
              }
              uniform float Time;
              in vec4 vi1;
              smooth out vec4 vo1;
              float phase;
              mat4 rotMatrixY(float z0) {
                  return mat4 (vec4 (cos (z0)
                                    ,0.0
                                    ,(0.0) - (sin (z0))
                                    ,0.0)
                              ,vec4 (0.0,1.0,0.0,0.0)
                              ,vec4 (sin (z0)
                                    ,0.0
                                    ,cos (z0)
                                    ,0.0)
                              ,vec4 (0.0,0.0,0.0,1.0));
              }
              mat4 rotMatrixZ(float z0) {
                  return mat4 (vec4 (cos (z0)
                                    ,sin (z0)
                                    ,0.0
                                    ,0.0)
                              ,vec4 ((0.0) - (sin (z0))
                                    ,cos (z0)
                                    ,0.0
                                    ,0.0)
                              ,vec4 (0.0,0.0,1.0,0.0)
                              ,vec4 (0.0,0.0,0.0,1.0));
              }
              vec4 scale(float z0,vec4 z1) {
                  return (z1) * (vec4 (z0
                                      ,z0
                                      ,z0
                                      ,1.0));
              }
              float smoothPhase;
              void main() {
                  phase = fract ((Time) * (0.2));
                  smoothPhase =
                      ((phase) * (phase)) * ((3.0) - ((2.0) * (phase)));
                  gl_Position = scale
                      ((0.2) + ((abs
                      ((0.5) - (smoothPhase))) * (0.6))
                      ,(rotMatrixY
                      ((4.1) + ((smoothPhase) * (6.28318530718)))) * ((rotMatrixZ
                      (2.35619449017)) * (vi1)));
                  vo1 = vi1;
              }
              """
          , geometryShader = Nothing
          , fragmentShader =
              """
              #version 330 core
              vec4 texture2D(sampler2D s
                            ,vec2 uv) {
                  return texture(s,uv);
              }
              smooth in vec4 vo1;
              out vec4 f0;
              vec4 rgb(float z0
                      ,float z1
                      ,float z2) {
                  return vec4 (z0,z1,z2,1.0);
              }
              vec4 black;
              vec4 leftSide(vec2 z0) {
                  return vec4 (0.0
                              ,1.0
                              ,(dot (z0
                                    ,vec2 (0.5,-0.5))) + (0.4)
                              ,((z0).y) > (0.75) ? 0.0 : 1.0);
              }
              vec4 rightSide_2(vec2 z0) {
                  return vec4 (((z0).x) * ((z0).x)
                              ,1.0
                              ,((1.0) - ((z0).x)) * ((1.0) - ((z0).x))
                              ,((z0).y) > (0.75) ? 0.0 : 1.0);
              }
              vec4 topSide(vec2 z0) {
                  return vec4 ((dot (z0
                                    ,vec2 (-0.5,0.5))) + (0.4)
                              ,1.0
                              ,0.0
                              ,((dot (z0
                                     ,vec2 (1.0
                                           ,-1.0))) > (-0.25)) && ((dot (z0
                                                                        ,vec2 (1.0
                                                                              ,-1.0))) < (0.0)) ? 0.0 : 1.0);
              }
              void main() {
                  black = rgb (0.0,0.0,0.0);
                  f0 = (abs
                      ((vo1).x)) > (0.99999) ? rightSide_2
                      (((((vo1).yz) * (sign
                      ((vo1).x))) * (0.5)) + (0.5)) : (abs
                      ((vo1).y)) > (0.99999) ? topSide
                      (((((vo1).zx) * (sign
                      ((vo1).y))) * (0.5)) + (0.5)) : (abs
                      ((vo1).z)) > (0.99999) ? leftSide
                      (((((vo1).xy) * (sign
                      ((vo1).z))) * (0.5)) + (0.5)) : black;
              }
              """
          }
      ]
  , slots =
      [ Slot
          { slotName = "stream4"
          , slotStreams = fromList [ ( "position4" , V4F ) ]
          , slotUniforms = fromList [ ( "Time" , Float ) ]
          , slotPrimitive = Triangles
          , slotPrograms = [ 0 ]
          }
      ]
  , streams = []
  , commands =
      [ SetRenderTarget 0
      , ClearRenderTarget
          [ ClearImage { imageSemantic = Depth , clearValue = VFloat 1.0 }
          , ClearImage
              { imageSemantic = Color , clearValue = VV4F (V4 1.0 1.0 1.0 1.0) }
          ]
      , SetProgram 0
      , SetRasterContext
          (TriangleCtx CullNone PolygonFill NoOffset LastVertex)
      , SetAccumulationContext
          AccumulationContext
            { accViewportName = Nothing
            , accOperations =
                [ DepthOp Less True
                , ColorOp NoBlending (VV4B (V4 True True True True))
                ]
            }
      , RenderSlot 0
      ]
  }