How To Use Blend Modes

on February 20, 2014 - 26464 Views

Blend modes are a quick and easy way to add stunning visual effects to your GameMaker projects. In this post we’ll take a look at some of the effects which can be produced using blend modes, explain how to use blend modes in your games, and provide resources for extended use of GameMaker blend modes.

Basic Blend Modes

There are four basic blend modes: normal, additive, subtractive, and max blending.

Normal blending is the default blend mode. Normal blending produces a standard effect when transparent sprites overlap.

Additive blending combines the luminosity values of overlapping light areas. This creates a unique effect. Additive blending can be used to create impressive lighting effects and more.

Subtractive blending subtracts the luminosity values of overlapping light area. Using subtractive blending, you can create a ‘fog of war’ effect as commonly seen in real-time strategy games.

Max blending is similar to additive blending, and is used less often than the other basic blend modes.

How To Use Blend Modes

Using the basic blend modes is simple. Each blend mode is represented by a constant value: bm_normal, bm_add, bm_subtract, and bm_max. Using the function draw_set_blend_mode() you can define which blend mode is active. Blend modes work in both desktop and mobile games, excluding non-WebGL HTML5 games.

Typically, you will set a blend mode, draw something, and then reset the blend mode to normal. To produce more refined effects, try using gradients. You can create gradients with graphics editing programs like Photoshop or Gimp.

It is very easy to change blend modes and create varied visual effects with minimal effort.

Extended Blend Modes

Extended blend modes allow you to refine the effect you want to produce. Extended blend modes can be difficult to understand and are outside of the scope of this article, however you can read a detailed explanation of extended blend modes here »

GameMaker user Phantom107 demonstrated how extended blend mode sources and destinations can be combined in a post on the GameMaker community forums.

GameMaker blend modes are powerful and easy to use. Try them out in your next project!

4 Responses to How To Use Blend Modes

  1. csanyk says:

    Lol, no one ever has time to try to explain the extended blend modes. They always just throw up the picture and let the reader try to make sense of it.

    • Actually, there’s a great explanation linked within the article. It’s the best explanation I’ve seen so far.

    • Vohjiin says:

      True Valhalla is right the explanation by Xot is by the far the best and the image comparison by Phantom107 i just glorious honestly.

      It would be nice to see a detailed article on each blend mode combined with each other and what the effect is, how it is produced, and a few examples of how to use it. Of course it would be like 121 articles or something…that might actually make a really good content to do…If only I had a way better grasp on all the blend modes and more knowledge of them.

  2. Catox says:

    I’ll give a shot to this link to gmlscript that you shared.
    I must say I’ve mostly been hitting a wall when it comes to “understand” how those blend modes actually work. I THINK I’ve got a good grasp on the main principles of the inclusion/exclusion of colors/alpha parts of picture A VS picture B, but then when you experience it, you get strange results.

    The most important thing for me being a difference of treatment between surface and sprite drawing. One being blurry, and the other one being, how to say, ‘incomplete’. I shared about this on the GMC forums and even made and extended version of Phantom107’s tool to make it more flexible and demonstrate this effect.

    If you want to give it a try, it’s here : http://gmc.yoyogames.com/index.php?showtopic=588273

Leave a Reply

Your email address will not be published. Required fields are marked *

« »

UA-86813905-1