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

16 lines
620 B
GLSL

/*
contributors: [Brad Larson, Ben Cochran, Hugues Lismonde, Keitaroh Kobayashi, Alaric Cole, Matthew Clark, Jacob Gundersen, Chris Williams]
description: adaptive threshold from https://github.com/BradLarson/GPUImage/blob/master/framework/Source/GPUImageAdaptiveThresholdFilter.m
use: adaptiveThreshold(<float> value, <float> blur_value [,<float> bias])
*/
#ifndef FNC_ADAPTIVETHRESHOLD
#define FNC_ADAPTIVETHRESHOLD
float adaptiveThreshold(in float v, in float blur_v, in float b) {
return step(blur_v + b, v);
}
float adaptiveThreshold(in float v, in float blur_v) {
return step(blur_v - 0.05, v);
}
#endif