[demo] Lighting with shadows

Post here your demos and examples with the source files.
Forum rules
Always post the games with a screenshot.
The file must have the ged and data files (complete game source)
Use the forum attachment to post the files.
It is always better to use the first post to put the game files

[demo] Lighting with shadows

Postby morcior » Fri May 11, 2007 1:18 pm

I had an idea to create a lighting effect with realtime shadows using the draw_from function in the latest version of GE, so I made this little demo. I don't think its that practical for use in games since multiple lights won't blend together (BLEND OPTIONS ON DRAW_FROM PLEASE MAKSLANE!!!!), and draw_from can't scale very fast either.

anyway here it is:

Image
Attachments
GE Lighting.zip
GED Source with data files
and compiled exe
(1.95 MiB) Downloaded 481 times
morcior
 
Posts: 83
Joined: Fri Jan 12, 2007 12:16 am
Location: UK
Score: 9 Give a positive score

Postby AnimeTank » Fri May 11, 2007 2:27 pm

Wow, i am impressed! I never new GE had such a function to do that. Well yea, probably. Well anyway, thats terrific. I know that took some time out of your day. Now only if you can incorporate that into a real game, that would be just awesome. Keep up the great work :D
Current Projects:

Some game about some guy... :)

Message me if you have an XboxLive account. Then send me a Friend Request to my Gamertag, AnimeTank.
Message me if you have a WoW account. Then tell me what server your on, along with your name.
User avatar
AnimeTank
 
Posts: 96
Joined: Sat May 05, 2007 10:37 pm
Location: At my House, on my computer, in my seat
Score: 13 Give a positive score

Postby morcior » Sat May 12, 2007 3:51 am

Thanks, I guess I should explain the effect a bit:

It uses 2 canvases. 1 for the light 'mask' , and one for drawing the shadow.

the light mask is positioned above everything, and it is cleared to black (rgb(0,0,0)) with 0.1 alpha every frame, almost completely opaque.

you then render a png file with an alpha layer (that looks like a light, radial gradients work well!) using draw_from, this bakes the alpha over the existing darkness and you get the light effect over whatever is under the actor.

its then just a case of drawing the shadow based on the lights position relative to the actor and calulating the scale. I just guessed at this code, a much better job could be done I'm sure. Its in bg2->Draw Actor
morcior
 
Posts: 83
Joined: Fri Jan 12, 2007 12:16 am
Location: UK
Score: 9 Give a positive score

Postby scythe » Sat May 12, 2007 5:39 pm

Looks cool.

Scythe
scythe
 
Posts: 37
Joined: Wed Apr 11, 2007 2:50 pm
Location: Australia
Score: 0 Give a positive score

he eh

Postby kyensoftware » Sat May 12, 2007 11:53 pm

heh heh heh...I replaced the shadow pic with a car, and now it looks demented...Cool!
User avatar
kyensoftware
 
Posts: 198
Joined: Thu Oct 26, 2006 7:49 am
Score: 5 Give a positive score

Postby Joshua Worth » Sun May 13, 2007 2:23 am

if the draw_from function is fast enough, you could do split-screening :)
Stay sweet
User avatar
Joshua Worth
 
Posts: 515
Joined: Tue Jul 19, 2005 12:00 am
Location: Stralia
Score: 5 Give a positive score

Postby Game A Gogo » Sun May 13, 2007 11:42 pm

draw_from is really fast for me
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

same

Postby kyensoftware » Mon May 14, 2007 10:06 am

Same, but I have an ATI Radeon 9200, which has good resizing.
don't you have a Gfx processor from the ATI Radeon series, gogo?
Games for Windows, Linux, and PPC
Bin dosnt stand for "Binary";
it stands for Bin.
You know, where the junk goes...
User avatar
kyensoftware
 
Posts: 198
Joined: Thu Oct 26, 2006 7:49 am
Score: 5 Give a positive score

Cool...

Postby Bee-Ant » Sat Jun 09, 2007 4:58 am

Cool man...I like it!!! :D
User avatar
Bee-Ant
 
Posts: 3723
Joined: Wed Apr 11, 2007 12:05 pm
Location: http://www.instagram.com/bee_ant
Score: 210 Give a positive score

Re: same

Postby Game A Gogo » Sun Jun 10, 2007 12:46 am

kyensoftware wrote:Same, but I have an ATI Radeon 9200, which has good resizing.
don't you have a Gfx processor from the ATI Radeon series, gogo?


wow, never actually seen this, so I guess I will comment right now :3

No, All I have for my GFx possessor is from intel.
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score


Return to Game Demos

Who is online

Users browsing this forum: No registered users and 1 guest

cron