Game
Rainswept
7 years ago

#9 How simple 2D lighting is being done using blend modes in Rainswept


​As the name suggests, weather plays a major role in creating the atmosphere for Rainswept. It’s usually raining in Pineview (obviously) but there are times when the sun manages to break through and bathe the hills and valleys in a magical orange glow. Not only is it pretty to look at, but the contrast between the weather conditions makes the player more aware of when it does rain. Here’s a comparison between an overcast day and a clear evening, during sunset:

5d0a15ce3bc5a.jpg

You’d be surprised to learn how easily this effect is achieved! It basically just consists of putting a blue gradient over the scene, and setting its blend mode to “divide” - which is a built in feature in photoshop but requires a custom shader in Unity to implement (or an asset that does it for you - I use “Blend Mode Shader 2D”​) I’m not sure if this is pretty much how lighting effects have always been done for 2D games, but it’s been exciting working this out on my own!
A similar method is used for creating the interior lighting affected by the stained glass in the church as seen here:

5d0a15cf670e6.jpg

There are multiple layers at work here, but the main red and blue effect is created by using the following gradients (Red set to “Linear Dodge” and blue set to “Pin Light” blend modes)

5d0a15d0736fd.jpg

Pretty simple, yet effective, right? This method is used across the whole game to create a whole variety of effects, including the glare from the sun. Just a circular gradient can be used instead of creating dynamic light effects for a 2D game. It’s a huge time saver, but looks pretty decent too!
In this scene, multiple layers of lighting have been stacked (and given parallax) to create the glare from an early morning sun shining through the windows.

5d0a15d132f17.gif

If we separate the layers out, this is what is seen:

5d0a15d52c0ba.png

To show in greater detail how the layers are stacked on top of each other (and what blend modes have been used for each of them) you can take a look at this image:

5d0a15d61e55a.png

​Using this method successfully comes down to trial and error, and a lot of experimentation. Multiple combinations of base color for the gradient, combined with one of the many (25 total) blend modes end up creating scenes and effects that I didn’t even have in mind before starting out. It’s a really exciting process, and I can’t wait to see the different ways it’ll continue to affect the visual style of Rainswept!

See you next week :)
-Armaan



8 comments

Loading...

Next up

Testing the game repeatedly can get quite tiring, but at least there's some great views on the way! ;)

Just made this combination lock minigame and I'm super excited about it! 😁 Now all the Detective needs to do is look around for clues as to what the combination might be 🤔

#3 Building a neighborhood

#4 Weather effects and storybook art style

#1 Building an ocean

A new game by the developer of Rainswept!

"Forgotten Fields" demo and Kickstarter coming soon!

https://www.kickstarter.com/projects/forgotten-fields/forgotten-…

Forgotten Fields is a nostalgic game about creativity and the passage of time.

#2 Building trains

Forgotten Fields launches on April 14!

#0 First devlog for Forgotten Fields!

Happy new year, everyone! <3 Thanks for the love and support throughout 2018, and for making it one of the best years ever! Just a few more weeks to go until the full game release :)