O'Reilly logo

Lua Game Development Cookbook by Mário Kašuba

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Setting up blending

OpenGL allows you to change the way textures are drawn. This process is called blending and it's often used when combining multiple textures. However, blending can also be applied to texture rendering on screen. OpenGL uses a so-called "blending function" to define the mathematical function that calculates the final color value. For example, the GL_FUNC_ADD blending function defines additive blending, which is used when mixing colored lights in a scene.

This function uses two values:

  • The source value is usually a color or alpha channel value of the texture you are currently using. The source value is also called a fragment.
  • The destination value is a color or alpha channel value that's on the destination surface or the screen. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required