fuckingtech/public/assets/glsl/lygia/math/parabola.wgsl
Elias Rhouzlane bf76c6b086 fix: code
2025-04-06 17:23:52 +02:00

7 lines
No EOL
349 B
WebGPU Shading Language

/*
contributors: Inigo Quiles
description: |
A nice choice to remap the 0..1 interval into 0..1, such that the corners are mapped to 0 and the center to 1. You can then rise the parabolar to a power k to control its shape. From https://iquilezles.org/articles/functions/
*/
fn parabola(x: f32, k: f32) -> f32 { return pow( 4.0*x*(1.0-x), k ); }