• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Depicting Darkness

curato

Member
I was wondering if anyone has experimented with depicting darkness in a 2D game without just using straight pixelart and painting black darkness over it with a surface or shader. Is there a good way to do it?

Not for my current project, but I have one than one project in my hopper where darkness would be important and I am just thinking how to do the best way.
 
Hey! While I mainly develop 3D games myself, I do think games like Darkwoord tackle 2D darkness extraordinarily well if thatā€™s what you are looking for. Best of luck with your projects!
 

curato

Member
Thanks. That wasn't exactly what I meant. But they did have an interesting take on lighting. I was just fishing technical wise. But you are right in a way. I may have to do 2.5 and render 3d models with the lighting I want then convert them to sprites to get the effect I am thinking about in GMS.
 

kburkhart84

Firehammer Games
I'm currently working bit by bit on a project. I think what you are looking for is real-time lighting. You can use actual lights in 3d space(even for pixel art), along with normal maps for all the sprites. These can be created by hand, using something like Sprite Lamp, or the way I do it, pre-rendering 3d models and normal maps in the same program.
 

curato

Member
Thanks! That well may be what I am looking for! I knew there had to be a more straight forward way to do what I was thinking than I thought.
 
D

Deleted member 13992

Guest
On the technical side, a fullscreen/application surface shader would do the trick. Something that lets you control curves, levels, that sort of thing.

On the artistic side, darkness (nighttime) looks best when you desaturate a little, and blue or purple-tint shadows slightly. I love Stardew Valley, but it's night times look pretty bad. Although that game has blue tinting, there's no desaturation. All that can be achieved with a LUT/color remap shader.

Playing with light and dark is the next thing. Torches/light don't have much of a glow in daytime, but do a good job emphasizing how dark it is outside of the glow area at night, even if the glow area might be as bright as just simple daytime. This can be done with one of the available lighting systems, or with something as simple as glow sprites, surfaces and blend modes.
 

curato

Member
Yeah I know about those systems. I just have few game ideas I was thinking about as project next which the darkness would be a mechanic in and off itself. As it will be a prime factor getting it handled where the darkness to be as organic as possible is what I am thinking about. I am not really saying yes or no to any one thing. I just know if I pull either of those ideas the lighting has to be 100% quality to pull the game off.
 

Yal

šŸ§ *penguin noises*
GMC Elder
You'll have to be much more specific than "has anyone used darkness without just using a shader" to get a good discussion going (I've done darkness by covering the entire screen in rectangles before, it didn't turn out immersive OR performant, does that count)? Like, what's wrong with just painting black over the screen?

Here's a grab bag of stuff:
  • How to implement without using black paint:
    • First paint a surface with orange (mostly red + slightly less green + a small amount of blue) and then draw black circles on it to make "holes"
    • Then set the blend mode to bm_subtract and draw it over the screen
    • VoilĆ , now you've erased most of the warm colors while still having things actually (slightly) visible in the darkness, much better than pure black for gameplay purposes
  • Rather than bm_subtract, you could use the surface as an alpha mask and draw a scrolling texture with it using a shader:
  • To make the darkness feel more alive, you could add a border of animated tentacles instead of just circles around light sources; if this is implemented by having objects follow the player around and retreat if the light gets too close, it would look very natural.
 

pixeltroid

Member
I have no idea how to make shaders but I
I was wondering if anyone has experimented with depicting darkness in a 2D game without just using straight pixelart and painting black darkness over it with a surface or shader. Is there a good way to do it?
I have no idea how to make shaders or work with them, but I achieved a low-budget "darkness" effect. All I did was have the player draw a big semi-opaque "darkness" sprite . The sprite is as big as the room size (960x540) and follows the player around.

Without darkness:
dark1.jpg

With darkness:
dark2.jpg

It basically acts like a spotlight on the player, and everything else around him is dark. It's not as hi-tech as other methods but it suits my needs and as of now, doesn't reduce the speed of the game so I'm keeping it.
 
Top