Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411525 Posts in 69377 Topics- by 58431 Members - Latest Member: Bohdan_Zoshchenko

April 28, 2024, 06:27:11 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityTownhallForum IssuesArchived subforums (read only)TutorialsLighting effects in Game Maker
Pages: [1]
Print
Author Topic: Lighting effects in Game Maker  (Read 7013 times)
Zack Bell
Level 10
*****



View Profile WWW
« on: July 09, 2011, 07:00:33 PM »

This is probably somewhere in the GM Tuts topic, but I guess it won't hurt to ask elsewhere?

What is the best way to get lighting effects in GM? Like flash lights or the popular "ring of light" around the player in dark levels and caves. I assume it has to do with color blending and things like that, I'm just curious as to what is the best approach.

Thanks.
Logged

Theophilus
Guest
« Reply #1 on: July 09, 2011, 07:13:30 PM »

Surfaces and blend modes. Specifically, for what you're describing, additive blending.
Logged
ஒழுக்கின்மை (Paul Eres)
Level 10
*****


Also known as रिंकू.


View Profile WWW
« Reply #2 on: July 09, 2011, 07:14:32 PM »

the simplest way to do the ring of light thing is actually to have a huge black image with a hole in it (with alpha values of the hole fading out), and overlay that on the screen, with the hole on the player

if you don't want it totally black, you'd draw that huge black screen-sized image with an alpha value other than 1

that said there are other ways to do it and entire 'lighting systems' for gm, but the way above is the easiest way to do that particular effect

the way i do that effect in my current game project is a bit tricky but also an alternative: i adjust the alpha values of all the objects depending on their distance from the player, so that as the player approaches an object it becomes visible. this is more resource intensive however, i only do it because i like the surreal effect it gives

there's also probably ways to do it with subtractive blending and such
Logged

Zack Bell
Level 10
*****



View Profile WWW
« Reply #3 on: July 09, 2011, 07:26:39 PM »

the simplest way to do the ring of light thing is actually to have a huge black image with a hole in it (with alpha values of the hole fading out), and overlay that on the screen, with the hole on the player

if you don't want it totally black, you'd draw that huge black screen-sized image with an alpha value other than 1

that said there are other ways to do it and entire 'lighting systems' for gm, but the way above is the easiest way to do that particular effect

the way i do that effect in my current game project is a bit tricky but also an alternative: i adjust the alpha values of all the objects depending on their distance from the player, so that as the player approaches an object it becomes visible. this is more resource intensive however, i only do it because i like the surreal effect it gives

there's also probably ways to do it with subtractive blending and such

Thanks a bunch!

"i adjust the alpha values of all the objects depending on their distance from the player, so that as the player approaches an object it becomes visible.

^This sounds really cool. I may have to play around with it a bit. I haven't done much experimenting with any of the alpha features in GM because I haven't needed to until now!
Logged

Zack Bell
Level 10
*****



View Profile WWW
« Reply #4 on: July 11, 2011, 08:17:21 PM »

Hmm, I'm definitely interested in that extension. It looks nice.

By the way, your game looks pretty awesome! I'm impressed. Did you do all of it yourself (art & code)?

Smiley
Logged

Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic