mirror of
https://github.com/Jozufozu/Flywheel.git
synced 2024-12-27 23:47:09 +01:00
Always use discard
This commit is contained in:
parent
7da64cded6
commit
0c6a75ade5
1 changed files with 14 additions and 0 deletions
|
@ -26,6 +26,14 @@ void FLWFinalizeWorldPos(inout vec4 worldPos) {
|
|||
#elif defined(FRAGMENT_SHADER)
|
||||
#use "flywheel:core/lightutil.glsl"
|
||||
|
||||
#define ALPHA_DISCARD 0.1
|
||||
//
|
||||
//#if defined(ALPHA_DISCARD)
|
||||
//#if defined(GL_ARB_conservative_depth)
|
||||
//layout (depth_greater) out float gl_FragDepth;
|
||||
//#endif
|
||||
//#endif
|
||||
|
||||
vec4 FLWBlockTexture(vec2 texCoords) {
|
||||
return texture2D(uBlockAtlas, texCoords);
|
||||
}
|
||||
|
@ -39,6 +47,12 @@ void FLWFinalizeColor(vec4 color) {
|
|||
color.a = a;
|
||||
#endif
|
||||
|
||||
#if defined(ALPHA_DISCARD)
|
||||
if (color.a < ALPHA_DISCARD) {
|
||||
discard;
|
||||
}
|
||||
#endif
|
||||
|
||||
gl_FragColor = color;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue