All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jogamp.opengl.util.glsl.fixedfunc.shaders.mgl_alphatest.fp Maven / Gradle / Ivy

There is a newer version: 2.3.2
Show newest version

void alphaTest(inout vec4 color) {
    if( MGL_GREATER == mgl_AlphaTestFunc ) {
        if ( color.a <= mgl_AlphaTestRef ) {
            DISCARD(color);
        }
    } else if( MGL_LESS == mgl_AlphaTestFunc ) {
        if ( color.a >= mgl_AlphaTestRef ) {
            DISCARD(color);
        }
    } else if( MGL_LEQUAL == mgl_AlphaTestFunc ) {
        if ( color.a > mgl_AlphaTestRef ) {
            DISCARD(color);
        }
    } else if( MGL_GEQUAL == mgl_AlphaTestFunc ) {
        if ( color.a < mgl_AlphaTestRef ) {
            DISCARD(color);
        }
    } else if( MGL_EQUAL == mgl_AlphaTestFunc ) {
        if ( abs( color.a - mgl_AlphaTestRef ) > EPSILON ) {
            DISCARD(color);
        }
    } else if( MGL_NOTEQUAL == mgl_AlphaTestFunc ) {
        if ( abs( color.a - mgl_AlphaTestRef ) <= EPSILON ) {
            DISCARD(color);
        }
    } else if( MGL_NEVER == mgl_AlphaTestFunc ) {
        DISCARD(color);
    } /* else if( MGL_ALWAYS == mgl_AlphaTestFunc ) {
      // NOP
    } */
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy