summaryrefslogtreecommitdiff
path: root/testdata/editor-examples
diff options
context:
space:
mode:
authorPéter Diviánszky <divipp@gmail.com>2016-05-06 14:21:24 +0200
committerPéter Diviánszky <divipp@gmail.com>2016-05-06 14:21:24 +0200
commitdea5e2c619c55ca7e7e897edb9898d9b5105fc92 (patch)
tree79f67084d0f669558f7a6f3d2352264ad6dbf595 /testdata/editor-examples
parentf69178d9e65103c8d1ba2ba47c9fb9f834780621 (diff)
tweak hnf handling
Diffstat (limited to 'testdata/editor-examples')
-rw-r--r--testdata/editor-examples/Heartbeat.lc8
-rw-r--r--testdata/editor-examples/Heartbeat.out11
-rw-r--r--testdata/editor-examples/LambdaCube.out5
3 files changed, 8 insertions, 16 deletions
diff --git a/testdata/editor-examples/Heartbeat.lc b/testdata/editor-examples/Heartbeat.lc
index 920c9097..29a0464e 100644
--- a/testdata/editor-examples/Heartbeat.lc
+++ b/testdata/editor-examples/Heartbeat.lc
@@ -7,8 +7,6 @@ triangleRasterCtx = TriangleCtx CullNone PolygonFill NoOffset LastVertex
7triangles = triangleRasterCtx 7triangles = triangleRasterCtx
8colorFragmentCtx = (DepthOp Less True, ColorOp NoBlending (V4 True True True True)) 8colorFragmentCtx = (DepthOp Less True, ColorOp NoBlending (V4 True True True True))
9 9
10rasterizeWith s = rasterizePrimitives triangles ((Smooth)) s
11
12cubeVertexStream = fetch "stream4" (Attribute "position4" :: Vec 4 Float, Attribute "vertexUV" :: Vec 2 Float) 10cubeVertexStream = fetch "stream4" (Attribute "position4" :: Vec 4 Float, Attribute "vertexUV" :: Vec 2 Float)
13mapFragments2 s fs = accumulate colorFragmentCtx (\((a)) -> ((fs a))) s clear 11mapFragments2 s fs = accumulate colorFragmentCtx (\((a)) -> ((fs a))) s clear
14 12
@@ -22,7 +20,7 @@ rotate' v = projmat *. v
22texImage = PrjImageColor $ 20texImage = PrjImageColor $
23 cubeVertexStream -- cube vertices 21 cubeVertexStream -- cube vertices
24 & mapPrimitives (\(x, y) -> (scale 1.0 x, V2 y%x (1-y%y))) 22 & mapPrimitives (\(x, y) -> (scale 1.0 x, V2 y%x (1-y%y)))
25 & rasterizeWith -- rasterize 23 & rasterizePrimitives triangles ((Smooth)) -- rasterize
26 `mapFragments2` 24 `mapFragments2`
27 (\xy -> let 25 (\xy -> let
28 x = ((xy :: Vec 2 Float)%x :: Float) -! 0.85 26 x = ((xy :: Vec 2 Float)%x :: Float) -! 0.85
@@ -39,7 +37,7 @@ texImage = PrjImageColor $
39sampler = Sampler LinearFilter MirroredRepeat $ Texture2D (V2 128 128) texImage 37sampler = Sampler LinearFilter MirroredRepeat $ Texture2D (V2 128 128) texImage
40 38
41main = cubeVertexStream -- cube vertices 39main = cubeVertexStream -- cube vertices
42 & mapPrimitives (\(x, y) -> (scale 0.5 . rotate' $ x, y)) 40 & mapPrimitives (\(x, y) -> (scale 0.5 . rotate' $ x, y))
43 & rasterizeWith -- rasterize 41 & rasterizePrimitives triangles ((Smooth)) -- rasterize
44 `mapFragments2` (texture2D sampler) 42 `mapFragments2` (texture2D sampler)
45 & ScreenOut -- draw into screen 43 & ScreenOut -- draw into screen
diff --git a/testdata/editor-examples/Heartbeat.out b/testdata/editor-examples/Heartbeat.out
index 6c435c7e..56f659dc 100644
--- a/testdata/editor-examples/Heartbeat.out
+++ b/testdata/editor-examples/Heartbeat.out
@@ -103,20 +103,17 @@ Pipeline
103 uniform float Time; 103 uniform float Time;
104 smooth in vec2 vo1; 104 smooth in vec2 vo1;
105 out vec4 f0; 105 out vec4 f0;
106 vec4 rgb(float z0,float z1,float z2) {
107 return vec4 (z0,z1,z2,1.0);
108 }
109 vec4 blue; 106 vec4 blue;
110 vec4 navy; 107 vec4 navy;
111 float ti; 108 float ti;
112 vec4 white; 109 vec4 white;
113 vec4 yellow; 110 vec4 yellow;
114 void main() { 111 void main() {
115 blue = rgb (0.0,0.0,1.0); 112 blue = vec4 (0.0,0.0,1.0,1.0);
116 navy = rgb (0.0,0.0,0.5); 113 navy = vec4 (0.0,0.0,0.5,1.0);
117 ti = abs ((sin ((Time) * (4.0))) - (0.37)); 114 ti = abs ((sin ((Time) * (4.0))) - (0.37));
118 white = rgb (1.0,1.0,1.0); 115 white = vec4 (1.0,1.0,1.0,1.0);
119 yellow = rgb (1.0,1.0,0.0); 116 yellow = vec4 (1.0,1.0,0.0,1.0);
120 f0 = 117 f0 =
121 ((((((vo1).x) - (0.85)) * (((vo1).x) - (0.85))) + ((((vo1).y) - (0.85)) * (((vo1).y) - (0.85)))) + ((5.0e-4) * (sin 118 ((((((vo1).x) - (0.85)) * (((vo1).x) - (0.85))) + ((((vo1).y) - (0.85)) * (((vo1).y) - (0.85)))) + ((5.0e-4) * (sin
122 (((3.0) * (atan (((vo1).x) - (0.85) 119 (((3.0) * (atan (((vo1).x) - (0.85)
diff --git a/testdata/editor-examples/LambdaCube.out b/testdata/editor-examples/LambdaCube.out
index 68796786..fa7afdb9 100644
--- a/testdata/editor-examples/LambdaCube.out
+++ b/testdata/editor-examples/LambdaCube.out
@@ -65,9 +65,6 @@ Pipeline
65 } 65 }
66 smooth in vec4 vo1; 66 smooth in vec4 vo1;
67 out vec4 f0; 67 out vec4 f0;
68 vec4 rgb(float z0,float z1,float z2) {
69 return vec4 (z0,z1,z2,1.0);
70 }
71 vec4 black; 68 vec4 black;
72 vec4 leftSide(vec2 z0) { 69 vec4 leftSide(vec2 z0) {
73 return vec4 (0.0 70 return vec4 (0.0
@@ -89,7 +86,7 @@ Pipeline
89 ,vec2 (1.0,-1.0))) < (0.0)) ? 0.0 : 1.0); 86 ,vec2 (1.0,-1.0))) < (0.0)) ? 0.0 : 1.0);
90 } 87 }
91 void main() { 88 void main() {
92 black = rgb (0.0,0.0,0.0); 89 black = vec4 (0.0,0.0,0.0,1.0);
93 f0 = (abs ((vo1).x)) > (0.99999) ? rightSide_2 (((((vo1).yz) * (sign 90 f0 = (abs ((vo1).x)) > (0.99999) ? rightSide_2 (((((vo1).yz) * (sign
94 ((vo1).x))) * (0.5)) + (0.5)) : (abs ((vo1).y)) > (0.99999) ? topSide 91 ((vo1).x))) * (0.5)) + (0.5)) : (abs ((vo1).y)) > (0.99999) ? topSide
95 (((((vo1).zx) * (sign ((vo1).y))) * (0.5)) + (0.5)) : (abs 92 (((((vo1).zx) * (sign ((vo1).y))) * (0.5)) + (0.5)) : (abs