Parameters
| Name | Type | Description |
|---|---|---|
| position | vec3<f32> | 3D position to transform. |
| cellSize | vec3<f32> | Size of each repetition cell. |
| warpAmount | f32 | Amount of warping to apply. |
| warpScale | f32 | Scale of the warping effect. |
| seed | f32 | Random seed for warping. |
Returns
vec3<f32>repeated position.
Dependencies
WGSL Code
//! requires warpNoise3D fn sdfDomainRepeat(position: vec3<f32>, cellSize: vec3<f32>, warpAmount: f32, warpScale: f32, seed: f32) -> vec3<f32> { // Calculate warping for position let warp = warpNoise3D(position * warpScale, seed) * warpAmount; // Apply warping to position let warpedPos = position + warp; // Calculate repetition return warpedPos - cellSize * round(warpedPos / cellSize); }