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

15 lines
No EOL
780 B
WebGPU Shading Language

#include "saturate.wgsl"
#include "quintic.wgsl"
/*
contributors: Patricio Gonzalez Vivo
description: quintic polynomial step function
license:
- Copyright (c) 2021 Patricio Gonzalez Vivo under Prosperity License - https://prosperitylicense.com/versions/3.0.0
- Copyright (c) 2021 Patricio Gonzalez Vivo under Patron License - https://lygia.xyz/license
*/
fn smootherstep(a: f32, b: f32, v: f32) -> f32 { return quintic( saturate( (v - a)/(b - a) )); }
fn smootherstep2(a: vec2f, b: vec2f, v: vec2f) -> vec2f { return quintic( saturate( (v - a)/(b - a) )); }
fn smootherstep3(a: vec3f, b: vec3f, v: vec3f) -> vec3f { return quintic( saturate( (v - a)/(b - a) )); }
fn smootherstep4(a: vec4f, b: vec4f, v: vec4f) -> vec4f { return quintic( saturate( (v - a)/(b - a) )); }