ELEVATED
elevated.dmt · 96 BPM · 1:00 · 960×600
long
notes
A continuous two-minute mountain flight, from misty valleys through two lakes to a sunlit summit.
| file | elevated.dmt |
|---|---|
| duration | 1:00 |
| video | 960×600 · 30 fps · h264 + audio · 56 MB |
| song | 96 BPM · speed 6 · rpb 4 · 8 channels |
| loop | 0 |
| render | scale 2 · dither on · master 0.46 |
| uniforms | camx camy camz cyaw cpit crol flashE wooaa mistK fogK taiE sunU sunV sunVis mbK |
| tags | long |
| source | 932 lines · 44 KB · download |
anatomy
17VM programs
19patterns
0palettes
85timeline events
2text / sample / texture
932source lines
9inst
4chan
1master
1frame
1pixel
1post
8fn
line composition
pattern 39%pixel 26%fn 11%inst 8%post 7%frame 4%timeline 3%chan 2%master 1%text 0%title 0%song 0%order 0%pan 0%uniform 0%
play order
001122324567456788910891072232456711111112131413141516151617171818
order list · 48 entries
timeline
| at | event | value | source | |
|---|---|---|---|---|
| 0:00 | alt | 1.5 | L20 | |
| 0:00 | pitch | -0.06 | L20 | |
| 0:00 | shake | 0.5 | L20 | |
| 0:00 | mist | 1.0 | L20 | |
| 0:00 | fog | 1.2 | L20 | |
| 0:00 | mbK | 0.15 | L20 | |
| 0:05 | alt | 1.6 | L21 | |
| 0:10 | alt | 2.2 | L22 | |
| 0:10 | pitch | 0.00 | L22 | |
| 0:10 | mist | 0.8 | L22 | |
| 0:15 | alt | 3.2 | L23 | |
| 0:15 | pitch | 0.10 | L23 | |
| 0:15 | mist | 0.5 | L23 | |
| 0:20 | alt | 4.4 | L24 | |
| 0:20 | pitch | 0.20 | L24 | |
| 0:20 | fog | 0.9 | L24 | |
| 0:20 | mbK | 0.22 | L24 | |
| 0:25 | alt | 5.8 | L25 | |
| 0:25 | pitch | 0.14 | L25 | |
| 0:25 | mbK | 0.28 | L25 | |
| 0:30 | alt | 4.2 | L26 | |
| 0:30 | pitch | 0.08 | L26 | |
| 0:30 | mist | 0.4 | L26 | |
| 0:35 | alt | 2.6 | L27 | |
| 0:35 | pitch | 0.10 | L27 | |
| 0:35 | mist | 0.3 | L27 | |
| 0:35 | mbK | 0.38 | L27 | |
| 0:40 | alt | 1.1 | L28 | |
| 0:40 | pitch | 0.05 | L28 | |
| 0:40 | mbK | 0.52 | L28 | |
| 0:45 | alt | 1.0 | L29 | |
| 0:45 | pitch | 0.03 | L29 | |
| 0:45 | shake | 0.8 | L29 | |
| 0:45 | mbK | 0.58 | L29 | |
| 0:50 | alt | 1.4 | L30 | |
| 0:50 | pitch | -0.02 | L30 | |
| 0:50 | mbK | 0.52 | L30 | |
| 0:55 | alt | 3.0 | L31 | |
| 0:55 | pitch | 0.06 | L31 | |
| 0:55 | shake | 0.5 | L31 | |
| 0:55 | mbK | 0.30 | L31 | |
| 1:00 | alt | 4.8 | L32 | |
| 1:00 | pitch | 0.12 | L32 | |
| 1:00 | mist | 0.6 | L32 | |
| 1:00 | fog | 1.1 | L32 | |
| 1:00 | mbK | 0.22 | L32 | |
| 1:05 | alt | 3.6 | L33 | |
| 1:05 | pitch | 0.08 | L33 | |
| 1:05 | mist | 0.5 | L33 | |
| 1:10 | alt | 1.8 | L34 | |
| 1:10 | pitch | 0.04 | L34 | |
| 1:10 | mist | 0.35 | L34 | |
| 1:10 | mbK | 0.40 | L34 | |
| 1:15 | alt | 1.1 | L35 | |
| 1:15 | pitch | 0.03 | L35 | |
| 1:15 | fog | 0.9 | L35 | |
| 1:15 | mbK | 0.52 | L35 | |
| 1:20 | alt | 1.0 | L36 | |
| 1:20 | pitch | -0.02 | L36 | |
| 1:20 | shake | 0.8 | L36 | |
| 1:20 | mbK | 0.58 | L36 | |
| 1:25 | alt | 2.2 | L37 | |
| 1:25 | pitch | -0.05 | L37 | |
| 1:25 | shake | 0.6 | L37 | |
| 1:25 | mbK | 0.45 | L37 | |
| 1:30 | alt | 6.5 | L38 | |
| 1:30 | pitch | 0.12 | L38 | |
| 1:30 | shake | 1.0 | L38 | |
| 1:30 | mist | 0.15 | L38 | |
| 1:30 | mbK | 0.32 | L38 | |
| 1:35 | alt | 8.5 | L39 | |
| 1:35 | pitch | 0.10 | L39 | |
| 1:35 | mbK | 0.25 | L39 | |
| 1:40 | alt | 9.5 | L40 | |
| 1:40 | pitch | 0.02 | L40 | |
| 1:40 | shake | 0.5 | L40 | |
| 1:40 | mbK | 0.20 | L40 | |
| 1:45 | alt | 10.0 | L41 | |
| 1:45 | pitch | -0.04 | L41 | |
| 1:50 | alt | 10.0 | L42 | |
| 1:50 | pitch | -0.07 | L42 | |
| 1:50 | fog | 0.7 | L42 | |
| 1:50 | mbK | 0.15 | L42 | |
| 1:58 | alt | 10.0 | L43 | |
| 1:58 | pitch | -0.10 | L43 |
Event times are derived from the order list, pattern lengths, BPM and RPB. The rendered video is 1:00; the computed song length is 2:00.
resources
| kind | name | info | value |
|---|---|---|---|
| text | ttl1 | 8 | ELEVATED |
| text | cred | 34 | AFTER ELEVATED BY RGBA & TBC, 2009 |
source
1# elevated.dmt — a study/homage of "elevated" by Rgba & TBC (2009).
2# One continuous camera flight over a procedural mountain range: valley dawn,
3# ridge crossings, two lake skims, then the pull-up into the light. The terrain is
4# a raymarched ridged-fbm heightfield with a carved valley corridor and a lake
5# basin; water is the same field clamped to sea level with ripple reflections.
6# Original music: a two-minute taiko/strings/brass/choir build, climax at 90 s.
7# @duration 120
8# @description A continuous two-minute mountain flight, from misty valleys through two lakes to a sunlit summit.
9title ELEVATED
10song bpm=96 speed=6 rpb=4 channels=8 loop=0 volume=0.46 scale=2 dither=1
11order 0 0 1 1 2 2 3 2 4 5 6 7 4 5 6 7 8 8 9 10 8 9 10 7 2 2 3 2 4 5 6 7 11 11 11 12 13 14 13 14 15 16 15 16 17 17 18 18
12pan 0.5 0.55 0.45 0.5 0.42 0.58 0.5 0.5
14text ttl1 "ELEVATED"
15text cred "AFTER ELEVATED BY RGBA & TBC, 2009"
17# 48 bars at 96 BPM: dawn, ridge traverse, first lake, second valley,
18# second lake and crescendo, then a twenty-second release into the light.
19timeline {
20 0:00 alt=1.5 pitch=-0.06 shake=0.5 mist=1.0 fog=1.2 mbK=0.15
21 2:00 alt=1.6
22 4:00 alt=2.2 pitch=0.00 mist=0.8
23 6:00 alt=3.2 pitch=0.10 mist=0.5
24 8:00 alt=4.4 pitch=0.20 fog=0.9 mbK=0.22
25 10:00 alt=5.8 pitch=0.14 mbK=0.28
26 12:00 alt=4.2 pitch=0.08 mist=0.4
27 14:00 alt=2.6 pitch=0.10 mist=0.3 mbK=0.38
28 16:00 alt=1.1 pitch=0.05 mbK=0.52
29 18:00 alt=1.0 pitch=0.03 shake=0.8 mbK=0.58
30 20:00 alt=1.4 pitch=-0.02 mbK=0.52
31 22:00 alt=3.0 pitch=0.06 shake=0.5 mbK=0.30
32 24:00 alt=4.8 pitch=0.12 mist=0.6 fog=1.1 mbK=0.22
33 26:00 alt=3.6 pitch=0.08 mist=0.5
34 28:00 alt=1.8 pitch=0.04 mist=0.35 mbK=0.40
35 30:00 alt=1.1 pitch=0.03 fog=0.9 mbK=0.52
36 32:00 alt=1.0 pitch=-0.02 shake=0.8 mbK=0.58
37 34:00 alt=2.2 pitch=-0.05 shake=0.6 mbK=0.45
38 36:00 alt=6.5 pitch=0.12 shake=1.0 mist=0.15 mbK=0.32
39 38:00 alt=8.5 pitch=0.10 mbK=0.25
40 40:00 alt=9.5 pitch=0.02 shake=0.5 mbK=0.20
41 42:00 alt=10.0 pitch=-0.04
42 44:00 alt=10.0 pitch=-0.07 fog=0.7 mbK=0.15
43 47:00 alt=10.0 pitch=-0.10
44}
46# ------------------------------------------------------------------ instruments
47# ch0 taiko | ch1 rim | ch2 timpani | ch3 bass | ch4 strings | ch5 brass | ch6 choir | ch7 wind/cymbal
48inst taiko {
49 f = 52 + 260 * exp(-t * 12)
50 $p = $p + f / sr
51 body = sin($p * tau) * exp(-t * 3.2)
52 sl = lp(noise(), 900) * exp(-t * 22) * 0.5
53 out(dist(body * 2.0 + sl, 1.4) * 0.9)
54}
55inst rim {
56 e = exp(-t * 38)
57 n = hp(noise(), 2500) * 0.5
58 p = sin(tau * 1740 * t) * exp(-t * 60)
59 out((n * exp(-t * 30) + p) * e * 0.30)
60}
61inst timp {
62 f = freq * (1 + 0.5 * exp(-t * 9))
63 $p = $p + f / sr
64 m = sin($p * tau)
65 mem = lp(noise(), 1200) * exp(-t * 18) * 0.4
66 out(dist(m * exp(-t * 2.6) * 1.8 + mem, 1.3) * 0.7)
67}
68inst bass {
69 e = env(0.02, 0.35, 0.85, 0.5)
70 s = sin(ph * tau) * 0.9 + bsaw(ph, freq) * 0.25
71 s = svf(s, 160 + 300 * e + 200 * p0, 0.3)
72 out(dist(s * e, 1.2) * 0.55)
73}
74inst strings nna=continue {
75 e = env(0.6, 1.1, 0.9, 1.8)
76 s = usaw(freq, 0.14) + usaw(freq * 0.5, 0.09) * 0.7
77 s = svf(s, 240 + 900 * e + 500 * p0, 0.35)
78 s = s + r2 * 0.4
79 out(dist(s * 0.5, 1.15) * e * 0.38)
80}
81inst brass nna=continue {
82 e = env(0.30, 1.0, 0.85, 1.5)
83 f = freq * (1 + 0.004 * sin(t * 4.8) * min(t, 1))
84 s = usaw(f, 0.18) + usaw(f * 1.5, 0.1) * 0.35
85 s = svf(s, 350 + 2400 * e + 900 * p0, 0.4)
86 s = s + r2 * 0.6
87 out(dist(s * 0.45, 1.25) * e * 0.32)
88}
89inst choir nna=continue {
90 e = env(0.5, 1.3, 0.85, 2.2)
91 vib = 0.006 * sin(t * 5.2) * min(t * 1.5, 1)
92 s = usaw(freq * (1 + vib), 0.12)
93 f1 = 480 + 340 * p0
94 f2v = 880 + 420 * p0
95 s1 = svf(s, f1, 0.75)
96 bp1 = r2
97 s2 = svf(s, f2v, 0.78)
98 bp2 = r2
99 v = bp1 * 1.2 + bp2 * 0.9 + lp(s, 400) * 0.35
100 br = svf(noise(), 3200, 0.7)
101 v = v + r2 * 0.10
102 out(v * e * 0.38)
103}
104inst wind nna=continue {
105 e = env(1.8, 2.5, 0.7, 3.0)
106 n = svf(noise(), 320 + 260 * sin(t * 0.23) + 700 * p0, 0.55)
107 out((r2 * 0.8 + n * 0.2) * e * 0.10)
108}
109inst cym {
110 e = exp(-t * 1.1)
111 n = hp(noise(), 6000)
112 out(n * e * 0.13)
113}
115chan 0 {
116 w = verb(x, 0.5, 0.5)
117 out(x * 0.9 + w * 0.18)
118}
119chan 4 {
120 w = verb(x, 0.85, 0.4)
121 out(x * 0.78 + w * 0.40)
122}
123chan 5 {
124 w = verb(x, 0.88, 0.35)
125 out(x * 0.76 + w * 0.45)
126}
127chan 6 {
128 w = verb(x, 0.92, 0.5)
129 d = dly(x, 0.3125, 0.25)
130 out(x * 0.72 + w * 0.55 + d * 0.15)
131}
132master {
133 dl = dly(l, 0.2344, 0.16)
134 dr = dly(r, 0.3125, 0.16)
135 w = verb((l + r) * 0.45, 0.80, 0.45)
136 out(dist(l * 0.62 + dr * 0.07 + w * 0.08, 1.05), dist(r * 0.62 + dl * 0.07 + w * 0.08, 1.05))
137}
139# ------------------------------------------------------------------ score
140# Phrase: dawn mist, drone only
141pattern 0 rows=16 {
142 0: . | . | . | D-1 4 30 | D-2 5 1E | . | . | C-3 8 1E S30
143 1: . | . | . | . | . | . | . | .
144 2: . | . | . | . | . | . | . | .
145 3: . | . | . | . | . | . | . | .
146 4: . | . | . | . | . | . | . | .
147 5: . | . | . | . | . | . | . | .
148 6: . | . | . | . | . | . | . | .
149 7: . | . | . | . | . | . | . | .
150 8: . | . | . | . | . | . | . | .
151 9: . | . | . | . | . | . | . | .
152 10: . | . | . | . | . | . | . | .
153 11: . | . | . | . | . | . | . | .
154 12: . | . | . | . | . | . | . | .
155 13: . | . | . | . | . | . | . | .
156 14: . | . | . | . | . | . | . | .
157 15: . | . | . | . | . | . | . | .
158}
159# Phrase: taiko heartbeat
160pattern 1 rows=16 {
161 0: C-2 1 2C | . | D-1 3 28 | D-1 4 30 | D-2 5 20 | . | . | C-3 8 20 S30
162 1: . | . | . | . | . | . | . | .
163 2: . | . | . | . | . | . | . | .
164 3: . | . | . | . | . | . | . | .
165 4: . | . | . | . | . | . | . | .
166 5: . | . | . | . | . | . | . | .
167 6: . | . | . | . | . | . | . | .
168 7: . | . | . | . | . | . | . | .
169 8: C-2 1 1E | . | . | . | . | . | . | .
170 9: . | . | . | . | . | . | . | .
171 10: . | . | . | . | . | . | . | .
172 11: . | . | . | . | . | . | . | .
173 12: . | . | . | . | . | . | . | .
174 13: . | . | . | . | . | . | . | .
175 14: . | . | . | . | . | . | . | .
176 15: . | . | . | . | . | . | . | .
177}
178# Phrase: strings gather in the valley
179pattern 2 rows=16 {
180 0: C-2 1 30 | . | D-1 3 2C | D-1 4 32 | D-2 5 24 | . | . | C-3 8 20 S38
181 1: . | . | . | . | . | . | . | .
182 2: . | . | . | . | . | . | . | .
183 3: . | . | . | . | . | . | . | .
184 4: . | . | . | . | F-3 5 20 | . | . | .
185 5: . | . | . | . | . | . | . | .
186 6: C-2 1 22 | . | . | . | . | . | . | .
187 7: . | . | . | . | . | . | . | .
188 8: C-2 1 2A | C-5 2 16 | D-1 3 22 | . | A-3 5 20 | . | . | .
189 9: . | . | . | . | . | . | . | .
190 10: . | . | . | . | . | . | . | .
191 11: . | . | . | . | . | . | . | .
192 12: . | . | . | . | . | . | . | .
193 13: . | . | . | . | . | . | . | .
194 14: C-2 1 22 | . | . | . | . | . | . | .
195 15: . | . | . | . | . | . | . | .
196}
197# Phrase: fuller Dm
198pattern 3 rows=16 {
199 0: C-2 1 34 | . | D-1 3 2C | D-1 4 34 | D-2 5 26 | . | . | C-3 8 22 S40
200 1: . | . | . | . | . | . | . | .
201 2: . | . | . | . | . | . | . | .
202 3: C-2 1 24 | . | . | . | F-3 5 22 | . | . | .
203 4: . | C-5 2 1C | . | . | . | . | . | .
204 5: . | . | . | . | . | . | . | .
205 6: C-2 1 28 | . | . | . | A-3 5 22 | . | . | .
206 7: . | . | . | . | . | . | . | .
207 8: C-2 1 2E | . | D-1 3 24 | D-1 4 2E | . | . | . | .
208 9: . | . | . | . | . | . | . | .
209 10: . | . | . | . | . | . | . | .
210 11: C-2 1 24 | . | . | . | . | . | . | .
211 12: . | C-5 2 18 | . | . | . | . | . | .
212 13: . | . | . | . | . | . | . | .
213 14: C-2 1 26 | . | A-1 3 22 | A-1 4 2A | . | . | . | .
214 15: . | . | . | . | . | . | . | .
215}
216# Phrase: Dm, brass enters — the climb
217pattern 4 rows=16 {
218 0: C-2 1 34 | . | D-1 3 30 | D-1 4 36 | D-2 5 28 | D-3 6 1C | . | C-3 8 22 S40
219 1: . | . | . | . | . | . | . | .
220 2: . | . | . | . | . | . | . | .
221 3: C-2 1 24 | . | . | . | F-3 5 24 | . | . | .
222 4: . | C-5 2 20 | . | . | . | . | . | .
223 5: . | . | . | . | . | . | . | .
224 6: C-2 1 28 | . | . | . | A-3 5 24 | . | . | .
225 7: . | . | . | . | . | . | . | .
226 8: C-2 1 30 | . | D-1 3 26 | D-1 4 30 | . | A-3 6 1A | . | .
227 9: . | . | . | . | . | . | . | .
228 10: . | . | . | . | . | . | . | .
229 11: C-2 1 24 | . | . | . | . | . | . | .
230 12: . | C-5 2 1C | . | . | . | . | . | .
231 13: . | . | . | . | . | . | . | .
232 14: C-2 1 26 | . | A-1 3 24 | A-1 4 2C | . | . | . | .
233 15: . | . | . | . | . | . | . | .
234}
235# Phrase: Bb
236pattern 5 rows=16 {
237 0: C-2 1 34 | . | A#1 3 30 | A#1 4 36 | A#2 5 28 | A#2 6 1C | . | C-3 8 22 S40
238 1: . | . | . | . | . | . | . | .
239 2: . | . | . | . | . | . | . | .
240 3: C-2 1 24 | . | . | . | D-4 5 22 | . | . | .
241 4: . | C-5 2 20 | . | . | . | . | . | .
242 5: . | . | . | . | . | . | . | .
243 6: C-2 1 28 | . | . | . | F-4 5 22 | . | . | .
244 7: . | . | . | . | . | . | . | .
245 8: C-2 1 30 | . | A#1 3 26 | A#1 4 30 | . | F-3 6 1A | . | .
246 9: . | . | . | . | . | . | . | .
247 10: . | . | . | . | . | . | . | .
248 11: C-2 1 24 | . | . | . | . | . | . | .
249 12: . | C-5 2 1C | . | . | . | . | . | .
250 13: . | . | . | . | . | . | . | .
251 14: C-2 1 26 | . | F-2 3 24 | F-2 4 2C | . | . | . | .
252 15: . | . | . | . | . | . | . | .
253}
254# Phrase: F
255pattern 6 rows=16 {
256 0: C-2 1 34 | . | F-1 3 30 | F-1 4 36 | F-2 5 28 | F-3 6 1C | . | C-3 8 22 S40
257 1: . | . | . | . | . | . | . | .
258 2: . | . | . | . | . | . | . | .
259 3: C-2 1 24 | . | . | . | A-3 5 22 | . | . | .
260 4: . | C-5 2 20 | . | . | . | . | . | .
261 5: . | . | . | . | . | . | . | .
262 6: C-2 1 28 | . | . | . | C-4 5 22 | . | . | .
263 7: . | . | . | . | . | . | . | .
264 8: C-2 1 30 | . | F-1 3 26 | F-1 4 30 | . | C-4 6 1A | . | .
265 9: . | . | . | . | . | . | . | .
266 10: . | . | . | . | . | . | . | .
267 11: C-2 1 24 | . | . | . | . | . | . | .
268 12: . | C-5 2 1C | . | . | . | . | . | .
269 13: . | . | . | . | . | . | . | .
270 14: C-2 1 26 | . | C-2 3 24 | C-2 4 2C | . | . | . | .
271 15: . | . | . | . | . | . | . | .
272}
273# Phrase: C
274pattern 7 rows=16 {
275 0: C-2 1 34 | . | C-2 3 30 | C-2 4 36 | C-3 5 28 | C-3 6 1C | . | C-3 8 22 S40
276 1: . | . | . | . | . | . | . | .
277 2: . | . | . | . | . | . | . | .
278 3: C-2 1 24 | . | . | . | E-3 5 22 | . | . | .
279 4: . | C-5 2 20 | . | . | . | . | . | .
280 5: . | . | . | . | . | . | . | .
281 6: C-2 1 28 | . | . | . | G-3 5 22 | . | . | .
282 7: . | . | . | . | . | . | . | .
283 8: C-2 1 30 | . | C-2 3 26 | C-2 4 30 | . | G-3 6 1A | . | .
284 9: . | . | . | . | . | . | . | .
285 10: . | . | . | . | . | . | . | .
286 11: C-2 1 24 | . | . | . | . | . | . | .
287 12: . | C-5 2 1C | . | . | . | . | . | .
288 13: . | . | . | . | . | . | . | .
289 14: C-2 1 26 | . | G-1 3 24 | G-1 4 2C | . | . | . | .
290 15: . | . | . | . | . | . | . | .
291}
292# Phrase: Dm high — over the ridge, choir enters
293pattern 8 rows=16 {
294 0: C-2 1 38 | . | D-1 3 32 | D-1 4 38 | D-2 5 2A | D-3 6 24 | . | C-3 8 24 S50
295 1: . | . | . | . | . | . | . | .
296 2: C-2 1 24 | . | . | . | . | . | . | .
297 3: . | . | . | . | F-3 5 26 | . | . | .
298 4: . | C-5 2 24 | . | . | . | . | . | .
299 5: . | . | . | . | . | . | . | .
300 6: C-2 1 2A | . | . | . | A-3 5 26 | . | . | .
301 7: . | . | . | . | . | . | . | .
302 8: C-2 1 32 | . | D-1 3 28 | D-1 4 32 | . | A-3 6 20 | A-4 7 1C S30 | .
303 9: . | . | . | . | . | . | . | .
304 10: C-2 1 24 | . | . | . | . | . | . | .
305 11: . | . | . | . | . | . | . | .
306 12: . | C-5 2 20 | . | . | . | . | D-5 7 1C S30 | .
307 13: C-2 1 26 | . | . | . | . | . | . | .
308 14: C-2 1 28 | . | A-1 3 26 | A-1 4 2E | . | . | . | .
309 15: . | C-5 2 18 | . | . | . | . | . | .
310}
311# Phrase: Bb high
312pattern 9 rows=16 {
313 0: C-2 1 38 | . | A#1 3 32 | A#1 4 38 | A#2 5 2A | A#2 6 24 | F-4 7 1E S30 | C-3 8 24 S50
314 1: . | . | . | . | . | . | . | .
315 2: C-2 1 24 | . | . | . | . | . | . | .
316 3: . | . | . | . | D-4 5 24 | . | . | .
317 4: . | C-5 2 24 | . | . | . | . | . | .
318 5: . | . | . | . | . | . | . | .
319 6: C-2 1 2A | . | . | . | F-4 5 24 | . | . | .
320 7: . | . | . | . | . | . | . | .
321 8: C-2 1 32 | . | A#1 3 28 | A#1 4 32 | . | F-3 6 20 | D-5 7 1E S30 | .
322 9: . | . | . | . | . | . | . | .
323 10: C-2 1 24 | . | . | . | . | . | . | .
324 11: . | . | . | . | . | . | . | .
325 12: . | C-5 2 20 | . | . | . | . | . | .
326 13: C-2 1 26 | . | . | . | . | . | . | .
327 14: C-2 1 28 | . | F-2 3 26 | F-2 4 2E | . | . | . | .
328 15: . | C-5 2 18 | . | . | . | . | . | .
329}
330# Phrase: C high
331pattern 10 rows=16 {
332 0: C-2 1 38 | . | C-2 3 32 | C-2 4 38 | C-3 5 2A | C-3 6 24 | G-4 7 1E S30 | C-3 8 24 S50
333 1: . | . | . | . | . | . | . | .
334 2: C-2 1 24 | . | . | . | . | . | . | .
335 3: . | . | . | . | E-3 5 24 | . | . | .
336 4: . | C-5 2 24 | . | . | . | . | . | .
337 5: . | . | . | . | . | . | . | .
338 6: C-2 1 2A | . | . | . | G-3 5 24 | . | . | .
339 7: . | . | . | . | . | . | . | .
340 8: C-2 1 32 | . | C-2 3 28 | C-2 4 32 | . | G-3 6 20 | E-5 7 1E S30 | .
341 9: . | . | . | . | . | . | . | .
342 10: C-2 1 24 | . | . | . | . | . | . | .
343 11: . | . | . | . | . | . | . | .
344 12: . | C-5 2 20 | . | . | . | . | . | .
345 13: C-2 1 26 | . | . | . | . | . | . | .
346 14: C-2 1 28 | . | G-1 3 26 | G-1 4 2E | . | . | . | .
347 15: . | C-5 2 18 | . | . | . | . | . | .
348}
349# Phrase: Gm — the lift begins
350pattern 11 rows=16 {
351 0: C-2 1 38 | . | G-1 3 32 | G-1 4 38 | G-2 5 28 | G-3 6 24 | A#4 7 20 S40 | C-3 8 26 S80
352 1: . | . | . | . | . | . | . | .
353 2: C-2 1 24 | . | . | G-1 4 30 | . | . | . | .
354 3: . | . | . | . | A#3 5 24 | . | . | .
355 4: C-2 1 2C | C-5 2 22 | G-1 3 2C | G-1 4 32 | . | D-4 6 22 | . | .
356 5: . | . | . | . | . | . | . | .
357 6: C-2 1 26 | . | . | G-1 4 30 | D-4 5 24 | . | . | .
358 7: . | . | . | . | . | . | . | .
359 8: C-2 1 32 | . | G-1 3 2E | G-1 4 34 | G-2 5 26 | G-3 6 22 | D-5 7 22 S40 | .
360 9: . | . | . | . | . | . | . | .
361 10: C-2 1 24 | . | . | G-1 4 30 | . | . | . | .
362 11: . | . | . | . | . | . | . | .
363 12: C-2 1 2A | C-5 2 20 | G-1 3 2A | G-1 4 32 | A#3 5 24 | D-4 6 22 | . | .
364 13: . | . | . | . | . | . | . | .
365 14: C-2 1 28 | . | G-1 3 26 E92 | G-1 4 30 | . | . | . | .
366 15: . | C-5 2 1C | . | . | . | . | . | .
367}
368# Phrase: A — dominant tension, riser, timpani rolls
369pattern 12 rows=16 {
370 0: C-2 1 38 | . | A-1 3 32 | A-1 4 38 | A-2 5 28 | A-3 6 26 | E-5 7 22 S60 | C-4 8 28 SFF
371 1: . | . | . | . | . | . | . | .
372 2: C-2 1 26 | . | . | A-1 4 30 | . | . | . | .
373 3: . | C-5 2 1E | . | . | C#4 5 24 | . | . | .
374 4: C-2 1 2E | . | A-1 3 2E | A-1 4 32 | . | E-4 6 24 | . | .
375 5: . | C-5 2 1C | . | . | . | . | . | .
376 6: C-2 1 28 | . | . | A-1 4 30 | E-4 5 24 | . | . | .
377 7: . | C-5 2 1C | . | . | . | . | . | .
378 8: C-2 1 32 | C-5 2 20 | A-1 3 30 | A-1 4 34 | A-2 5 26 | A-3 6 26 | A-5 7 24 S70 | .
379 9: . | C-5 2 1C | . | . | . | . | . | .
380 10: C-2 1 28 | C-5 2 1E | . | A-1 4 30 | . | . | . | .
381 11: . | C-5 2 1C | off | off . . C04 | off . . C04 | off . . C04 | off . . C04 | . . . G2A
382 12: . | C-5 2 20 | A-1 3 2C E92 | . | . | . | . | . . . G22
383 13: . | C-5 2 1C | . | . | . | . | . | .
384 14: . | C-5 2 24 | A-1 3 2C E92 | . | . | . | . | . . . G1C
385 15: C-2 1 30 | C-5 2 2A | . | . | . | . | . | .
386}
387# Phrase: Dm — CLIMAX, the wooaa (first hit at 90 s): full hit, choir opens to AAH, crash
388pattern 13 rows=16 {
389 0: C-2 1 40 | . | D-1 3 3C | D-1 4 40 | D-3 5 30 | D-4 6 2E | A-4 7 30 SFF | C-4 9 2E G1E
390 1: . | . | . | . | . | . | . | .
391 2: C-2 1 2C | C-5 2 22 | . | D-2 4 38 | F-3 5 2C | F-4 6 2C | D-5 7 30 SFF | .
392 3: . | . | . | . | . | . | F-5 7 2C SFF | .
393 4: C-2 1 38 | C-5 2 26 | D-1 3 34 | D-1 4 3C | A-3 5 2C | A-4 6 2C | . | C-3 8 20 S50
394 5: . | . | . | . | . | . | . | .
395 6: C-2 1 2A | C-5 2 20 | . | D-2 4 38 | . | . | . | .
396 7: . | . | . | . | . | . | . | .
397 8: C-2 1 38 | . | D-1 3 34 | D-1 4 3C | D-3 5 2C | D-4 6 2A | A-4 7 28 SFF | .
398 9: . | . | . | . | . | . | . | .
399 10: C-2 1 28 | C-5 2 22 | . | D-2 4 36 | F-3 5 28 | F-4 6 28 | . | .
400 11: . | . | . | . | . | . | . | .
401 12: C-2 1 38 | C-5 2 24 | D-1 3 32 | D-1 4 3A | A-3 5 28 | A-4 6 28 | D-5 7 28 SFF | .
402 13: . | . | . | . | . | . | . | .
403 14: C-2 1 2C | . | A-1 3 30 | A-1 4 34 | . | . | . | .
404 15: . | C-5 2 1E | . | . | . | . | . | .
405}
406# Phrase: Bb max — soaring over the far shore
407pattern 14 rows=16 {
408 0: C-2 1 3C | . | A#1 3 38 | A#1 4 3C | A#2 5 2C | A#3 6 2C | F-4 7 2C SFF | .
409 1: . | . | . | . | . | . | . | .
410 2: C-2 1 2A | C-5 2 22 | . | A#2 4 36 | D-4 5 28 | F-4 6 2A | A#4 7 2C SFF | .
411 3: . | . | . | . | . | . | D-5 7 28 SFF | .
412 4: C-2 1 36 | C-5 2 24 | A#1 3 32 | A#1 4 38 | F-4 5 28 | D-4 6 2A | . | C-3 8 1E S50
413 5: . | . | . | . | . | . | . | .
414 6: C-2 1 28 | C-5 2 20 | . | A#2 4 34 | . | . | . | .
415 7: . | . | . | . | . | . | . | .
416 8: C-2 1 36 | . | A#1 3 32 | A#1 4 38 | A#2 5 28 | A#3 6 28 | F-4 7 26 SFF | .
417 9: . | . | . | . | . | . | . | .
418 10: C-2 1 26 | C-5 2 20 | . | A#2 4 34 | D-4 5 26 | F-4 6 26 | . | .
419 11: . | . | . | . | . | . | . | .
420 12: C-2 1 36 | C-5 2 22 | A#1 3 30 | A#1 4 36 | F-4 5 26 | D-4 6 26 | A#4 7 26 SFF | .
421 13: . | . | . | . | . | . | . | .
422 14: C-2 1 2A | . | F-2 3 2E | F-2 4 32 | . | . | . | .
423 15: . | C-5 2 1C | . | . | . | . | . | .
424}
425# Phrase: F max, starting to breathe
426pattern 15 rows=16 {
427 0: C-2 1 3C | . | F-1 3 38 | F-1 4 3C | F-3 5 2C | F-4 6 2A | A-4 7 2A SFF | .
428 1: . | . | . | . | . | . | . | .
429 2: C-2 1 28 | C-5 2 20 | . | F-2 4 36 | A-3 5 28 | A-4 6 28 | C-5 7 28 SFF | .
430 3: . | . | . | . | . | . | F-5 7 26 SFF | .
431 4: C-2 1 34 | C-5 2 22 | F-1 3 30 | F-1 4 38 | C-4 5 28 | C-5 6 28 | . | C-3 8 1C S40
432 5: . | . | . | . | . | . | . | .
433 6: C-2 1 26 | . | . | F-2 4 32 | . | . | . | .
434 7: . | . | . | . | . | . | . | .
435 8: C-2 1 34 | . | F-1 3 30 | F-1 4 36 | F-3 5 28 | F-4 6 26 | A-4 7 24 SFF | .
436 9: . | . | . | . | . | . | . | .
437 10: . | C-5 2 1E | . | F-2 4 32 | A-3 5 26 | A-4 6 24 | . | .
438 11: . | . | . | . | . | . | . | .
439 12: C-2 1 32 | C-5 2 20 | F-1 3 2E | F-1 4 34 | C-4 5 26 | C-5 6 24 | C-5 7 24 SFF | .
440 13: . | . | . | . | . | . | . | .
441 14: C-2 1 26 | . | C-2 3 2C | C-2 4 30 | . | . | . | .
442 15: . | . | . | . | . | . | . | .
443}
444# Phrase: C — release begins
445pattern 16 rows=16 {
446 0: C-2 1 30 | . | C-2 3 2E | C-2 4 34 | C-3 5 26 | C-4 6 22 | G-4 7 22 SA0 | C-3 8 18 S40
447 1: . | . | . | . | . | . | . | .
448 2: . | . | . | . | . | E-4 6 24 | E-5 7 24 SA0 | .
449 3: . | . | . | . | . | . | . | .
450 4: . | . | . | . | E-3 5 26 | G-4 6 24 | . | .
451 5: . | . | . | . | . | . | . | .
452 6: . | . | . | . | . | . | . | .
453 7: . | . | . | . | . | . | . | .
454 8: . | . | C-2 3 2C | C-2 4 32 | G-3 5 26 | . | . | .
455 9: . | . | . | . | . | . | . | .
456 10: . | . | . | . | . | . | . | .
457 11: . | . | . | . | . | . | . | .
458 12: . | C-5 2 1A | . | . | . | . | . | .
459 13: . | . | . | . | . | . | . | .
460 14: . | . | G-1 3 28 | G-1 4 2C | . | . | . | .
461 15: . | . | . | . | . | . | . | .
462}
463# Phrase: Dm — drums let go, pads ring
464pattern 17 rows=16 {
465 0: C-2 1 22 | . | D-1 3 20 | D-1 4 2C | D-3 5 20 | D-4 6 16 | A-4 7 1A S50 | .
466 1: . | . | . | . | . | . | . | .
467 2: . | . | . | . | . | . | . | .
468 3: . | . | . | . | . | . | . | .
469 4: . | . | . | . | F-3 5 20 | . | . | C-3 8 20 S40
470 5: . | . | . | . | . | . | . | .
471 6: . | . | . | . | . | . | . | .
472 7: . | . | . | . | . | . | . | .
473 8: . | . | . | . | A-3 5 20 | A-4 6 16 | D-5 7 1A S50 | .
474 9: . | . | . | . | . | . | . | .
475 10: . | . | . | . | . | . | . | .
476 11: . | . | . | . | . | . | . | .
477 12: . | . | . | . | . | . | . | .
478 13: . | . | . | . | . | . | . | .
479 14: . | . | . | . | . | . | . | .
480 15: . | . | . | . | . | . | . | .
481}
482# Phrase: outro — everything releases into the light
483pattern 18 rows=16 {
484 0: C-2 1 14 | . | D-2 3 14 | D-1 4 1C | D-3 5 18 | D-4 6 0E | A-4 7 14 S40 | C-3 8 1C S60
485 1: . | . | . | . | . | . | . | .
486 2: . | . | . | . | . | . | . | .
487 3: . | . | . | . | . | . | . | .
488 4: . | . | . | . | F-3 5 18 | . | D-5 7 16 S40 | .
489 5: . | . | . | . | . | . | . | .
490 6: . | . | . | . | . | . | . | .
491 7: . | . | . | . | . | . | . | .
492 8: . | . | . | . | A-3 5 18 | F-4 6 10 | . | .
493 9: . | . | . | . | . | . | . | off
494 10: . | . | . | off | . | . | . | .
495 11: . | . | . | . | . | . | . | .
496 12: . | . | . | . | off | off | . | .
497 13: . | . | . | . | . | . | off | .
498 14: . | . | . | . | . | . | . | .
499 15: . | . | . | . | . | . | . | .
500}
502# ------------------------------------------------------------------ terrain
503# ridged fbm heightfield; a valley corridor follows pathx(z); a basin at
504# (-1.32, 75) and another at pathx(155) sink below sea level 0.30.
505fn pathx(z) {
506 return 1.1 * sin(z * 0.055) + 0.45 * sin(z * 0.13 + 1.7)
507}
508fn terra(px, pz) {
509 f1 = fbm(px * 0.15, pz * 0.15, 4)
510 r = 1 - abs(f1 * 2 - 1)
511 th = r * r * sqrt(r) * 3.35 - 0.55
512 dv = px - pathx(pz)
513 vk = 1 - smooth(1.0, 4.2, abs(dv))
514 th = mix(th, 0.45 + 0.25 * r, vk)
515 db = len(px + 1.32, pz - 75.0)
516 th = th - 2.8 * (1 - smooth(3.0, 10.0, db))
517 db = len(px - pathx(155), pz - 155)
518 th = th - 3.0 * (1 - smooth(3.5, 11.0, db))
519 return th
520}
521fn terraC(px, pz) {
522 f1 = fbm(px * 0.15, pz * 0.15, 2)
523 r = 1 - abs(f1 * 2 - 1)
524 th = r * r * sqrt(r) * 3.35 - 0.55
525 dv = px - pathx(pz)
526 vk = 1 - smooth(1.0, 4.2, abs(dv))
527 th = mix(th, 0.45 + 0.25 * r, vk)
528 db = len(px + 1.32, pz - 75.0)
529 th = th - 2.8 * (1 - smooth(3.0, 10.0, db))
530 db = len(px - pathx(155), pz - 155)
531 th = th - 3.0 * (1 - smooth(3.5, 11.0, db))
532 return th
533}
534# sky: contained low sun at (-0.3036, 0.2024, 0.9312), blue-grey gradient,
535# wispy streak clouds, contrails, horizon-localised flashes.
536# cl: 0 = plain (fog/reflections), 1 = +sun, 2 = +clouds+trails.
537fn sky(dx, dy, dz, cl) {
538 sd = dx * -0.3036 + dy * 0.2024 + dz * 0.9312
539 k = clamp(dy * 1.6 + 0.10, 0, 1)
540 k = k ^ 0.9
541 wt = max(sd, 0)
542 wt = wt * wt * wt
543 r = mix(0.52, 0.16, k) + wt * 0.20
544 g = mix(0.60, 0.30, k) + wt * 0.06
545 b = mix(0.66, 0.52, k) - wt * 0.08
546 if (cl > 0.5) {
547 g1 = max(sd, 0)
548 g32 = g1 ^ 32
549 halo = g32 * 0.50 + g1 ^ 6 * 0.06
550 disc = smooth(0.99960, 0.99980, sd) * 2.6
551 r = r + halo + disc
552 g = g + halo * 0.88 + disc * 0.95
553 b = b + halo * 0.66 + disc * 0.88
554 }
555 if (cl > 1.5) {
556 if (dy > 0.015) {
557 fac = min((9.0 - camy) / max(dy, 0.025), 130)
558 cxp2 = camx + dx * fac
559 czp2 = camz + dz * fac
560 cc = fbm(cxp2 * 0.018 + t * 0.008, czp2 * 0.085, 3)
561 cmask = smooth(0.55, 0.74, cc) * smooth(0.03, 0.16, dy) * 0.55
562 cr2 = mix(0.40, 0.78, wt)
563 cg2 = mix(0.44, 0.74, wt)
564 cb2 = mix(0.50, 0.68, wt)
565 r = mix(r, cr2, cmask)
566 g = mix(g, cg2, cmask)
567 b = mix(b, cb2, cmask)
568 # world-anchored contrail pair on the cloud plane
569 tr = exp(-abs(czp2 - 40.0) * 0.9) * 0.20 + exp(-abs(czp2 - 41.1) * 2.2) * 0.12
570 tr = tr * smooth(60, 15, abs(cxp2 - 20)) * smooth(0.05, 0.15, dy)
571 r = r + tr
572 g = g + tr * 0.95
573 b = b + tr * 0.9
574 }
575 }
576 fl = flashE * smooth(-0.02, 0.15, dy)
577 r = r + fl * (0.22 + 0.30 * wt)
578 g = g + fl * (0.25 + 0.30 * wt)
579 b = b + fl * (0.34 + 0.30 * wt)
580 rgb(r, g, b)
581}
582fn textline(s, px, py, sz) {
583 cx = (u - px) / sz
584 cy = (py - v) / sz
585 i = floor(cx)
586 return glyph(str(s, i), fract(cx), fract(cy)) * step(0, cx) * step(cx, strlen(s)) * step(0, cy) * step(cy, 1)
587}
589uniform camx camy camz cyaw cpit crol flashE wooaa mistK fogK taiE sunU sunV sunVis mbK
591# Integral of a linear speed change. Position is absolute, so playback,
592# low frame rates and direct seeks follow exactly the same route.
593fn travel(tim, start, end, delta) {
594 dt = clamp(tim - start, 0, end - start)
595 return delta * (dt * dt / (2 * (end - start)) + max(tim - end, 0))
596}
597fn routez(tim) {
598 # speeds: 1.2 -> 1.4 -> 1.8 -> 2.4 -> 2.0 -> 1.7 -> 2.1
599 # -> 2.3 -> 1.9 -> 1.5 -> 1.2 world units / second.
600 z = tim * 1.2 + travel(tim, 0, 5, 0.2) + travel(tim, 5, 15, 0.4)
601 z = z + travel(tim, 15, 25, 0.6) + travel(tim, 25, 40, -0.4)
602 z = z + travel(tim, 40, 55, -0.3) + travel(tim, 55, 65, 0.4)
603 z = z + travel(tim, 65, 80, 0.2) + travel(tim, 80, 85, -0.4)
604 z = z + travel(tim, 85, 90, -0.4) + travel(tim, 90, 100, -0.3)
605 return z
606}
608frame {
609 camz = routez(t)
610 cx0 = pathx(camz)
611 camx = cx0 + 0.35 * sin(t * 0.21)
612 gnd = terra(camx, camz)
613 grn = max(gnd, 0.30)
614 camy = max(evtl(alt), grn + 0.55) + 0.05 * sin(t * 1.6) + 0.03 * sin(t * 2.7)
615 shk = evtl(shake)
616 cyaw = 0.10 * sin(t * 0.13) + (hash(frame * 3.17) - 0.5) * 0.022 * shk
617 cpit = evtl(pitch) + (hash(frame * 7.71) - 0.5) * 0.015 * shk
618 crol = 0.03 * sin(t * 0.09) + (hash(frame * 5.33) - 0.5) * 0.02 * shk
619 fl = step(10, t) * exp(-(t - 10) * 4.0) * 0.30 + step(90, t) * exp(-(t - 90) * 2.2) * 0.50
620 flashE = fl * (0.7 + 0.3 * hash(frame * 9.13))
621 wooaa = step(89.9, t) * exp(-(t - 89.9) * 1.0)
622 mistK = evtl(mist)
623 fogK = evtl(fog)
624 taiE = exp(-trig(0) * 5)
625 mbK = evtl(mbK)
626 # project the sun to screen space (inverse of the pixel ray construction)
627 sxz = rot(-0.3036, 0.9312, -cyaw)
628 sz2 = r1
629 kk = 1.42 / max(sz2, 0.05)
630 bx0 = sxz * kk
631 by0 = 0.2024 * kk
632 sunU = rot(bx0, by0, -crol)
633 sunV = r1 + cpit
634 # sun visibility: five coarse probes along the sun ray
635 svis = 0
636 repeat q 5 {
637 qt = 2 + q * 4
638 qy = camy + 0.2024 * qt
639 svis = svis + (terra(camx - 0.3036 * qt, camz + 0.9312 * qt) < qy ? 1 : 0)
640 }
641 sunVis = svis * 0.2
642}
644pixel {
645 # --- primary ray: pitch offset, roll, yaw, normalise
646 d0x = u
647 d0y = v - cpit
648 d0z = 1.42
649 rx = rot(d0x, d0y, crol)
650 ry = r1
651 fx2 = rot(rx, d0z, cyaw)
652 fz = r1
653 dl = len(len(fx2, fz), ry) + 0.0001
654 dx = fx2 / dl
655 dy = ry / dl
656 dz = fz / dl
657 # --- sky and fog colours
658 sky(dx, dy, dz, 2)
659 cr = cget(0)
660 cg = cget(1)
661 cb = cget(2)
662 skyR = cr
663 skyG = cg
664 skyB = cb
665 sky(dx, max(dy, 0.03), dz, 0)
666 fr = cget(0)
667 fg = cget(1)
668 fb = cget(2)
669 # --- analytic sea-plane crossing (grazing rays converge too slowly onto
670 # flat water, so the plane is intersected exactly)
671 twat = 1000000
672 if (dy < -0.002 && camy > 0.31) {
673 twat = (camy - 0.30) / (-dy)
674 }
675 # --- terrain march over the unclamped heightfield
676 tt = 0.05
677 d = 1
678 hit = 0
679 # terra never exceeds 2.8: only upward rays above that bound can be culled.
680 # Grazing rays need more steps; stop evaluating the field once converged.
681 if (camy < 2.8 || dy < 0) {
682 repeat i 192 {
683 if (hit < 0.5 && tt < 160) {
684 px = camx + dx * tt
685 py = camy + dy * tt
686 pz = camz + dz * tt
687 d = py - terra(px, pz)
688 if (d < 0.003 + tt * 0.0008) {
689 hit = 1
690 } else {
691 # A height difference is not a signed distance: cap steps so a
692 # steep ridge cannot be jumped over on the descent from altitude.
693 tt = tt + min(d * 0.45, 1.5)
694 }
695 }
696 }
697 }
698 # --- winner: terrain if it beats the sea crossing, else the sea
699 isLand = 0
700 isWater = 0
701 pxw = 0
702 pzw = 0
703 if (hit > 0.5 && tt < twat) {
704 isLand = 1
705 }
706 if (isLand < 0.5 && twat < 400) {
707 pxw = camx + dx * twat
708 pzw = camz + dz * twat
709 if (terra(pxw, pzw) < 0.295) {
710 isWater = 1
711 }
712 }
713 px = 0
714 py = 0
715 pz = 0
716 hh = 1
717 if (isWater > 0.5) {
718 tt = twat
719 px = pxw
720 py = 0.30
721 pz = pzw
722 hh = terra(px, pz)
723 # ripple normal (hard distance fade kills the Nyquist grid)
724 rnf = exp(-tt * 0.15)
725 rn1 = 0.05 * sin(px * 6.3 + t * 1.9) + 0.03 * sin(pz * 9.7 - t * 1.3)
726 rn1 = rn1 + 0.09 * (fbm(px * 1.1 + t * 0.10, pz * 1.1, 1) - 0.5)
727 rn2 = 0.05 * sin(pz * 7.1 - t * 1.6) + 0.03 * sin(px * 11.3 + t * 1.0)
728 rn2 = rn2 + 0.09 * (fbm(px * 0.9, pz * 0.9 - t * 0.09, 1) - 0.5)
729 rn1 = rn1 * rnf
730 rn2 = rn2 * rnf
731 ndv = dx * rn1 + dy + dz * rn2
732 rdx = dx - 2 * ndv * rn1
733 rdy = dy - 2 * ndv
734 rdz = dz - 2 * ndv * rn2
735 rl = len(len(rdx, rdz), rdy) + 0.0001
736 rdx = rdx / rl
737 rdy = rdy / rl
738 rdz = rdz / rl
739 rhit = 0
740 rt = 0.25
741 rd2 = 99
742 rtb = 40
743 if (rdy > 0.005) {
744 repeat j 12 {
745 rt = rt * 1.55
746 qx = px + rdx * rt
747 qy = 0.31 + rdy * rt
748 qz = pz + rdz * rt
749 dq = qy - max(terraC(qx, qz), 0.30)
750 if (dq < rd2) {
751 rd2 = dq
752 rtb = rt
753 }
754 }
755 rhit = 1 - smooth(0.0, 0.10 + rtb * 0.010, rd2)
756 }
757 sky(rdx, max(rdy, 0.02), rdz, 0)
758 rr2 = cget(0) * 0.62
759 rg2 = cget(1) * 0.62
760 rb2 = cget(2) * 0.62
761 rf = 1 - exp(-rtb * 0.022)
762 mrr = mix(0.10, fr, rf)
763 mrg = mix(0.115, fg, rf)
764 mrb = mix(0.14, fb, rf)
765 rr2 = mix(rr2, mrr, rhit)
766 rg2 = mix(rg2, mrg, rhit)
767 rb2 = mix(rb2, mrb, rhit)
768 gl0 = max(rdx * -0.3036 + rdy * 0.2024 + rdz * 0.9312, 0)
769 gl8 = gl0 ^ 8
770 sheen = gl8 * gl8 * 0.35
771 glint = gl8 * gl8 * 1.3 * (0.3 + 0.7 * rnf)
772 f0 = max(-dy, 0.001)
773 fres = 0.04 + 0.96 * (1 - f0) ^ 5
774 shallow = smooth(0.10, 0.28, hh)
775 deepr = mix(0.018, 0.045, shallow)
776 deepg = mix(0.042, 0.095, shallow)
777 deepb = mix(0.058, 0.120, shallow)
778 cr = mix(deepr, rr2, fres) + sheen * 1.25 + glint * 1.3
779 cg = mix(deepg, rg2, fres) + sheen * 1.00 + glint * 1.0
780 cb = mix(deepb, rb2, fres) + sheen * 0.72 + glint * 0.8
781 }
782 if (isLand > 0.5) {
783 px = camx + dx * tt
784 py = camy + dy * tt
785 pz = camz + dz * tt
786 hh = terra(px, pz)
787 # --- dark rock & snow: forward-difference normal + ridged crag detail
788 e2 = 0.03 + tt * 0.0006
789 nxx = hh - terra(px + e2, pz)
790 nzz = hh - terra(px, pz + e2)
791 nl = len(len(nxx, nzz), e2) + 0.0001
792 nxx = nxx / nl
793 nyy = e2 / nl
794 nzz = nzz / nl
795 det = 0.5
796 det2 = 0.5
797 if (tt < 30) {
798 det = 1 - abs(fbm(px * 2.0, pz * 2.0, 2) * 2 - 1)
799 det2 = 1 - abs(fbm(px * 2.0 + 7.7, pz * 2.0 + 3.1, 2) * 2 - 1)
800 }
801 # crag: perturb the normal with the detail field
802 nxx = nxx + (det - 0.62) * 0.8
803 nzz = nzz + (det2 - 0.62) * 0.8
804 nl = len(len(nxx, nzz), nyy) + 0.0001
805 nxx = nxx / nl
806 nyy = nyy / nl
807 nzz = nzz / nl
808 dnl = nxx * -0.3036 + nyy * 0.2024 + nzz * 0.9312
809 diff = max(dnl, 0)
810 wrap = clamp((dnl + 0.50) / 1.5, 0, 1)
811 # strata banding + dark olive-grey rock with warm patches
812 st = 0.70 + 0.30 * sin(py * 7.0 + det * 5.0)
813 rockr = 0.150 + 0.155 * det + 0.045 * st
814 rockg = 0.145 + 0.140 * det + 0.040 * st
815 rockb = 0.135 + 0.130 * det2 + 0.030 * st
816 # snow only on flatter surfaces above the snow line
817 snowK = smooth(1.22, 1.62, py + 0.35 * (det - 0.5)) * smooth(0.60, 0.78, nyy)
818 colr = mix(rockr, 0.78, snowK)
819 colg = mix(rockg, 0.80, snowK)
820 colb = mix(rockb, 0.84, snowK)
821 amb = 0.34 + 0.22 * nyy
822 cr = colr * (amb * 0.62 + diff * 1.45 + wrap * 0.22)
823 cg = colg * (amb * 0.78 + diff * 1.10 + wrap * 0.18)
824 cb = colb * (amb * 1.05 + diff * 0.72 + wrap * 0.14)
825 # sun-lit sparkle grain (near field only)
826 sp = step(0.9962, hash(px * 37.7 + pz * 91.3)) * diff * exp(-tt * 0.05)
827 cr = cr + sp * 0.35
828 cg = cg + sp * 0.33
829 cb = cb + sp * 0.30
830 wet = 1 - smooth(0.32, 0.60, py)
831 cr = cr * (1 - wet * 0.45)
832 cg = cg * (1 - wet * 0.40)
833 cb = cb * (1 - wet * 0.30)
834 # foam waterline anchors the shore
835 shore = smooth(0.30, 0.335, py) * (1 - smooth(0.345, 0.42, py))
836 foam = shore * (0.5 + 0.5 * sin(px * 13.0 + pz * 9.0 + t * 0.9))
837 cr = cr + foam * 0.14
838 cg = cg + foam * 0.15
839 cb = cb + foam * 0.15
840 }
841 # --- aerial perspective + valley mist for whichever surface won
842 if (isLand + isWater > 0.5) {
843 fogf = 1 - exp(-tt * 0.020 * fogK)
844 fogf = fogf + smooth(45, 80, tt) * 0.22
845 mistf = mistK * (1 - exp(-tt * 0.05)) * exp(-max(py - 1.0, 0) * 0.9) * 0.32
846 ff2 = min(fogf + mistf, 0.97)
847 cr = mix(cr, fr, ff2)
848 cg = mix(cg, fg, ff2)
849 cb = mix(cb, fb, ff2)
850 # Become the actual sky before the finite trace ends. No visible far edge,
851 # even at the summit with the thinnest fog; applies to water as well.
852 horizon = smooth(100, 150, tt)
853 cr = mix(cr, skyR, horizon)
854 cg = mix(cg, skyG, horizon)
855 cb = mix(cb, skyB, horizon)
856 }
857 rgb(cr, cg, cb)
858 cmul(1 + flashE * 0.15 + wooaa * 0.08 + taiE * 0.04)
859 # --- title & credit
860 tA = smooth(0.8, 2.0, t) * (1 - smooth(5.5, 7.5, t))
861 ttl = textline(ttl1, -0.96, 0.10, 0.24) * tA
862 glo = textline(ttl1, -0.955, 0.105, 0.24) * tA
863 cadd(ttl * 0.9 + glo * 0.2, ttl * 0.88 + glo * 0.18, ttl * 0.95 + glo * 0.25)
864 cA = smooth(2.0, 3.0, t) * (1 - smooth(11.0, 13.0, t))
865 crd = textline(cred, -0.82, -0.78, 0.05) * cA
866 cadd(crd * 0.7, crd * 0.72, crd * 0.75)
867 cprev(x, y, 0.08)
868}
870fn tone(x) {
871 return 1.30 * x / (1 + 0.38 * x * x)
872}
874post {
875 # --- horizontal streak blur, strongest during the fast low flight
876 mof = 1.5 + 5.0 * mbK
877 cr = cget(0)
878 cg = cget(1)
879 cb = cget(2)
880 t1 = tap(-mof, 0)
881 g1b = r1
882 b1b = r2
883 t2 = tap(-mof * 0.45, 0)
884 g2b = r1
885 b2b = r2
886 t3 = tap(mof * 0.45, 0)
887 g3b = r1
888 b3b = r2
889 t4 = tap(mof, 0)
890 g4b = r1
891 b4b = r2
892 blk = mbK * 0.8
893 cr = mix(cr, (cr * 2 + t1 + t2 + t3 + t4) * 0.1667, blk)
894 cg = mix(cg, (cg * 2 + g1b + g2b + g3b + g4b) * 0.1667, blk)
895 cb = mix(cb, (cb * 2 + b1b + b2b + b3b + b4b) * 0.1667, blk)
896 # --- small bloom
897 bl = (tap(-2, 0) + tap(2, 0) + tap(0, -2) + tap(0, 2)) * 0.25
898 cr = cr + bl * (0.16 + 0.14 * wooaa)
899 cg = cg + bl * (0.15 + 0.12 * wooaa)
900 cb = cb + bl * (0.17 + 0.13 * wooaa)
901 # --- chromatic fringe
902 rsh = tap(1.2 + 2 * flashE + mbK, 0)
903 cr = mix(cr, rsh, 0.22)
904 bsh = tap(-1.2 - 2 * flashE - mbK, 0)
905 cb = mix(cb, r2, 0.22)
906 # --- lens flare around the (occlusion-tested) sun
907 du = u - sunU
908 dv = v - sunV
909 anam = exp(-abs(dv) * 48) * exp(-abs(du) * 2.0)
910 diag = exp(-abs(dv - du * 0.45) * 60) * exp(-abs(du) * 2.6)
911 core2 = exp(-len(du, dv) * 9)
912 fla = (anam * 0.40 + diag * 0.30 + core2 * 0.50) * sunVis
913 cr = cr + fla
914 cg = cg + fla * 0.86
915 cb = cb + fla * 0.72
916 # --- exposure flicker + flash lift, then highlight-rolling tonemap
917 fl2 = 1 + (hash(frame * 13.71) - 0.5) * 0.06 + flashE * 0.18
918 cr = tone(cr * fl2)
919 cg = tone(cg * fl2)
920 cb = tone(cb * fl2)
921 rgb(cr, cg, cb)
922 dd = len(u, v)
923 cmul(1 - 0.16 * dd * dd)
924 gn = hash(x * w * 0.37 + y * h * 1.13 + frame * 7.7) - 0.5
925 cadd(gn * 0.040, gn * 0.037, gn * 0.044)
926 cmul(smooth(0.0, 1.1, t))
927 wk = smooth(115.0, 119.8, t)
928 cr2 = cget(0)
929 cg2 = cget(1)
930 cb2 = cget(2)
931 rgb(mix(cr2, 1.02, wk * 0.88), mix(cg2, 0.99, wk * 0.88), mix(cb2, 0.95, wk * 0.88))
932}
Click a line number to link to that line.
← DUNES