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

21 lines
676 B
HLSL

#include "../math/aastep.hlsl"
/*
contributors: Patricio Gonzalez Vivo
description: Fill a SDF. From PixelSpiritDeck https://github.com/patriciogonzalezvivo/PixelSpiritDeck
use: fill(<float> sdf, <float> size [, <float> edge])
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
*/
#ifndef FNC_FILL
#define FNC_FILL
float fill(float x, float size, float edge) {
return 1.0 - smoothstep(size - edge, size + edge, x);
}
float fill(float x, float size) {
return 1.0 - aastep(size, x);
}
#endif