lib-alpha.glsl
Public Functions:
alphaKill
Copied to your clipboardimport lib-sampler.glslimport lib-random.glsl
Opacity map, provided by the engine.
Copied to your clipboard//: param auto channel_opacityuniform SamplerSparse opacity_tex;
Alpha test threshold.
Copied to your clipboard//: param custom {//: "default": 0.33,//: "label": "Alpha threshold",//: "min": 0.0,//: "max": 1.0,//: "group": "Common Parameters"//: }uniform float alpha_threshold;
Alpha test dithering.
Copied to your clipboard//: param custom {//: "default": false,//: "label": "Alpha dithering",//: "group": "Common Parameters"//: }uniform bool alpha_dither;
Emulate alpha test : discard current fragment if its opacity is below a user defined threshold. Should be called AFTER texture sampling calls: it can break derivatives
Copied to your clipboardvoid alphaKill(float alpha){float threshold = alpha_dither ? getBlueNoiseThresholdTemporal() : alpha_threshold;if (alpha < threshold) discard;}void alphaKill(SparseCoord coord){alphaKill(getOpacity(opacity_tex, coord));}