dynamic lighting in a 2D game...

Started by
13 comments, last by neonstar 23 years, 9 months ago
Check this adress out:
http://members.xoom.com/_XMCM/gumbyware/lighting.htm
It explains the basics of 2d lightning....



-------
Hardguy

Currently developing Fiend.
A horror as never seen before.

fiend.ingava.com
Advertisement
thanks for the addie, i''ll check it out.

by the way, i looked at your fiend website, and the game looks great! i''m currently trying to write a, well kinda secrect, but 2D action game that''s got a semi-isometric kinda look to it, and it will have great graphics because i''ve obtained a great artist. I wanted to put lighting into it to make it look that much better.

Oh well, thanks for the info, i''ll check it out
david
--david@neonstar.netneonstar entertainment
No wonder I couldn''t find this thread to follow up on it, it''s in theory not general.

I myself looked into the 2D lighting and this is what I''ve come up with. Using the example in the Isometric Direct3d tile enging I was able to create a 2d renderer using Direct3d with dynamic lighting.

By drawing every tile as a triangle pair, you can apply vertex lighting (wich is done by almost all hardware) to create your lighting. By pre-calculating a light map every frame (Take all your light "sources" and mathematically will an array with light values) you can apply the lighting as you render your tiles. Not only do you get dynamic lighting, you get colored lighting. And the more advanced your pre-calculation routines the fancier your lighting will look.

My first Idea was to use Direct3d Lights, but they don''t fit at all in a 2d game for two reasons. 1) They rely on 3d geometry for bouding, since your map is flat, you''d always get concentric circles vs. bounding by walls etc. and 2) they are alot more computensively heavy.

But with vertex lighting and a little pre-calculation some really nice lighting can be done. If you want the little test thing I hacked together just e-mail me.

-Zims
i emailed you, thanks a lot...

david

--
davidw@heehaw.com
neonstar entertainment
--david@neonstar.netneonstar entertainment
Does any one have an idea how diablo 2 makes their
lightning in software mode?

-------
Hardguy

Currently developing Fiend.
A horror as never seen before.

fiend.ingava.com


Edited by - hardguy on June 28, 2000 5:01:41 PM

This topic is closed to new replies.

Advertisement