Parameters
Name | Type | Description |
---|---|---|
x | vec3<f32> | Input 3D position. |
seedVal | f32 | Random seed for variation. |
Returns
Dependencies
WGSL Code
//! requires noise3Dfn warpNoise3D(x: vec3<f32>, seedVal: f32) -> vec3<f32> {var p = x + seedVal;var nx = 0.0;var ny = 0.0;var nz = 0.0;var w = 0.5;for (var i = 0; i < 3; i++) {nx += w * noise3D(p);ny += w * noise3D(p + vec3<f32>(13.5, 41.3, 17.8));nz += w * noise3D(p + vec3<f32>(31.2, 23.7, 11.9));p *= 2.0;w *= 0.5;}return vec3<f32>(nx, ny, nz) * 2.0 - 1.0;}