Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ uniform vec4 blueNoiseJitter;
#endif

void opacityDither(float alpha, float id) {
if (alpha <= 0.0)
discard;

if (alpha >= 1.0)
return;

#if STD_OPACITY_DITHER == BAYER8

float noise = bayer8(floor(mod(gl_FragCoord.xy + blueNoiseJitter.xy + id, 8.0))) / 64.0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ uniform blueNoiseJitter: vec4f;
#endif

fn opacityDither(alpha: f32, id: f32) {
if (alpha <= 0.0) {
discard;
}

if (alpha >= 1.0) {
return;
}

#if STD_OPACITY_DITHER == BAYER8

var noise: f32 = bayer8(floor((pcPosition.xy + uniform.blueNoiseJitter.xy + id) % vec2f(8.0))) / 64.0;
Expand Down