Parameters
Name | Type | Description |
---|---|---|
position | vec3<f32> | 3D position to evaluate. |
scale | f32 | Scale factor for the gyroid pattern. |
thickness | f32 | Thickness of the gyroid surface. |
Returns
WGSL Code
fn sdfGyroid(position: vec3<f32>, scale: f32, thickness: f32) -> f32 {let p = position * scale;return (abs(dot(sin(p), cos(p.zxy))) - thickness) / scale;}