1format: tdn
2version: '2.0'
3build: null
4generator: Embody/6.0.15
5td_build: 099.2025.32820
6source_file: Embody-6.15.toe
7exported_at: '2026-06-11T03:24:04Z'
8network_path: /specimen_lab/noise_terrain
9options:
10 include_dat_content: true
11 include_storage: true
12type_defaults:
13 infoDAT:
14 flags:
15 - viewer
16 size: [130, 90]
17 color: [0.67, 0.67, 0.67]
18 textDAT:
19 parameters:
20 language: glsl
21 flags:
22 - viewer
23 size: [130, 90]
24 color: [0.67, 0.67, 0.67]
25 mergePOP:
26 flags:
27 - viewer
28 size: [130, 90]
29 color: [0.67, 0.67, 0.67]
30 circlePOP:
31 parameters:
32 connectivity: surface
33 flags:
34 - viewer
35 size: [130, 90]
36 color: [0.67, 0.67, 0.67]
37 primitivePOP:
38 parameters:
39 addpts: true
40 size: [130, 90]
41 color: [0.67, 0.67, 0.67]
42 tubePOP:
43 parameters:
44 orient: z
45 rows: 2
46 flags:
47 - viewer
48 size: [130, 90]
49 color: [0.67, 0.67, 0.67]
50 annotateCOMP:
51 parameters:
52 order: =me.digits or 0
53 layerzone: =0 if hasattr(me, 'EncloseOPs') and me.EncloseOPs else 1
54 flags:
55 - display
56 color: [0.45, 0.45, 0.45]
57par_templates:
58 about:
59 - default: '1.0'
60 help: Annotate COMP default setup version.
61 name: Version
62 readOnly: true
63 startSection: true
64 style: Str
65 - help: Click to open help page.
66 name: Help
67 style: Pulse
68 text:
69 - default: Annotate
70 help: Text in the title bar.
71 label: Title Text
72 name: Titletext
73 startSection: true
74 style: Str
75 - clampMin: true
76 default: 30
77 help: Height of the title bar. Title font height adjusts automatically to fill.
78 label: Title Height
79 name: Titleheight
80 normMax: 100.0
81 normMin: 5.0
82 style: Int
83 - default: left
84 help: Alignment of title text.
85 label: Title Align
86 menuLabels:
87 - Left
88 - Center
89 - Right
90 menuNames:
91 - left
92 - center
93 - right
94 name: Titlealign
95 style: Menu
96 - help: Text in the body area. Use an expression for newlines etc.
97 label: Body Text
98 name: Bodytext
99 startSection: true
100 style: Str
101 - clampMin: true
102 default: 10
103 help: Size of text in the body area.
104 label: Body Font Size
105 name: Bodyfontsize
106 normMax: 100.0
107 normMin: 8.0
108 style: Int
109 - help: Limit the width of the text area.
110 label: Limit Body Text Width
111 name: Bodylimitwidth
112 style: Toggle
113 - clampMin: true
114 default: 1000
115 help: Width limit that will cause wraparound or cut-off. Measured in Panel units.
116 label: Max Body Text Width
117 name: Bodymaxwidth
118 normMax: 2000.0
119 normMin: 100.0
120 style: Int
121 settings:
122 - default: comment
123 help: 'Switch between Comment, Network Box, and Annotate Modes. '
124 menuLabels:
125 - Comment
126 - Network Box
127 - Annotate
128 menuNames:
129 - comment
130 - networkbox
131 - annotate
132 name: Mode
133 style: Menu
134 - help: Converts quotes, ellipsis, and dashes to more typographically nice unicode versions.
135 label: Smart Quote
136 name: Smartquote
137 startSection: true
138 style: Toggle
139 - default: true
140 help: Wrap body text when it extends past right bound.
141 label: Body Word Wrap
142 name: Bodywordwrap
143 style: Toggle
144 - default: 1
145 help: Background color base.
146 label: Back Color
147 name: Backcolorr
148 startSection: true
149 style: RGBA
150 - clampMax: true
151 clampMin: true
152 default: 1
153 help: Back color alpha.
154 label: Back Color Alpha
155 name: Backcoloralpha
156 style: Float
157 - clampMax: true
158 clampMin: true
159 default: 1
160 help: Opacity of the entire Annotate.
161 label: Annotate Opacity
162 name: Opacity
163 style: Float
164 op_viewer:
165 - help: Turn the visibility of the viewer specified in the OP parameter below on or off.
166 label: Viewer Display
167 name: Opviewerdisplay
168 style: Toggle
169 - help: The operator whose viewer is displayed in the Annotate.
170 label: OP
171 name: Opviewer
172 style: OP
173 - help: Allow interaction with the OP viewer.
174 label: OP Viewer Interactive
175 name: Opviewerinteractive
176 style: Toggle
177 - default: 'False'
178 help: Use the Size/Aspect Override to control viewer's size in the background.
179 label: Size/Aspect Override
180 menuLabels:
181 - Natural
182 - Specify
183 - Auto-Fit
184 menuNames:
185 - natural
186 - specify
187 - autofit
188 name: Opvieweroversize
189 startSection: true
190 style: Menu
191 - clampMin: true
192 default: 800
193 help: Diplay viewer as-if it were being displayed at this resolution. This is particularly useful for zooming into operators that don't have a built-in resolution, like CHOPs, SOPs, and DATs.
194 label: Size/Aspect
195 name: Opviewersize
196 normMax: 1000.0
197 normMin: 1.0
198 style: WH
199 - default: 1
200 help: Scale the viewer by this factor.
201 label: Scale
202 name: Opviewerscale
203 normMax: 2.0
204 startSection: true
205 style: Float
206 - help: Move the border of the viewer towards left edge of Annotate when negative or towards right edge when positive.
207 label: Justify X
208 name: Opviewerjustifyx
209 normMin: -1.0
210 style: Float
211 - label: Justify Y
212 name: Opviewerjustifyy
213 normMin: -1.0
214 style: Float
215 - help: When True, allow viewer to display in the Annotate title area as well as body.
216 label: Cover Body and Title
217 name: Opviewerfillbodytitle
218 style: Toggle
219 - clampMin: true
220 default: 1
221 help: Zoom the viewer by this scale factor without increasing the size of its display area in the Annotate.
222 label: OP Viewer Zoom
223 min: 0.001
224 name: Opviewerzoom
225 normMax: 5.0
226 normMin: 1.0
227 startSection: true
228 style: Float
229 - help: Offsets the displayed area within the viewer. Combined with OP Viewer Zoom, this lets you display a specific area of a viewer, such as a CHOP channel or table cell.
230 label: OP Viewer Offset
231 name: Opvieweroffsetx
232 style: XYZW
233 - clampMax: true
234 clampMin: true
235 default: 1
236 help: Alpha value of the background area in the OP Viewer.
237 label: Fill Alpha
238 name: Opviewerfillalpha
239 startSection: true
240 style: Float
241 points:
242 - label: Point
243 name: pt
244 style: Sequence
245 - label: Position
246 name: Posx
247 sequence: pt
248 style: XYZW
249type: baseCOMP
250custom_pars:
251 Terrain:
252 - name: Height
253 style: Float
254 startSection: true
255 default: 1
256 max: 2.0
257 clampMin: true
258 clampMax: true
259 normMax: 2.0
260 help: Overall vertical scale of the terrain. Master multiplier on all three noise displacement amplitudes, preserving their 2.9 / 1.0 / 0.25 ratio so peaks and fine relief grow in proportion. 1.0 = the shipped look; 0 = a flat plane; 2 = double-height alpine peaks.
261 - name: Ridge
262 style: Float
263 default: 1.6
264 min: 1.0
265 max: 3.0
266 clampMin: true
267 normMin: 1.0
268 normMax: 3.0
269 help: Ridge sharpness of the mountains. Higher values carve sharper, more knife-edged ridgelines and deeper valleys; lower values give rounder, more eroded hills. 1.6 = the shipped look.
270 - name: Warp
271 style: Float
272 default: 1.2
273 max: 2.5
274 clampMin: true
275 normMax: 2.5
276 help: Domain warp amount. Bends the noise domain so ridgelines flow organically instead of aligning to a grid. 0 = regular and repetitive; 1.2 = the shipped look; higher = more chaotic, swirling ridges.
277 - name: Detail
278 style: Float
279 default: 1
280 max: 2.0
281 clampMin: true
282 clampMax: true
283 normMax: 2.0
284 help: Surface micro-detail and ruggedness, applied cheaply in the shader as normal-map bump strength (no mesh change, so no triangulation cost or facet artifacts). Scales the shipped bump strength of 0.17. 1.0 = the shipped look; 0 = smooth shading; 2 = heavily rugged rock.
285 - name: Snowline
286 style: Float
287 label: Snow Line
288 startSection: true
289 default: 1.6
290 max: 4.0
291 clampMin: true
292 normMax: 4.0
293 help: World-Y elevation where snow begins to cover the rock. Peaks reach roughly 0 to 4 at Height 1.0, so 1.6 sits mid-slope (the shipped look). Lower the value to blanket the terrain in snow; the slider covers 0 to 4, but you can type higher to clear taller peaks at high Height, leaving only bare rock.
294 - name: Sundiraz
295 style: Float
296 label: Sun Azimuth
297 startSection: true
298 default: -41.6335393366
299 min: -180.0
300 max: 180.0
301 normMin: -180.0
302 normMax: 180.0
303 help: Compass direction of the sunlight, in degrees in the horizontal plane. 0 points toward +Z (into the scene), +90 toward +X (right), -90 toward -X (left). Combined with Sun Elevation it is converted to a guaranteed unit light direction, so it can never produce a zero-length (NaN) vector. Controls which side of the ridges is lit.
304 - name: Sundirel
305 style: Float
306 label: Sun Elevation
307 default: 49.3007177907
308 max: 90.0
309 clampMin: true
310 clampMax: true
311 normMax: 90.0
312 help: Height of the sun above the horizon, in degrees. 0 = sun on the horizon (long raking shadows, warm grazing light); 90 = directly overhead (flat, even light). Controls shadow length and contrast. The default matches the shipped sun direction.
313 - name: Haze
314 style: Float
315 startSection: true
316 default: 1
317 max: 2.0
318 clampMin: true
319 clampMax: true
320 normMax: 2.0
321 help: Atmospheric haze amount, a multiplier on the computed distance fog and valley mist. 0 = perfectly clear air; 1.0 = the shipped atmosphere; up to 2 = thick, hazy depth that washes out distant peaks. The blend is re-clamped in the shader so it can never fully erase the scene.
322 - name: Morphspeed
323 style: Float
324 label: Morph Speed
325 startSection: true
326 default: 1
327 max: 3.0
328 clampMin: true
329 normMax: 3.0
330 help: Rate at which the terrain shape evolves over time, driving the 4D-noise time coordinate of all three layers while preserving their 0.04 / 0.085 / 0.15 speed ratio. 0 = frozen on a fixed, deterministic frame; 1.0 = the shipped pace; 3 = rapid morphing.
331 - name: Seed
332 style: Int
333 startSection: true
334 default: 1
335 max: 9999.0
336 clampMin: true
337 normMax: 100.0
338 help: Random seed for the terrain shape. Each value produces a completely different but equally plausible mountain. The three noise layers receive this value plus a fixed per-layer offset (+0, +1, +2) so they stay decorrelated. Default 1 reproduces the shipped seeds 1 / 2 / 3.
339flags:
340- viewer
341color: [0.67, 0.67, 0.67]
342operators:
343- name: cam
344 type: cameraCOMP
345 parameters:
346 ty: 6.2
347 tz: 16
348 rx: -13
349 flags:
350 - display
351 position: [500, -330]
352 size: [160, 130]
353 color: [0.67, 0.67, 0.67]
354 children:
355 - name: file1
356 type: fileinPOP
357 parameters:
358 file: =app.samplesFolder + '/Geo/defcam.tog'
359 flags:
360 - display
361 - viewer
362 size: [130, 90]
363 color: [0.67, 0.67, 0.67]
364- name: geo
365 type: geometryCOMP
366 parameters:
367 material: glsl_snow
368 flags:
369 - display
370 - render
371 size: [160, 130]
372 color: [0.67, 0.67, 0.67]
373 children:
374 - name: null_geo
375 type: nullPOP
376 flags:
377 - render
378 position: [1200, 0]
379 size: [130, 90]
380 color: [0.67, 0.67, 0.67]
381 inputs:
382 - facet_normals
383 - name: glsl_terrain
384 type: glslPOP
385 parameters:
386 computedat: glsl_terrain_compute
387 outputattrs: '*'
388 sequences:
389 vec:
390 - name: uShape
391 type: vec4
392 valuex: =parent(2).par.Height.eval()
393 valuey: =parent(2).par.Ridge.eval()
394 valuez: =parent(2).par.Warp.eval()
395 valuew: =parent(2).par.Seed.eval()
396 - name: uTime
397 type: vec4
398 valuex: =absTime.seconds*parent(2).par.Morphspeed.eval()
399 position: [400, 0]
400 size: [130, 90]
401 color: [0.67, 0.67, 0.67]
402 inputs:
403 - grid_terrain
404 - name: grid_terrain
405 type: gridPOP
406 parameters:
407 sizex: 20
408 sizey: 20
409 cols: 128
410 rows: 128
411 rx: -90
412 size: [130, 90]
413 color: [0.67, 0.67, 0.67]
414 - name: facet_normals
415 type: facetPOP
416 parameters:
417 operation: cusp
418 angle: 160
419 position: [800, 0]
420 size: [130, 90]
421 color: [0.67, 0.67, 0.67]
422 inputs:
423 - glsl_terrain
424 - name: glsl_terrain_info
425 type: infoDAT
426 parameters:
427 op: glsl_terrain
428 position: [485, -120]
429 dock: glsl_terrain
430 dat_read_only: true
431 - name: glsl_terrain_compute
432 type: textDAT
433 position: [335, -120]
434 dock: glsl_terrain
435 dat_content: |-
436 // Ridged multifractal terrain -- GPU geometry generator (replaces fbm noisePOPs).
437 // Uniforms auto-declared from the Vectors page: uShape=(Height,Ridge,Warp,Seed), uTime=(time,..).
438 // 3D value noise: the 3rd coord = time -> terrain morphs IN PLACE (not a pan); per-octave rate = multi-scale.
439 float hash3(vec3 p){ p=fract(p*0.3183099+vec3(0.1,0.2,0.3)); p*=17.0; return fract(p.x*p.y*p.z*(p.x+p.y+p.z)); }
440 float vnoise3(vec3 p){
441 vec3 i=floor(p), f=fract(p); vec3 u=f*f*(3.0-2.0*f);
442 return mix(mix(mix(hash3(i+vec3(0,0,0)),hash3(i+vec3(1,0,0)),u.x),
443 mix(hash3(i+vec3(0,1,0)),hash3(i+vec3(1,1,0)),u.x),u.y),
444 mix(mix(hash3(i+vec3(0,0,1)),hash3(i+vec3(1,0,1)),u.x),
445 mix(hash3(i+vec3(0,1,1)),hash3(i+vec3(1,1,1)),u.x),u.y),u.z);
446 }
447 float ridged(vec2 p, float sharp, vec2 so, float t){
448 float sum=0.0, freq=1.0, amp=0.62, prev=1.0;
449 for(int i=0;i<3;i++){
450 float tz = t*(0.05+0.045*float(i)); // per-octave morph rate -> earthquake undercurrents
451 float n=vnoise3(vec3(p*freq+so, tz));
452 n=1.0-abs(2.0*n-1.0); // ridge transform -> creases
453 n=pow(n,sharp); // sharpen ridgelines
454 sum+=n*amp*clamp(prev,0.0,1.0); // multifractal: rough peaks, smooth valleys
455 prev=n; freq*=2.0; amp*=0.45;
456 }
457 return sum;
458 }
459 void main(){
460 const uint id=TDIndex();
461 if(id>=TDNumElements()) return;
462 vec3 pos=TDIn_P(0, id);
463 float Height=uShape.x, Ridge=uShape.y, Warp=uShape.z, Seed=uShape.w;
464 float t=uTime.x;
465 vec2 so=vec2(Seed*19.3, Seed*7.7); // seed -> a different mountain
466 vec2 xz=pos.xz*0.18; // domain scale
467 vec2 w=vec2(vnoise3(vec3(xz*0.6+so, t*0.03)), vnoise3(vec3(xz*0.6+so+5.2, t*0.03+2.0)));
468 xz+=(w-0.5)*Warp; // domain warp -> organic, non-griddy
469 float h=ridged(xz, Ridge, so, t);
470 pos.y+=(h-0.35)*4.6*Height; // offset down for rock/snow contrast, then scale
471 P[id]=pos;
472 }
473 dat_content_format: text
474- name: out1
475 type: outTOP
476 parameters:
477 label: =me.name
478 flags:
479 - display
480 - viewer
481 position: [1700, 0]
482 size: [130, 90]
483 color: [0.67, 0.67, 0.67]
484 inputs:
485 - comp_sky
486- name: light
487 type: lightCOMP
488 parameters:
489 ty: 10
490 tz: 0
491 rx: -22
492 ry: -45
493 lighttype: distant
494 flags:
495 - display
496 position: [500, -580]
497 size: [160, 130]
498 color: [0.67, 0.67, 0.67]
499 children:
500 - name: copy1
501 type: copyPOP
502 parameters:
503 ncy: 2
504 rx: 90
505 flags:
506 - viewer
507 position: [520, 670]
508 size: [130, 90]
509 color: [0.67, 0.67, 0.67]
510 inputs:
511 - tube_attenuated
512 - name: merge1
513 type: mergePOP
514 sequences:
515 input:
516 - {}
517 - {}
518 - {}
519 - {}
520 - {}
521 - {}
522 - {}
523 position: [250, 500]
524 inputs:
525 - rectangle1
526 - tube_cone1
527 - tube_cone2
528 - primitive1
529 - line_atten
530 - circle_attenStart
531 - circle_attenEnd
532 - name: merge2
533 type: mergePOP
534 sequences:
535 input:
536 - {}
537 - {}
538 position: [950, 230]
539 inputs:
540 - connectivity1
541 - circle1
542 - name: merge3
543 type: mergePOP
544 sequences:
545 input:
546 - {}
547 - {}
548 position: [620, 290]
549 inputs:
550 - pointgen1
551 - transform1
552 - name: circle1
553 type: circlePOP
554 parameters:
555 scale: 0.2
556 position: [780, 170]
557 - name: sphere1
558 type: spherePOP
559 parameters:
560 radx: 0.05
561 rady: 0.05
562 radz: 0.05
563 freq: 3
564 flags:
565 - viewer
566 position: [520, 890]
567 size: [130, 90]
568 color: [0.67, 0.67, 0.67]
569 - name: pointgen1
570 type: pointgeneratorPOP
571 parameters:
572 shape: circle
573 numpoints: 17
574 sx: 0.2
575 sy: 0.2
576 sz: 0.2
577 flags:
578 - viewer
579 position: [270, 290]
580 size: [130, 90]
581 color: [0.67, 0.67, 0.67]
582 - name: line_atten
583 type: linePOP
584 parameters:
585 divs: 1
586 bypass: =not parent().par.attenuated
587 sequences:
588 pt:
589 - posz: =-parent().par.attenuationstart
590 - posz: =-parent().par.attenuationend
591 custom_pars:
592 Points:
593 $t: points
594 flags:
595 - viewer
596 position: [0, 230]
597 size: [130, 90]
598 color: [0.67, 0.67, 0.67]
599 - name: primitive1
600 type: primitivePOP
601 parameters:
602 method: pattern
603 sequences:
604 prim:
605 - type: lines
606 pattern: 0 1 0 2 0 3 0 4
607 pt:
608 - {}
609 - posx: =mod.math.sin(mod.math.radians(parent().par.coneangle/2)) + mod.math.sin(mod.math.radians(parent().par.conedelta/2))
610 posz: =-op('tube_cone1').par.height
611 - posx: =mod.math.sin(-mod.math.radians(parent().par.coneangle/2)) - mod.math.sin(mod.math.radians(parent().par.conedelta/2))
612 posz: =0-op('tube_cone1').par.height
613 - posy: =-mod.math.sin(-mod.math.radians(parent().par.coneangle/2)) - mod.math.sin(mod.math.radians(parent().par.conedelta/2))
614 posz: =-op('tube_cone1').par.height
615 - posy: =mod.math.sin(-mod.math.radians(parent().par.coneangle/2)) - mod.math.sin(mod.math.radians(parent().par.conedelta/2))
616 posz: =-op('tube_cone1').par.height
617 custom_pars:
618 Points:
619 $t: points
620 flags:
621 - viewer
622 position: [0, 390]
623 - name: rectangle1
624 type: rectanglePOP
625 parameters:
626 sizeu: 0.02
627 sizev: 0.5
628 anchorv: 0
629 flags:
630 - viewer
631 position: [0, 730]
632 size: [130, 90]
633 color: [0.67, 0.67, 0.67]
634 - name: transform1
635 type: transformPOP
636 parameters:
637 tz: 0.8
638 flags:
639 - viewer
640 position: [450, 370]
641 size: [130, 90]
642 color: [0.67, 0.67, 0.67]
643 inputs:
644 - pointgen1
645 - name: tube_cone1
646 type: tubePOP
647 parameters:
648 radx: =mod.math.sin(mod.math.radians(parent().par.coneangle/2))
649 rady: 0.01
650 height: =mod.math.cos(mod.math.radians(parent().par.coneangle/2))
651 tz: =-me.par.height*0.5
652 position: [0, 620]
653 - name: tube_cone2
654 type: tubePOP
655 parameters:
656 radx: =mod.math.sin(mod.math.radians(parent().par.coneangle/2)) + mod.math.sin(mod.math.radians(parent().par.conedelta/2))
657 rady: =mod.math.sin(mod.math.radians(parent().par.coneangle/2))
658 height: 0
659 tz: =-op('tube_cone1').par.height
660 position: [0, 500]
661 - name: connectivity1
662 type: connectivityPOP
663 parameters:
664 surftype: lines
665 flags:
666 - viewer
667 position: [780, 290]
668 size: [130, 90]
669 color: [0.67, 0.67, 0.67]
670 inputs:
671 - merge3
672 - name: circle_attenEnd
673 type: circlePOP
674 parameters:
675 radx: 0.1
676 rady: 0.1
677 tz: =-parent().par.attenuationend
678 bypass: =not parent().par.attenuated
679 - name: primitive_cross
680 type: primitivePOP
681 parameters:
682 method: set
683 setprimtype: lines
684 sequences:
685 pt:
686 - posx: -0.2
687 - posx: 0.2
688 - posy: -0.2
689 - posy: 0.2
690 - posz: -0.2
691 - posz: 0.2
692 custom_pars:
693 Points:
694 $t: points
695 flags:
696 - display
697 - render
698 - viewer
699 position: [520, 1000]
700 - name: tube_attenuated
701 type: tubePOP
702 parameters:
703 surftype: rows
704 radx: =parent().par.attenuationend
705 rady: =parent().par.attenuationstart
706 height: 0
707 bypass: =not parent().par.attenuated
708 position: [368, 673]
709 - name: merge_pointLight
710 type: mergePOP
711 sequences:
712 input:
713 - {}
714 - {}
715 - {}
716 - {}
717 position: [760, 820]
718 inputs:
719 - sphere1
720 - primitive_quadrants
721 - copy1
722 - name: switch_lightType
723 type: switchPOP
724 parameters:
725 index: =parent().par.lighttype.menuIndex
726 flags:
727 - display
728 - render
729 - viewer
730 position: [1140, 500]
731 size: [130, 90]
732 color: [0.67, 0.67, 0.67]
733 inputs:
734 - merge_pointLight
735 - merge1
736 - merge2
737 - name: circle_attenStart
738 type: circlePOP
739 parameters:
740 radx: 0.1
741 rady: 0.1
742 tz: =-parent().par.attenuationstart
743 bypass: =not parent().par.attenuated
744 position: [0, 120]
745 - name: primitive_quadrants
746 type: primitivePOP
747 parameters:
748 method: set
749 setprimtype: lines
750 sequences:
751 pt:
752 - posx: 0.07
753 posy: 0.07
754 posz: 0.07
755 - posx: -0.07
756 posy: -0.07
757 posz: -0.07
758 - posx: -0.07
759 posy: 0.07
760 posz: 0.07
761 - posx: 0.07
762 posy: -0.07
763 posz: -0.07
764 - posx: 0.07
765 posy: 0.07
766 posz: -0.07
767 - posx: -0.07
768 posy: -0.07
769 posz: 0.07
770 - posx: -0.07
771 posy: 0.07
772 posz: -0.07
773 - posx: 0.07
774 posy: -0.07
775 posz: 0.07
776 custom_pars:
777 Points:
778 $t: points
779 flags:
780 - viewer
781 position: [520, 780]
782- name: comp_sky
783 type: compositeTOP
784 parameters:
785 operand: over
786 position: [1400, 0]
787 size: [130, 90]
788 color: [0.67, 0.67, 0.67]
789 inputs:
790 - render_scene
791 - glsl_sky
792- name: glsl_sky
793 type: glslTOP
794 parameters:
795 pixeldat: glsl_sky_pixel
796 computedat: glsl_sky_compute
797 outputresolution: custom
798 resolutionw: 1024
799 resolutionh: 439
800 flags:
801 - viewer
802 position: [900, -330]
803 size: [130, 90]
804 color: [0.67, 0.67, 0.67]
805- name: annotate1
806 type: annotateCOMP
807 sequences:
808 ext:
809 - object: op.TDAnnotate.mod.AnnotateExt.AnnotateExt(me)
810 promote: true
811 custom_pars:
812 Text:
813 $t: text
814 Titletext: Terrain + Snow Shader
815 Bodytext: Ridged-multifractal terrain in a GLSL POP (inside geo), shaded by a snow/rock GLSL MAT. Height / Ridge / Warp / Seed / Morph Speed drive the POP; Detail / Snow Line / Sun / Haze drive the material.
816 Settings:
817 $t: settings
818 Mode: annotate
819 Backcolorr:
820 - '=me.color[0] # node color [r]'
821 - =me.color[1]
822 - '=me.color[2] '
823 OP Viewer:
824 $t: op_viewer
825 Opvieweroversize: natural
826 About:
827 $t: about
828 position: [-220, -520]
829 size: [570, 820]
830 palette_clone: true
831- name: annotate2
832 type: annotateCOMP
833 sequences:
834 ext:
835 - object: op.TDAnnotate.mod.AnnotateExt.AnnotateExt(me)
836 promote: true
837 custom_pars:
838 Text:
839 $t: text
840 Titletext: 3D Scene + Sky
841 Bodytext: A camera and a distant sun light render the displaced geometry (render_scene). A bright procedural sky is generated separately in glsl_sky.
842 Settings:
843 $t: settings
844 Mode: annotate
845 Backcolorr:
846 - '=me.color[0] # node color [r]'
847 - =me.color[1]
848 - '=me.color[2] '
849 OP Viewer:
850 $t: op_viewer
851 Opvieweroversize: natural
852 About:
853 $t: about
854 position: [430, -650]
855 size: [820, 910]
856 palette_clone: true
857- name: annotate3
858 type: annotateCOMP
859 sequences:
860 ext:
861 - object: op.TDAnnotate.mod.AnnotateExt.AnnotateExt(me)
862 promote: true
863 custom_pars:
864 Text:
865 $t: text
866 Titletext: Composite + Output
867 Bodytext: The sky is composited under the rendered terrain (comp_sky) and sent to out1 -- the specimen's output.
868 Settings:
869 $t: settings
870 Mode: annotate
871 Backcolorr:
872 - '=me.color[0] # node color [r]'
873 - =me.color[1]
874 - '=me.color[2] '
875 OP Viewer:
876 $t: op_viewer
877 Opvieweroversize: natural
878 About:
879 $t: about
880 position: [1330, -70]
881 size: [570, 370]
882 palette_clone: true
883- name: glsl_snow
884 type: glslMAT
885 parameters:
886 vdat: glsl_snow_vertex
887 pdat: glsl_snow_pixel
888 skelrootpath: =parent()
889 sequences:
890 mattr:
891 - comps: 2
892 cols: 2
893 vec:
894 - name: uTerrain
895 valuex: =parent().par.Snowline.eval()
896 valuey: =0.17*parent().par.Detail.eval()
897 valuez: =parent().par.Haze.eval()
898 valuew: 0
899 - name: uSunDir
900 valuex: =math.cos(math.radians(parent().par.Sundirel.eval()))*math.sin(math.radians(parent().par.Sundiraz.eval()))
901 valuey: =math.sin(math.radians(parent().par.Sundirel.eval()))
902 valuez: =math.cos(math.radians(parent().par.Sundirel.eval()))*math.cos(math.radians(parent().par.Sundiraz.eval()))
903 valuew: 0
904 position: [0, -330]
905 size: [130, 90]
906 color: [0.67, 0.67, 0.67]
907- name: render_scene
908 type: renderTOP
909 parameters:
910 camera: cam
911 geometry: geo
912 lights: light
913 antialias: aa2
914 resolutionw: 1024
915 resolutionh: 439
916 flags:
917 - viewer
918 position: [500, 0]
919 size: [130, 90]
920 color: [0.67, 0.67, 0.67]
921- name: glsl_sky_info
922 type: infoDAT
923 parameters:
924 op: glsl_sky
925 position: [900, -450]
926 dock: glsl_sky
927 dat_read_only: true
928- name: glsl_sky_pixel
929 type: textDAT
930 parameters:
931 extension: frag
932 position: [1050, -450]
933 dock: glsl_sky
934 dat_content: |-
935 out vec4 fragColor;
936 float h2(vec2 p){ return fract(sin(dot(p,vec2(127.1,311.7)))*43758.5453); }
937 float n2(vec2 p){ vec2 i=floor(p),f=fract(p); f=f*f*(3.0-2.0*f);
938 return mix(mix(h2(i),h2(i+vec2(1,0)),f.x),mix(h2(i+vec2(0,1)),h2(i+vec2(1,1)),f.x),f.y); }
939 float fbm2(vec2 p){ float v=0.0,a=0.5; for(int i=0;i<4;i++){v+=a*n2(p); p*=2.0; a*=0.5;} return v; }
940 void main(){
941 vec2 uv=vUV.st; float y=uv.t;
942 vec3 zenith=vec3(0.17,0.42,0.83); vec3 horizon=vec3(0.74,0.84,0.93);
943 vec3 col=mix(horizon,zenith,smoothstep(0.0,0.95,y));
944 float cl=fbm2(vec2(uv.x*3.5,uv.y*6.0));
945 col=mix(col,vec3(0.97,0.98,1.0),smoothstep(0.6,0.85,cl)*0.45);
946 fragColor=vec4(col,1.0);
947 }
948 dat_content_format: text
949- name: glsl_snow_info
950 type: infoDAT
951 parameters:
952 op: glsl_snow
953 position: [-150, -450]
954 dock: glsl_snow
955 dat_read_only: true
956- name: glsl_snow_pixel
957 type: textDAT
958 parameters:
959 extension: frag
960 position: [0, -450]
961 dock: glsl_snow
962 dat_content: |-
963 uniform vec4 uTerrain; // x = snow line base (was 1.6), y = bump strength (was 0.17), z = haze multiplier, w = unused
964 uniform vec4 uSunDir; // xyz = sun light direction (unit, from az/el binding), w = unused
965 in vec3 iWorldPos;
966 in vec3 iWorldNorm;
967 out vec4 oFragColor;
968 float hash(vec3 p){ return fract(sin(dot(p,vec3(127.1,311.7,74.7)))*43758.5453); }
969 float vnoise(vec3 p){ vec3 i=floor(p),f=fract(p); f=f*f*(3.0-2.0*f);
970 return mix(mix(mix(hash(i+vec3(0,0,0)),hash(i+vec3(1,0,0)),f.x),mix(hash(i+vec3(0,1,0)),hash(i+vec3(1,1,0)),f.x),f.y),
971 mix(mix(hash(i+vec3(0,0,1)),hash(i+vec3(1,0,1)),f.x),mix(hash(i+vec3(0,1,1)),hash(i+vec3(1,1,1)),f.x),f.y),f.z); }
972 float fbm(vec3 p){ float v=0.0,a=0.5; for(int i=0;i<4;i++){v+=a*vnoise(p); p=p*2.03+vec3(1.7); a*=0.5;} return v; }
973 float fbm3(vec3 p){ float v=0.0,a=0.5; for(int i=0;i<3;i++){v+=a*vnoise(p); p=p*2.05+vec3(1.7); a*=0.5;} return v; }
974 vec3 bumpN(vec3 P,vec3 N,float fr,float st){ float e=0.03;
975 float h=fbm3(P*fr),hx=fbm3((P+vec3(e,0,0))*fr),hz=fbm3((P+vec3(0,0,e))*fr);
976 return normalize(N+vec3((h-hx),0.0,(h-hz))/e*st); }
977 void main(){
978 TDCheckDiscard();
979 vec3 P=iWorldPos; vec3 Ng=normalize(iWorldNorm);
980 float slopeG=clamp(Ng.y,0.0,1.0);
981 float snowLine=uTerrain.x+(fbm(P*0.4)-0.5)*1.1;
982 float snowMask=clamp(smoothstep(snowLine-0.5,snowLine+0.5,P.y),0.0,1.0);
983 vec3 N=bumpN(P,Ng,9.0,uTerrain.y*(1.0-0.85*snowMask));
984 float slope=clamp(N.y,0.0,1.0);
985 float c1=fbm(P*1.3), c2=fbm(P*3.2+5.0), c3=fbm(P*0.7-3.0); float fine=fbm(P*4.0);
986 vec3 rock=vec3(0.46,0.34,0.24);
987 rock=mix(rock,vec3(0.34,0.37,0.40),smoothstep(0.35,0.75,c1));
988 rock=mix(rock,vec3(0.44,0.22,0.16),smoothstep(0.55,0.85,c2)*0.6);
989 rock=mix(rock,vec3(0.28,0.34,0.20),smoothstep(0.58,0.88,c3)*0.4);
990 rock*=0.72+0.28*fine;
991 vec3 snow=vec3(0.88,0.90,0.95);
992 vec3 albedo=mix(rock,snow,snowMask);
993 vec3 L=normalize(uSunDir.xyz);
994 float ndl=max(dot(N,L),0.0);
995 vec3 sun=vec3(1.55,1.5,1.35)*ndl*(1.0-0.55*snowMask); // expose snow below clipping, keep shading
996 vec3 sky=vec3(0.40,0.52,0.74)*(0.42+0.58*slope);
997 vec3 col=albedo*(sun+sky);
998 col+=pow(ndl,60.0)*snowMask*0.18;
999 col=(col-0.45)*1.12+0.45;
1000 float dist=length(P-vec3(0.0,6.2,16.0));
1001 float depth=clamp((dist-9.0)/19.0,0.0,1.0); // 0 = foreground (clear), 1 = far
1002 float distFog=pow(depth,1.7)*0.82; // power curve: clear fg, builds with depth
1003 float valleyMist=exp(-max(P.y-0.2,0.0)*0.7)*0.18*smoothstep(0.25,0.75,depth); // mist only in distant valleys
1004 float atmo=clamp((distFog+valleyMist)*uTerrain.z,0.0,0.88);
1005 col=mix(col,vec3(0.66,0.78,0.92),atmo);
1006 oFragColor=TDOutputSwizzle(vec4(clamp(col,0.0,2.0),1.0));
1007 }
1008 dat_content_format: text
1009- name: glsl_sky_compute
1010 type: textDAT
1011 position: [750, -450]
1012 dock: glsl_sky
1013- name: glsl_snow_vertex
1014 type: textDAT
1015 parameters:
1016 extension: vert
1017 position: [150, -450]
1018 dock: glsl_snow
1019 dat_content: |-
1020 out vec3 iWorldPos;
1021 out vec3 iWorldNorm;
1022 void main(){
1023 vec3 pos = TDPos();
1024 vec4 worldSpacePos = TDDeform(pos);
1025 iWorldPos = worldSpacePos.xyz;
1026 iWorldNorm = TDDeformNorm(TDNormal());
1027 gl_Position = TDWorldToProj(worldSpacePos);
1028 }
1029 dat_content_format: text
1030annotations:
1031- name: annotate1
1032 mode: annotate
1033 title: Terrain + Snow Shader
1034 text: Ridged-multifractal terrain in a GLSL POP (inside geo), shaded by a snow/rock GLSL MAT. Height / Ridge / Warp / Seed / Morph Speed drive the POP; Detail / Snow Line / Sun / Haze drive the material.
1035 position: [-220, -520]
1036 size: [570, 820]
1037 color: [0.45, 0.45, 0.45]
1038- name: annotate2
1039 mode: annotate
1040 title: 3D Scene + Sky
1041 text: A camera and a distant sun light render the displaced geometry (render_scene). A bright procedural sky is generated separately in glsl_sky.
1042 position: [430, -650]
1043 size: [820, 910]
1044 color: [0.45, 0.45, 0.45]
1045- name: annotate3
1046 mode: annotate
1047 title: Composite + Output
1048 text: The sky is composited under the rendered terrain (comp_sky) and sent to out1 -- the specimen's output.
1049 position: [1330, -70]
1050 size: [570, 370]
1051 color: [0.45, 0.45, 0.45]