Dynamic Lights with Impact

Place for questions and answers for all newcomers and new coders. This is a free for all forum, no question is too stupid and to noob.
Post Reply
mystd
Posts: 13
Joined: Mon Jul 30, 2012 8:44 am

Dynamic Lights with Impact

Post by mystd »

I'm thinking of using dynamic lights instead of drawing light effects into the sprite sheets. Is that possible without webGL and would that be overkill for smartphones?
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: Dynamic Lights with Impact

Post by Jackolantern »

What exactly do you mean by dynamic lighting effects in a 2D game? There are several different things that could be called dynamic lights in 2D :)
The indelible lord of tl;dr
mystd
Posts: 13
Joined: Mon Jul 30, 2012 8:44 am

Re: Dynamic Lights with Impact

Post by mystd »

I mean using plain textures/graphics without light effects and then use dyn lights. Normally you render/draw with a light source in mind, the problem with that is that you need to draw way too much if you want to implement different light sources. So its much easier to not draw with any specific light source and let the software do the rendering/ambient light effects. Thus I can use small lights that only illuminate the map and characters a bit and the game will generally stay dark. Problem is I dono how hardware intense this is and I want the game to be playable on smartphones too.
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: Dynamic Lights with Impact

Post by Jackolantern »

I have not seen this done yet with really any HTML5 canvas apps. I would have to assume that this is quite resource intensive if someone did work it out since browsers only give you a very limited portion of memory and CPU cycles to work with. I would also believe that this would definitely be a problem on smatphones, where hybrid HTML5 apps still lag a bit behind native apps in performance.

I did find this, but I don't think it is exactly what you are looking for, as this is actually a normal mapping technique.
The indelible lord of tl;dr
mystd
Posts: 13
Joined: Mon Jul 30, 2012 8:44 am

Re: Dynamic Lights with Impact

Post by mystd »

Hmm well Ill have to research some more then, I can render the images afterwards manually too so Ill start off without light effects.
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: Dynamic Lights with Impact

Post by Jackolantern »

I will say that today's browser-based players are often more tolerant of slow loading start-ups than poor performance during gameplay. Therefore, you should probably at least experiment with pre-baking the lighting into the sprites and just have more sprites you swap between, or even separate out fake lighting effects onto small transparent sprites to lay over your base sprites. What can feel like a crapload of sprites may just be an extra second or so of initial loading.
The indelible lord of tl;dr
Post Reply

Return to “Beginner Help and Support”