Code archives/3D Graphics - Mesh/SetTextureAlphaWithThreshold() function

This code has been declared by its author to be Public Domain code.

Download source code

SetTextureAlphaWithThreshold() function by Zethrax2012
This function basically allows you to set a color threshold value to be used to determine which of two possible pixel alpha values to apply to each pixel in a texture. If the color level of a pixel is above this threshold then the high color alpha value will be used to set its alpha. If the color level of a pixel is below or equal to this threshold then the low color alpha value will be used to set its alpha.

This can be useful if you have dark areas on a texture that you want to assign a particular alpha value to while still allowing the color areas to stand out.


; The code is at: http://www.blitzbasic.com/codearcs/codearcs.php?code=3001

; And by the way, codeboxes should be an option for code in the code archives.

Comments

None.

Code Archives Forum