Add alphaCutoff shader flag;

This commit is contained in:
bjorn 2019-08-12 17:38:03 -07:00
parent c3af8c14c1
commit d3bf51daef
1 changed files with 5 additions and 0 deletions

View File

@ -97,6 +97,11 @@ const char* lovrShaderFragmentSuffix = ""
" colors(lovrColor, lovrDiffuseTexture, texCoord); \n"
"#else \n"
" lovrCanvas[0] = color(lovrColor, lovrDiffuseTexture, texCoord); \n"
"#ifdef FLAG_alphaCutoff \n"
" if (lovrCanvas[0].a < FLAG_alphaCutoff) { \n"
" discard; \n"
" } \n"
"#endif \n"
#ifdef LOVR_WEBGL
" lovrCanvas[0].rgb = pow(lovrCanvas[0].rgb, vec3(.4545)); \n"
#endif