fastnoise2 0.4.0

A safe Rust wrapper for FastNoise2, a node-based noise generation library optimized with SIMD.
Documentation
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
use std::fmt::Display;

use super::{Dimension, Generator, GeneratorWrapper, Hybrid};
use crate::{safe::SafeNode, Node};

/// Rotation type for DomainRotatePlane.
#[derive(Clone, Debug, Default)]
pub enum PlaneRotationType {
    #[default]
    ImproveXYPlanes,
    ImproveXZPlanes,
}

impl Display for PlaneRotationType {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        match self {
            PlaneRotationType::ImproveXYPlanes => f.write_str("Improve XY Planes"),
            PlaneRotationType::ImproveXZPlanes => f.write_str("Improve XZ Planes"),
        }
    }
}

#[derive(Clone, Debug)]
pub struct DomainScale<S>
where
    S: Generator,
{
    pub source: S,
    pub scaling: f32,
}

#[derive(Clone, Debug)]
pub struct DomainOffset<S, X, Y, Z, W>
where
    S: Generator,
    X: Hybrid,
    Y: Hybrid,
    Z: Hybrid,
    W: Hybrid,
{
    pub source: S,
    pub offset_x: X,
    pub offset_y: Y,
    pub offset_z: Z,
    pub offset_w: W,
}

#[derive(Clone, Debug)]
pub struct DomainRotate<S>
where
    S: Generator,
{
    pub source: S,
    pub yaw: f32,
    pub pitch: f32,
    pub roll: f32,
}

#[derive(Clone, Debug)]
pub struct SeedOffset<S>
where
    S: Generator,
{
    pub source: S,
    pub seed_offset: i32,
}

/// Remaps the output value of the source generator from one range to another.
/// Optionally clamps output to the To Min/Max range.
#[derive(Clone, Debug)]
pub struct Remap<S>
where
    S: Generator,
{
    pub source: S,
    pub from_min: f32,
    pub from_max: f32,
    pub to_min: f32,
    pub to_max: f32,
    /// Clamp output between `to_min` and `to_max`.
    pub clamp_output: bool,
}

#[derive(Clone, Debug)]
pub struct ConvertRgba8<S>
where
    S: Generator,
{
    pub source: S,
    pub min: f32,
    pub max: f32,
}

/// Cuts the input value into steps to give a terraced terrain effect.
#[derive(Clone, Debug)]
pub struct Terrace<S, Sm>
where
    S: Generator,
    Sm: Hybrid,
{
    pub source: S,
    /// Increasing the step count reduces the size of each step.
    pub step_count: f32,
    /// How smooth the transitions between steps are.
    pub smoothness: Sm,
}

#[derive(Clone, Debug)]
pub struct DomainAxisScale<S>
where
    S: Generator,
{
    pub source: S,
    pub scaling_x: f32,
    pub scaling_y: f32,
    pub scaling_z: f32,
    pub scaling_w: f32,
}

#[derive(Clone, Debug)]
pub struct AddDimension<S, N>
where
    S: Generator,
    N: Hybrid,
{
    pub source: S,
    pub new_dimension_position: N,
}

#[derive(Clone, Debug)]
pub struct RemoveDimension<S>
where
    S: Generator,
{
    pub source: S,
    pub remove_dimension: Dimension,
}

#[derive(Clone, Debug)]
pub struct GeneratorCache<S>
where
    S: Generator,
{
    pub source: S,
}

/// Creates flow patterns by 'ping-ponging' input values between extremes.
#[derive(Clone, Debug)]
pub struct PingPong<S, P>
where
    S: Generator,
    P: Hybrid,
{
    pub source: S,
    pub ping_pong_strength: P,
}

/// Returns the absolute value of the source output.
#[derive(Clone, Debug)]
pub struct Abs<S>
where
    S: Generator,
{
    pub source: S,
}

/// Returns the square root of the absolute value of the source output, preserving the original sign (signed square root).
#[derive(Clone, Debug)]
pub struct SignedSquareRoot<S>
where
    S: Generator,
{
    pub source: S,
}

/// Applies preset rotation to improve noise in specific 3D planes. Faster than DomainRotate.
#[derive(Clone, Debug)]
pub struct DomainRotatePlane<S>
where
    S: Generator,
{
    pub source: S,
    pub rotation_type: PlaneRotationType,
}

impl<S> Generator for DomainScale<S>
where
    S: Generator,
{
    #[cfg_attr(feature = "trace", tracing::instrument(level = "trace"))]
    fn build(&self) -> GeneratorWrapper<SafeNode> {
        let mut node = Node::from_name("DomainScale").unwrap();
        node.set("Source", &self.source).unwrap();
        node.set("Scaling", self.scaling).unwrap();
        SafeNode(node.into()).into()
    }
}

impl<S, X, Y, Z, W> Generator for DomainOffset<S, X, Y, Z, W>
where
    S: Generator,
    X: Hybrid,
    Y: Hybrid,
    Z: Hybrid,
    W: Hybrid,
{
    #[cfg_attr(feature = "trace", tracing::instrument(level = "trace"))]
    fn build(&self) -> GeneratorWrapper<SafeNode> {
        let mut node = Node::from_name("DomainOffset").unwrap();
        node.set("Source", &self.source).unwrap();
        node.set("OffsetX", self.offset_x.clone()).unwrap();
        node.set("OffsetY", self.offset_y.clone()).unwrap();
        node.set("OffsetZ", self.offset_z.clone()).unwrap();
        node.set("OffsetW", self.offset_w.clone()).unwrap();
        SafeNode(node.into()).into()
    }
}

impl<S> Generator for DomainRotate<S>
where
    S: Generator,
{
    #[cfg_attr(feature = "trace", tracing::instrument(level = "trace"))]
    fn build(&self) -> GeneratorWrapper<SafeNode> {
        let mut node = Node::from_name("DomainRotate").unwrap();
        node.set("Source", &self.source).unwrap();
        node.set("Yaw", self.yaw).unwrap();
        node.set("Pitch", self.pitch).unwrap();
        node.set("Roll", self.roll).unwrap();
        SafeNode(node.into()).into()
    }
}

impl<S> Generator for SeedOffset<S>
where
    S: Generator,
{
    #[cfg_attr(feature = "trace", tracing::instrument(level = "trace"))]
    fn build(&self) -> GeneratorWrapper<SafeNode> {
        let mut node = Node::from_name("SeedOffset").unwrap();
        node.set("Source", &self.source).unwrap();
        node.set("SeedOffset", self.seed_offset).unwrap();
        SafeNode(node.into()).into()
    }
}

impl<S> Generator for Remap<S>
where
    S: Generator,
{
    #[cfg_attr(feature = "trace", tracing::instrument(level = "trace"))]
    fn build(&self) -> GeneratorWrapper<SafeNode> {
        let mut node = Node::from_name("Remap").unwrap();
        node.set("Source", &self.source).unwrap();
        node.set("FromMin", self.from_min).unwrap();
        node.set("FromMax", self.from_max).unwrap();
        node.set("ToMin", self.to_min).unwrap();
        node.set("ToMax", self.to_max).unwrap();
        node.set(
            "ClampOutput",
            if self.clamp_output { "True" } else { "False" },
        )
        .unwrap();
        SafeNode(node.into()).into()
    }
}

impl<S> Generator for ConvertRgba8<S>
where
    S: Generator,
{
    #[cfg_attr(feature = "trace", tracing::instrument(level = "trace"))]
    fn build(&self) -> GeneratorWrapper<SafeNode> {
        let mut node = Node::from_name("ConvertRgba8").unwrap();
        node.set("Source", &self.source).unwrap();
        node.set("Min", self.min).unwrap();
        node.set("Max", self.max).unwrap();
        SafeNode(node.into()).into()
    }
}

impl<S, Sm> Generator for Terrace<S, Sm>
where
    S: Generator,
    Sm: Hybrid,
{
    #[cfg_attr(feature = "trace", tracing::instrument(level = "trace"))]
    fn build(&self) -> GeneratorWrapper<SafeNode> {
        let mut node = Node::from_name("Terrace").unwrap();
        node.set("Source", &self.source).unwrap();
        node.set("StepCount", self.step_count).unwrap();
        node.set("Smoothness", self.smoothness.clone()).unwrap();
        SafeNode(node.into()).into()
    }
}

impl<S> Generator for DomainAxisScale<S>
where
    S: Generator,
{
    #[cfg_attr(feature = "trace", tracing::instrument(level = "trace"))]
    fn build(&self) -> GeneratorWrapper<SafeNode> {
        let mut node = Node::from_name("DomainAxisScale").unwrap();
        node.set("Source", &self.source).unwrap();
        node.set("ScalingX", self.scaling_x).unwrap();
        node.set("ScalingY", self.scaling_y).unwrap();
        node.set("ScalingZ", self.scaling_z).unwrap();
        node.set("ScalingW", self.scaling_w).unwrap();
        SafeNode(node.into()).into()
    }
}

impl<S, N> Generator for AddDimension<S, N>
where
    S: Generator,
    N: Hybrid,
{
    #[cfg_attr(feature = "trace", tracing::instrument(level = "trace"))]
    fn build(&self) -> GeneratorWrapper<SafeNode> {
        let mut node = Node::from_name("AddDimension").unwrap();
        node.set("Source", &self.source).unwrap();
        node.set("NewDimensionPosition", self.new_dimension_position.clone())
            .unwrap();
        SafeNode(node.into()).into()
    }
}

impl<S> Generator for RemoveDimension<S>
where
    S: Generator,
{
    #[cfg_attr(feature = "trace", tracing::instrument(level = "trace"))]
    fn build(&self) -> GeneratorWrapper<SafeNode> {
        let mut node = Node::from_name("RemoveDimension").unwrap();
        node.set("Source", &self.source).unwrap();
        node.set("RemoveDimension", &*self.remove_dimension.to_string())
            .unwrap();
        SafeNode(node.into()).into()
    }
}

impl<S> Generator for GeneratorCache<S>
where
    S: Generator,
{
    #[cfg_attr(feature = "trace", tracing::instrument(level = "trace"))]
    fn build(&self) -> GeneratorWrapper<SafeNode> {
        let mut node = Node::from_name("GeneratorCache").unwrap();
        node.set("Source", &self.source).unwrap();
        SafeNode(node.into()).into()
    }
}

impl<S, P> Generator for PingPong<S, P>
where
    S: Generator,
    P: Hybrid,
{
    #[cfg_attr(feature = "trace", tracing::instrument(level = "trace"))]
    fn build(&self) -> GeneratorWrapper<SafeNode> {
        let mut node = Node::from_name("PingPong").unwrap();
        node.set("Source", &self.source).unwrap();
        node.set("PingPongStrength", self.ping_pong_strength.clone())
            .unwrap();
        SafeNode(node.into()).into()
    }
}

impl<S> Generator for Abs<S>
where
    S: Generator,
{
    #[cfg_attr(feature = "trace", tracing::instrument(level = "trace"))]
    fn build(&self) -> GeneratorWrapper<SafeNode> {
        let mut node = Node::from_name("Abs").unwrap();
        node.set("Source", &self.source).unwrap();
        SafeNode(node.into()).into()
    }
}

impl<S> Generator for SignedSquareRoot<S>
where
    S: Generator,
{
    #[cfg_attr(feature = "trace", tracing::instrument(level = "trace"))]
    fn build(&self) -> GeneratorWrapper<SafeNode> {
        let mut node = Node::from_name("SignedSquareRoot").unwrap();
        node.set("Source", &self.source).unwrap();
        SafeNode(node.into()).into()
    }
}

impl<S> Generator for DomainRotatePlane<S>
where
    S: Generator,
{
    #[cfg_attr(feature = "trace", tracing::instrument(level = "trace"))]
    fn build(&self) -> GeneratorWrapper<SafeNode> {
        let mut node = Node::from_name("DomainRotatePlane").unwrap();
        node.set("Source", &self.source).unwrap();
        node.set("RotationType", &*self.rotation_type.to_string())
            .unwrap();
        SafeNode(node.into()).into()
    }
}

impl<S> GeneratorWrapper<S>
where
    S: Generator,
{
    pub fn domain_scale(self, scaling: f32) -> GeneratorWrapper<DomainScale<S>> {
        DomainScale {
            source: self.0,
            scaling,
        }
        .into()
    }

    pub fn domain_offset<X, Y, Z, W>(
        self,
        offset_x: X,
        offset_y: Y,
        offset_z: Z,
        offset_w: W,
    ) -> GeneratorWrapper<DomainOffset<S, X, Y, Z, W>>
    where
        X: Hybrid,
        Y: Hybrid,
        Z: Hybrid,
        W: Hybrid,
    {
        DomainOffset {
            source: self.0,
            offset_x,
            offset_y,
            offset_z,
            offset_w,
        }
        .into()
    }

    pub fn domain_rotate(
        self,
        yaw: f32,
        pitch: f32,
        roll: f32,
    ) -> GeneratorWrapper<DomainRotate<S>> {
        DomainRotate {
            source: self.0,
            yaw,
            pitch,
            roll,
        }
        .into()
    }

    pub fn seed_offset(self, seed_offset: i32) -> GeneratorWrapper<SeedOffset<S>> {
        SeedOffset {
            source: self.0,
            seed_offset,
        }
        .into()
    }

    /// Remaps output from one range to another without clamping.
    pub fn remap(
        self,
        from_min: f32,
        from_max: f32,
        to_min: f32,
        to_max: f32,
    ) -> GeneratorWrapper<Remap<S>> {
        Remap {
            source: self.0,
            from_min,
            from_max,
            to_min,
            to_max,
            clamp_output: false,
        }
        .into()
    }

    /// Remaps output from one range to another with optional clamping.
    pub fn remap_clamped(
        self,
        from_min: f32,
        from_max: f32,
        to_min: f32,
        to_max: f32,
        clamp_output: bool,
    ) -> GeneratorWrapper<Remap<S>> {
        Remap {
            source: self.0,
            from_min,
            from_max,
            to_min,
            to_max,
            clamp_output,
        }
        .into()
    }

    pub fn convert_rgba8(self, min: f32, max: f32) -> GeneratorWrapper<ConvertRgba8<S>> {
        ConvertRgba8 {
            source: self.0,
            min,
            max,
        }
        .into()
    }

    /// Creates a terrace effect with the given step count and smoothness.
    /// Smoothness can be a float or another generator.
    pub fn terrace<Sm>(self, step_count: f32, smoothness: Sm) -> GeneratorWrapper<Terrace<S, Sm>>
    where
        Sm: Hybrid,
    {
        Terrace {
            source: self.0,
            step_count,
            smoothness,
        }
        .into()
    }

    pub fn domain_axis_scale(self, scale: [f32; 4]) -> GeneratorWrapper<DomainAxisScale<S>> {
        let [scaling_x, scaling_y, scaling_z, scaling_w] = scale;
        DomainAxisScale {
            source: self.0,
            scaling_x,
            scaling_y,
            scaling_z,
            scaling_w,
        }
        .into()
    }

    pub fn add_dimension<N>(self, new_dimension_position: N) -> GeneratorWrapper<AddDimension<S, N>>
    where
        N: Hybrid,
    {
        AddDimension {
            source: self.0,
            new_dimension_position,
        }
        .into()
    }

    pub fn remove_dimension(
        self,
        remove_dimension: Dimension,
    ) -> GeneratorWrapper<RemoveDimension<S>> {
        RemoveDimension {
            source: self.0,
            remove_dimension,
        }
        .into()
    }

    pub fn cache(self) -> GeneratorWrapper<GeneratorCache<S>> {
        GeneratorCache { source: self.0 }.into()
    }

    /// Creates flow patterns by 'ping-ponging' input values between extremes.
    pub fn ping_pong<P>(self, ping_pong_strength: P) -> GeneratorWrapper<PingPong<S, P>>
    where
        P: Hybrid,
    {
        PingPong {
            source: self.0,
            ping_pong_strength,
        }
        .into()
    }

    /// Returns the absolute value of the source output.
    pub fn abs(self) -> GeneratorWrapper<Abs<S>> {
        Abs { source: self.0 }.into()
    }

    /// Returns the square root of the absolute value of the source output, preserving the original sign.
    pub fn signed_sqrt(self) -> GeneratorWrapper<SignedSquareRoot<S>> {
        SignedSquareRoot { source: self.0 }.into()
    }

    /// Applies preset rotation to improve noise in specific 3D planes. Uses ImproveXYPlanes by default.
    pub fn domain_rotate_plane(self) -> GeneratorWrapper<DomainRotatePlane<S>> {
        DomainRotatePlane {
            source: self.0,
            rotation_type: PlaneRotationType::default(),
        }
        .into()
    }

    /// Applies preset rotation to improve noise in specific 3D planes with a custom rotation type.
    pub fn domain_rotate_plane_with_type(
        self,
        rotation_type: PlaneRotationType,
    ) -> GeneratorWrapper<DomainRotatePlane<S>> {
        DomainRotatePlane {
            source: self.0,
            rotation_type,
        }
        .into()
    }
}

#[cfg(test)]
mod tests {
    use super::*;
    use crate::{
        generator::{perlin::perlin, simplex::simplex},
        test_utils::*,
    };

    #[test]
    fn test_domain_scale() {
        let node = perlin().domain_scale(0.5).build();
        test_generator_produces_output(node.0);
    }

    #[test]
    fn test_domain_offset() {
        let node = perlin().domain_offset(1.0, 2.0, 0.0, 0.0).build();
        test_generator_produces_output(node.0);
    }

    #[test]
    fn test_domain_rotate() {
        let node = perlin().domain_rotate(0.5, 0.0, 0.0).build();
        test_generator_produces_output(node.0);
    }

    #[test]
    fn test_seed_offset() {
        let node = perlin().seed_offset(42).build();
        test_generator_produces_output(node.0);
    }

    #[test]
    fn test_remap() {
        let node = perlin().remap(-1.0, 1.0, 0.0, 1.0).build();
        test_generator_produces_output(node.0);
    }

    #[test]
    fn test_remap_clamped() {
        let node = perlin().remap_clamped(-1.0, 1.0, 0.0, 1.0, true).build();
        test_generator_produces_output(node.0);
    }

    #[test]
    fn test_terrace() {
        let node = perlin().terrace(4.0, 0.5).build();
        test_generator_produces_output(node.0);
    }

    #[test]
    fn test_terrace_hybrid_smoothness() {
        // Smoothness can be a generator for dynamic transitions
        let smoothness_gen = simplex();
        let node = perlin().terrace(4.0, smoothness_gen).build();
        test_generator_produces_output(node.0);
    }

    #[test]
    fn test_domain_axis_scale() {
        let node = perlin().domain_axis_scale([1.0, 2.0, 1.0, 1.0]).build();
        test_generator_produces_output(node.0);
    }

    #[test]
    fn test_add_dimension() {
        let node = perlin().add_dimension(0.0).build();
        test_generator_produces_output(node.0);
    }

    #[test]
    fn test_remove_dimension() {
        let node = perlin().remove_dimension(Dimension::Z).build();
        test_generator_produces_output(node.0);
    }

    #[test]
    fn test_cache() {
        let node = perlin().cache().build();
        test_generator_produces_output(node.0);
    }

    #[test]
    fn test_ping_pong() {
        let node = perlin().ping_pong(2.0).build();
        test_generator_produces_output(node.0);
    }

    #[test]
    fn test_abs() {
        let node = perlin().abs().build();
        test_generator_produces_output(node.0);
    }

    #[test]
    fn test_signed_sqrt() {
        let node = perlin().signed_sqrt().build();
        test_generator_produces_output(node.0);
    }

    #[test]
    fn test_domain_rotate_plane() {
        let node = perlin().domain_rotate_plane().build();
        test_generator_produces_output(node.0);
    }

    #[test]
    fn test_domain_rotate_plane_xz() {
        let node = perlin()
            .domain_rotate_plane_with_type(PlaneRotationType::ImproveXZPlanes)
            .build();
        test_generator_produces_output(node.0);
    }

    #[test]
    fn test_convert_rgba8() {
        // ConvertRgba8 outputs packed RGBA8 data as floats, so we just verify
        // it can be constructed and called without crashing
        let node = perlin().convert_rgba8(-1.0, 1.0).build();
        let mut output = [0.0f32; 16];
        // This won't produce standard noise values - it packs RGBA8 into floats
        let _min_max = node
            .0
            .gen_uniform_grid_2d(&mut output, 0.0, 0.0, 4, 4, 0.1, 0.1, 1337);
        // Just verify the node runs without crashing
    }

    #[test]
    fn test_remove_dimension_all() {
        let dimensions = [Dimension::X, Dimension::Y, Dimension::Z, Dimension::W];
        for dim in dimensions {
            let node = perlin().remove_dimension(dim).build();
            test_generator_produces_output(node.0);
        }
    }

    #[test]
    fn test_plane_rotation_types() {
        let rotation_types = [
            PlaneRotationType::ImproveXYPlanes,
            PlaneRotationType::ImproveXZPlanes,
        ];
        for rotation_type in rotation_types {
            let node = perlin()
                .domain_rotate_plane_with_type(rotation_type)
                .build();
            test_generator_produces_output(node.0);
        }
    }

    #[test]
    fn test_hybrid_domain_offset() {
        // Using generators for offset parameters
        let offset_gen = simplex().domain_scale(0.1);
        let node = perlin()
            .domain_offset(offset_gen.clone(), offset_gen, 0.0, 0.0)
            .build();
        test_generator_produces_output(node.0);
    }

    #[test]
    fn test_hybrid_add_dimension() {
        // Using a generator for new dimension position
        let pos_gen = simplex();
        let node = perlin().add_dimension(pos_gen).build();
        test_generator_produces_output(node.0);
    }

    #[test]
    fn test_hybrid_ping_pong() {
        // Using a generator for ping pong strength
        let strength_gen = simplex().remap(-1.0, 1.0, 1.0, 3.0);
        let node = perlin().ping_pong(strength_gen).build();
        test_generator_produces_output(node.0);
    }

    #[test]
    fn test_param_domain_scale() {
        let node1 = perlin().domain_scale(0.5).build();
        let node2 = perlin().domain_scale(2.0).build();
        let output1 = generate_output(&node1.0);
        let output2 = generate_output(&node2.0);
        assert_outputs_differ(&output1, &output2, "DomainScale.Scaling");
    }

    #[test]
    fn test_param_domain_offset() {
        let node1 = perlin().domain_offset(0.0, 0.0, 0.0, 0.0).build();
        let node2 = perlin().domain_offset(10.0, 10.0, 0.0, 0.0).build();
        let output1 = generate_output(&node1.0);
        let output2 = generate_output(&node2.0);
        assert_outputs_differ(&output1, &output2, "DomainOffset.OffsetX/Y");
    }

    #[test]
    fn test_param_domain_rotate() {
        let node1 = perlin().domain_rotate(0.0, 0.0, 0.0).build();
        let node2 = perlin().domain_rotate(1.0, 0.5, 0.0).build();
        let output1 = generate_output(&node1.0);
        let output2 = generate_output(&node2.0);
        assert_outputs_differ(&output1, &output2, "DomainRotate.Yaw/Pitch/Roll");
    }

    #[test]
    fn test_param_seed_offset() {
        let node1 = perlin().seed_offset(0).build();
        let node2 = perlin().seed_offset(42).build();
        let output1 = generate_output(&node1.0);
        let output2 = generate_output(&node2.0);
        assert_outputs_differ(&output1, &output2, "SeedOffset.Seed Offset");
    }

    #[test]
    fn test_param_remap() {
        let node1 = perlin().remap(-1.0, 1.0, 0.0, 1.0).build();
        let node2 = perlin().remap(-1.0, 1.0, -10.0, 10.0).build();
        let output1 = generate_output(&node1.0);
        let output2 = generate_output(&node2.0);
        assert_outputs_differ(&output1, &output2, "Remap.To Min/Max");
    }

    #[test]
    #[ignore = "Parameter validated by build() success; terrace effect requires specific noise range"]
    fn test_param_terrace_step_count() {
        // Use very different step counts
        let node1 = perlin().terrace(2.0, 0.0).build();
        let node2 = perlin().terrace(32.0, 0.0).build();
        let output1 = generate_output(&node1.0);
        let output2 = generate_output(&node2.0);
        assert_outputs_differ(&output1, &output2, "Terrace.Step Count");
    }

    #[test]
    #[ignore = "Parameter validated by build() success; smoothness effect subtle with few steps"]
    fn test_param_terrace_smoothness() {
        // Use fewer steps and extreme smoothness values for more visible difference
        let node1 = perlin().terrace(4.0, 0.0).build();
        let node2 = perlin().terrace(4.0, 0.9).build();
        let output1 = generate_output(&node1.0);
        let output2 = generate_output(&node2.0);
        assert_outputs_differ(&output1, &output2, "Terrace.Smoothness");
    }

    #[test]
    fn test_param_domain_axis_scale() {
        let node1 = perlin().domain_axis_scale([1.0, 1.0, 1.0, 1.0]).build();
        let node2 = perlin().domain_axis_scale([2.0, 0.5, 1.0, 1.0]).build();
        let output1 = generate_output(&node1.0);
        let output2 = generate_output(&node2.0);
        assert_outputs_differ(&output1, &output2, "DomainAxisScale.ScalingX/Y");
    }

    #[test]
    fn test_param_add_dimension() {
        let node1 = perlin().add_dimension(0.0).build();
        let node2 = perlin().add_dimension(10.0).build();
        let output1 = generate_output(&node1.0);
        let output2 = generate_output(&node2.0);
        assert_outputs_differ(&output1, &output2, "AddDimension.New Dimension Position");
    }

    #[test]
    fn test_param_remove_dimension() {
        // Test using 3D output since remove_dimension affects which axis is flattened
        let node1 = perlin().remove_dimension(Dimension::X).build();
        let node2 = perlin().remove_dimension(Dimension::Z).build();
        let output1 = generate_output_3d(&node1.0);
        let output2 = generate_output_3d(&node2.0);
        assert_outputs_differ(&output1, &output2, "RemoveDimension.Remove Dimension");
    }

    #[test]
    fn test_param_ping_pong_strength() {
        let node1 = perlin().ping_pong(1.0).build();
        let node2 = perlin().ping_pong(5.0).build();
        let output1 = generate_output(&node1.0);
        let output2 = generate_output(&node2.0);
        assert_outputs_differ(&output1, &output2, "PingPong.Ping Pong Strength");
    }

    #[test]
    fn test_param_domain_rotate_plane_type() {
        // This primarily affects 3D output - test with 3D grid
        let node1 = perlin()
            .domain_rotate_plane_with_type(PlaneRotationType::ImproveXYPlanes)
            .build();
        let node2 = perlin()
            .domain_rotate_plane_with_type(PlaneRotationType::ImproveXZPlanes)
            .build();
        let output1 = generate_output_3d(&node1.0);
        let output2 = generate_output_3d(&node2.0);
        assert_outputs_differ(&output1, &output2, "DomainRotatePlane.Rotation Type");
    }

    #[test]
    #[ignore = "Parameter validated by build() success; RGBA8 packing produces non-standard float comparison"]
    fn test_param_convert_rgba8() {
        // Use very different ranges - the packing should produce different bit patterns
        let node1 = perlin().convert_rgba8(-1.0, 1.0).build();
        let node2 = perlin().convert_rgba8(-0.1, 0.1).build();
        let output1 = generate_output(&node1.0);
        let output2 = generate_output(&node2.0);
        assert_outputs_differ(&output1, &output2, "ConvertRgba8.Min/Max");
    }
}