2D Dynamic Lighting Tutorial

Anything related in any way to game development as a whole is welcome here. Tell us about your game, grace us with your project, show us your new YouTube video, etc.

Moderator: PC Supremacists

Re: 2D Dynamic Lighting Tutorial

Postby Firzen on Wed Feb 09, 2011 5:20 am

Just to be clear and make sure that you understand my point.

A tutorial is not ment to be dropped into your code, it just illustrates the idea.

Now, I don't know about how you code, but I actually prefer to write code myself than "dropping it in".
You can surely optimize the code and I won't say that that's not a valuable discussion, but for those that just want to learn it surely is a bit of a distraction and on top of that, your wording on that "critique" is not really constructive.

pubby8 wrote:It is very nice of you to write such an example, however I wanted to point out that there are numerous flaws in your method and that this code should not be used in game.

You should spend some time and optimize it.


All your posts sounds pretty much the same, it's always like: "Yeah, pretty nice what you did there. Oh, also, fuck you"
But that's not how a forum or real life works. Pointing out that the code can be optimized and all is not a bad thing. But the way in which you do it is.

Also, like I said before, optimizing tutorial code is just bad, because it easily obfuscates the basic idea. While you might want to point out ways to optimize the method you don't want to actually include them in the same tutorial about basic lighting techniques. So at least start a new topic if you want to discuss optimization issues.
Firzen
Chaos Rift Newbie
Chaos Rift Newbie
 
Posts: 23
Joined: Mon Jul 20, 2009 8:13 pm

Re: 2D Dynamic Lighting Tutorial

Postby N64vSNES on Wed Feb 09, 2011 6:22 am

We should all take bets on how long it'll be before pubby8 gets banned :lol:

The tutorial was great, very well explained. I'll probably have to play with this later. ;)
N64vSNES
Chaos Rift Devotee
Chaos Rift Devotee
 
Posts: 657
Joined: Thu Aug 12, 2010 12:25 pm

Re: 2D Dynamic Lighting Tutorial

Postby dandymcgee on Wed Feb 09, 2011 2:44 pm

N64vSNES wrote:We should all take bets on how long it'll be before pubby8 gets banned :lol:

Honestly, I think he's funny.
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
 
Posts: 4911
Joined: Tue Apr 29, 2008 4:24 pm
Location: New Hampshire

Re: 2D Dynamic Lighting Tutorial

Postby GroundUpEngine on Thu Feb 10, 2011 9:42 am

dandymcgee wrote:
N64vSNES wrote:We should all take bets on how long it'll be before pubby8 gets banned :lol:

Honestly, I think he's funny.

LOL
User avatar
GroundUpEngine
Chaos Rift Devotee
Chaos Rift Devotee
 
Posts: 869
Joined: Sun Nov 08, 2009 4:01 pm
Location: UK

Re: 2D Dynamic Lighting Tutorial

Postby dandymcgee on Thu Feb 10, 2011 5:31 pm

GroundUpEngine wrote:
dandymcgee wrote:
N64vSNES wrote:We should all take bets on how long it'll be before pubby8 gets banned :lol:

Honestly, I think he's funny.

LOL

Told ya so. Even GroupUpEngine is laughing.
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
 
Posts: 4911
Joined: Tue Apr 29, 2008 4:24 pm
Location: New Hampshire

Re: 2D Dynamic Lighting Tutorial

Postby dnxviral on Wed Mar 02, 2011 9:30 pm

dandymcgee wrote:
GroundUpEngine wrote:
dandymcgee wrote:
N64vSNES wrote:We should all take bets on how long it'll be before pubby8 gets banned :lol:

Honestly, I think he's funny.

LOL

Told ya so. Even GroupUpEngine is laughing.

Haha the whole thing was funny

Besides that irrelevancy. The tutorial is freakin awesome. Impressed, I applaud you. :) I'll be sure to keep this in mind!
User avatar
dnxviral
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
 
Posts: 53
Joined: Tue Dec 14, 2010 8:49 pm
Location: dnXstudios

Re: 2D Dynamic Lighting Tutorial

Postby MadPumpkin on Fri Mar 11, 2011 12:57 am

Wow... This is completely amazing, I'm very impressed with the whole thing :worship: I've honestly never seen anything that made me awe for longer than just even the screen shot of the dynamic light in action. And hey, why can't I be a Jealous Self-Righteous Prick? I demand that I be changed to a Jealous Prick!!

EDIT: Not exactly what I had in mind, but still fitting.
While Jesus equipped with angels, the Devil's equipped with cops
For God so loved the world that he blessed the thugs with rock
Image
Image
Image
User avatar
MadPumpkin
Chaos Rift Maniac
Chaos Rift Maniac
 
Posts: 489
Joined: Fri Feb 13, 2009 6:48 pm
Location: C:\\United States of America\Utah\West Valley City\Neighborhood\House\Computer Desk

Re: 2D Dynamic Lighting Tutorial

Postby TheAustech on Sat Apr 02, 2011 10:52 pm

Whoa, lots of posts since I've been gone.

Thanks for kind of standing up for me, but to be fair pubby8 was only addressing that it was unoptimized. And looking back at my tutorial, there are some things that should of been taken care of for optimization.

Like storing the trig value, it would help a lot.

Maybe pubby didn't say it in the..."nicest" way possible, but still he did bring up that it was unoptimized a bit. :P

Thanks again for all the support though, it means a lot ;)
User avatar
TheAustech
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
 
Posts: 98
Joined: Fri Sep 03, 2010 5:38 pm
Location: Maryland

Re: 2D Dynamic Lighting Tutorial

Postby Falco Girgis on Fri May 13, 2011 10:47 am

TheAustech wrote:Whoa, lots of posts since I've been gone.

Thanks for kind of standing up for me, but to be fair pubby8 was only addressing that it was unoptimized. And looking back at my tutorial, there are some things that should of been taken care of for optimization.

Like storing the trig value, it would help a lot.

Maybe pubby didn't say it in the..."nicest" way possible, but still he did bring up that it was unoptimized a bit. :P

Thanks again for all the support though, it means a lot ;)
It wasn't just this post. He spent all of his time trolling around looking for any little place to bitch to prove his superiority.

MadPumpkin wrote:And hey, why can't I be a Jealous Self-Righteous Prick? I demand that I be changed to a Jealous Prick!!
Thank you so much, whoever changed his rank to "Dumbass." Very fitting.
"So what happens if the Elysian Shadows Kickstarter fails?"
Image
User avatar
Falco Girgis
Elysian Shadows Team
Elysian Shadows Team
 
Posts: 10693
Joined: Thu May 20, 2004 3:04 pm
Location: Studio Vorbis, AL

Re: 2D Dynamic Lighting Tutorial

Postby qwerber on Wed Nov 30, 2011 3:43 am

Err, I know this thread was from May, but I wanted to contribute something.

Instead of using the trigonometric functions, you can simply extend the x and y distances between the light and the vertex you are computing. Maybe a little code will explain things:

Code: Select all
castedPoint->x = (light->x - vertex->x) * 5 + light->x;
castedPoint->y = (light->y - vertex->y) * 5 + light->y;


For each vertex you compute a casted point, and then used those points to render shadow geometry. There is a slight advantage because you avoid the trig functions, but unless this is performance critical code, any trig overhead can be neglected...

I also noticed that multiple light blending was not mentioned... don't know if I should bring that up... this seems to be a very strict forum;

Anyways, C++ isn't my "main" language so forgive my if I coded wrong, I think it's pretty much understandable.
qwerber
ES Beta Backer
ES Beta Backer
 
Posts: 4
Joined: Wed Nov 30, 2011 3:32 am

Re: 2D Dynamic Lighting Tutorial

Postby HeadClot on Sat Aug 02, 2014 8:53 pm

Just thought I would reply to this as some images in the stickies are broken/borked. :\
HeadClot
Chaos Rift Newbie
Chaos Rift Newbie
 
Posts: 10
Joined: Sat Aug 02, 2014 1:35 pm

Re: 2D Dynamic Lighting Tutorial

Postby dandymcgee on Sat Aug 02, 2014 10:14 pm

HeadClot wrote:Just thought I would reply to this as some images in the stickies are broken/borked. :\

Probably not going to be fixed unless Google happens to have them cached and someone is bored enough to go find them.
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
 
Posts: 4911
Joined: Tue Apr 29, 2008 4:24 pm
Location: New Hampshire

Re: 2D Dynamic Lighting Tutorial

Postby Aido97 on Sun Aug 03, 2014 10:20 am

Oh man great tutorial. Been looking for something like this :shock2:
Signature signature = new Signature();
signature.isFunny = true;
otherUsers.LaughAtSignature();
User avatar
Aido97
Chaos Rift Newbie
Chaos Rift Newbie
 
Posts: 3
Joined: Fri Nov 08, 2013 7:53 pm
Location: Ireland

Previous

Return to Game Development

Who is online

Users browsing this forum: Bing [Bot] and 2 guests