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

11 lines
No EOL
296 B
Text

/*
contributors: Inigo Quiles
description: generate the SDF of a sphere
use: <float> sphereSDF( <float3> pos[], <float> size] )
*/
#ifndef FNC_SPHERESDF
#define FNC_SPHERESDF
float sphereSDF(float3 p) { return length(p); }
float sphereSDF(float3 p, float s) { return sphereSDF(p) - s; }
#endif