lygia
/color
/dither
)Set of dither methods
Dependencies:
lygia
/color
/dither
/interleavedGradientNoise
.glsl
lygia
/color
/dither
/vlachos
.glsl
lygia
/color
/dither
/triangleNoise
.glsl
lygia
/color
/dither
/blueNoise
.glsl
lygia
/color
/dither
/shift
.glsl
lygia
/color
/dither
/bayer
.glsl
Use:
<vec4|vec3|float> dither(<vec4|vec3|float> value[, <float> time])
#ifndef DITHER_FNC
#ifdef TARGET_MOBILE
#define DITHER_FNC ditherInterleavedGradientNoise
#else
#define DITHER_FNC ditherVlachos
#endif
#endif
#ifndef FNC_DITHER
#define FNC_DITHER
float dither(float v) { return DITHER_FNC(v); }
vec3 dither(vec3 v) { return DITHER_FNC(v); }
vec4 dither(vec4 v) { return DITHER_FNC(v); }
#endif
Dependencies:
lygia
/color
/dither
/interleavedGradientNoise
.glsl
lygia
/color
/dither
/vlachos
.glsl
lygia
/color
/dither
/triangleNoise
.glsl
lygia
/color
/dither
/blueNoise
.glsl
lygia
/color
/dither
/shift
.glsl
Use:
<float4|float3|float> dither(<float4|float3|float> value[, <float> time])
#ifndef TIME_SECS
#if defined(UNITY_COMPILER_HLSL)
#define TIME_SECS _Time.y
#endif
#endif
#ifndef RESOLUTION
#if defined(UNITY_COMPILER_HLSL)
#define RESOLUTION _ScreenParams
#endif
#endif
#ifndef DITHER_FNC
#ifdef TARGET_MOBILE
#define DITHER_FNC ditherInterleavedGradientNoise
#else
#define DITHER_FNC ditherVlachos
#endif
#endif
#ifndef FNC_DITHER
#define FNC_DITHER
float dither(float b, float2 fragcoord, const in float time) {
return DITHER_FNC(b, fragcoord, time);
}
float3 dither(float3 rgb, float2 fragcoord, const in float time) {
return DITHER_FNC(rgb, fragcoord, time);
}
float4 dither(float4 rgba, float2 fragcoord, const in float time) {
return DITHER_FNC(rgba, fragcoord, time);
}
#ifdef TIME_SECS
float dither(float b, float2 fragcoord) {
return dither(b, fragcoord, TIME_SECS);
}
float3 dither(float3 rgb, float2 fragcoord) {
return dither(rgb, fragcoord, TIME_SECS);
}
float4 dither(float4 rgba, float2 fragcoord) {
return dither(rgba, fragcoord, TIME_SECS);
}
#endif
#endif
Dependencies:
lygia
/color
/dither
/interleavedGradientNoise
.glsl
lygia
/color
/dither
/vlachos
.glsl
lygia
/color
/dither
/triangleNoise
.glsl
lygia
/color
/dither
/blueNoise
.glsl
lygia
/color
/dither
/shift
.glsl
lygia
/color
/dither
/bayer
.glsl
Use:
<float4|float3|float> dither(<float4|float3|float> value[, <float> time])
#ifndef DITHER_FNC
#ifdef TARGET_MOBILE
#define DITHER_FNC ditherInterleavedGradientNoise
#else
#define DITHER_FNC ditherVlachos
#endif
#endif
#ifndef FNC_DITHER
#define FNC_DITHER
float dither(float v) { return DITHER_FNC(v); }
float3 dither(float3 v) { return DITHER_FNC(v); }
float4 dither(float4 v) { return DITHER_FNC(v); }
#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