GM:S 1.4 Adding and Subtracting Surfaces

Discussion in 'Programming' started by ThunkGames, Jun 28, 2016.

  1. ThunkGames

    ThunkGames Guest

    I've been trying to figure out how to use blend modes in a lighting system for a while, but I always end up getting helplessly lost. So here is what I am trying to do:

    I have 3 960 by 960 surfaces. I use draw_set_colour_write_enable(false, false, false, true) before I draw to these surfaces, so the surfaces only have alpha information.

    One surface (which I will call dayNightSurface) is the darkness levels to draw based on what time it is in the world. This is often in flux.

    Another surface (which I will call shadowSurface) is the darkness to draw based on the position of blocks. When drawn in black, it looks like this.

    The final surface (which I will call lightSurface) is the lightness given off by certain blocks.

    I want what is drawn to the screen to be (dayNightSurface + shadowSurface) - lightSurface in a color of my choosing.

    How do I do this? Thanks for the help.

  2. iMilchshake

    iMilchshake Member

    Jun 23, 2016

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice