Created
November 10, 2024 23:55
-
-
Save otanodesignco/640c777e40f13e15bd45f44fecb8d3db to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void clip( float clipValue, float alphaThreshold, int type ) | |
{ | |
// switch operation because were only value checking type | |
switch( type ) | |
{ | |
case 0: // 0 means less than | |
if( clipValue < alphaThreshold ) discard; | |
break; | |
case 1: // 1 means greater than | |
if( clipValue > alphaThreshold ) discard; | |
break; | |
case 2: // less than equal to | |
if( clipValue <= alphaThreshold ) discard; | |
break; | |
case 3: // greater than equal 2 | |
if( clipValue >= alphaThreshold ) discard; | |
break; | |
case 4: // equal to | |
if( clipValue == alphaThreshold ) discard; | |
break; | |
default: // defaults to less than | |
if( clipValue < alphaThreshold ) discard; | |
break; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment