Tell me more ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Could help about creating lighting and shadows in a 2D environment, like the image below.

http://i.stack.imgur.com/0FEQz.gif

I did several searches but got no results

( ps: sorry my bad english i'm brazilian )

share|improve this question
Take a look at catalinzima.com/samples/dynamic-2d-shadows – Luis Estrada Dec 24 '12 at 2:32
1  
The link to the actual article in Luis' linked blog post is dead, but here's a link to the archived article (which, incidentally, seems to be the source of your image): archive.gamedev.net/archive/reference/programming/features/…. Note that this requires GL, which for JavaScript means using WebGL. You can recreate almost all of that logic on plain 2D canvas if you really want, but it'll take more work, more math, and won't be nearly as efficient. – Sean Middleditch Dec 24 '12 at 7:32
3  
One more note: that article is pretty old and I wouldn't claim it's the best way to do things on modern hardware. If you go with WebGL and are comfortable with shaders and framebuffer objects, you can likely do a lot better. – Sean Middleditch Dec 24 '12 at 7:34
That's what I saw and have studied this article and do not really feel comfortable with it, I'm trying to develop my own shadow and I like the results anyway thanks for listening =) – user24310 Dec 24 '12 at 16:16

1 Answer

up vote 2 down vote accepted

Take a look at this library: Illuminated.js http://blog.greweb.fr/wp-content/uploads/2012/05/illuminatedjs.jpg

it's an work in progress, but just reading the source code you can absorb some information about how they made it.

share|improve this answer
very bad performance for animations =( – user24310 Dec 26 '12 at 20:39
-1 because you're not explaining anything. Answers should include helpful information by themselves. – Yannbane Jan 20 at 13:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.