Publication date: 07/08/2024

Alpha Blending

The BlendFunc message allows for alpha blending. To use it, send a BlendFunc message to a scene, for example:

scene << BlendFunc(SRC_ALPHA, ONE_MINUS_SRC_ALPHA)

SRC_ALPHA and ONE_MINUS_SRC_ALPHA are OpenGL constants that tell BlendFunc to use alpha to blend against the existing display buffer. Disabling z-buffer testing or rendering primitives from back to front might be needed for some applications. By default, the z-buffer tests prevent anything from drawing behind a transparent polygon after it is drawn.

More information about all the constants available to BlendFunc (many of which are not useful to the JSL programmer) are available in the OpenGL documentation at opengl.org.

Want more information? Have questions? Get answers in the JMP User Community (community.jmp.com).