lygia
/filter
/edge
)Wrapper around three different edge detection algorithms Sobel, Prewitt, and directional Sobel
Dependencies:
lygia
/sample
/clamp2edge
.glsl
lygia
/filter
/edge
/prewitt
.glsl
lygia
/filter
/edge
/sobel
.glsl
lygia
/filter
/edge
/sobelDirectional
.glsl
Use:
edge(<SAMPLER_TYPE> texture, <vec2> st, <vec2> pixels_scale)
#ifndef EDGE_FNC
#define EDGE_FNC edgeSobel
#endif
#ifndef EDGE_TYPE
#define EDGE_TYPE float
#endif
#ifndef EDGE_SAMPLER_FNC
#define EDGE_SAMPLER_FNC(TEX, UV) sampleClamp2edge(TEX, UV).r
#endif
#ifndef FNC_EDGE
#define FNC_EDGE
EDGE_TYPE edge(in SAMPLER_TYPE tex, in vec2 st, in vec2 offset) {
return EDGE_FNC(tex, st, offset);
}
#endif
Dependencies:
lygia
/sampler
.glsl
lygia
/filter
/edge
/prewitt
.glsl
lygia
/filter
/edge
/sobel
.glsl
lygia
/filter
/edge
/sobelDirectional
.glsl
Use:
edge(<SAMPLER_TYPE> texture, <float2> st, <float2> pixels_scale)
#ifndef EDGE_FNC
#define EDGE_FNC edgeSobel
#endif
#ifndef EDGE_TYPE
#define EDGE_TYPE float
#endif
#ifndef EDGE_SAMPLER_FNC
#define EDGE_SAMPLER_FNC(TEX, UV) SAMPLER_FNC(TEX, UV).r
#endif
#ifndef FNC_EDGE
#define FNC_EDGE
EDGE_TYPE edge(in SAMPLER_TYPE tex, in float2 st, in float2 offset) {
return EDGE_FNC(tex, st, offset);
}
#endif
LYGIA is dual-licensed under the Prosperity License and the Patron License for sponsors and contributors.
Sponsors and contributors are automatically added to the Patron License and they can ignore the any non-commercial rule of the Prosperity Licensed software (please take a look to the exception).
It's also possible to get a permanent comercial license hook to a single and specific version of LYGIA.
Sign up for the news letter bellow, joing the LYGIA's channel on Discord or follow the Github repository