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

17 lines
No EOL
366 B
GLSL

#include "const.glsl"
/*
contributors: Inigo Quiles
description: A band-limited variant of cos(x) which reduces aliasing at high frequencies. From https://iquilezles.org/articles/bandlimiting/
use: fcos(<float> value)
*/
#ifndef FNC_FCOS
#define FNC_FCOS
float fcos(in float x){
float w = fwidth(x);
return cos(x) * smoothstep( TWO_PI, 0.0, w );
}
#endif