Jump to content

View more

Image of the Day

Boxes as reward for our ranking mode. ヾ(☆▽☆)
#indiedev #gamedev #gameart #screenshotsaturday https://t.co/ALF1InmM7K
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

Sign up now

2D Dynamic Shadows, Lighting & Mapping

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 SimanQzia   Members   


Posted 23 May 2012 - 12:47 PM

Greetings again,

That's a second project that I'm posting in this forum.
I was searching for more efficient ways to generate and draw lighting or shadow layers.
However, I never came up with a way that I can apply to both, OpenGL and DirectX.

Note: I've also attached two demos. (High Quality Set)
1. Day lighting demo, just sun shadow generation which has a lot of options. Attached File  Daylighting Demo.rar   205.01KB   155 downloads
2. Room and day lighting demo. Attached File  Room Lighting Demo.rar   205.46KB   150 downloads

1. Static Lighting Generation (OpenGL & DirectX 7/9)
At first, I programmed static lighting tool that allows you to generate lighting layer and export it as an image.
I even made some use out of it. I used it to generate shadow mapping for a game called CS2D.

You can check a short preview of it. Just in case, it is available to download.

Tool Screenshots
Posted Image

Posted Image

2. Real-Time Methods and Improvements (OpenGL & DirectX 7/9)
I felt like it's not enough, so I tried going further.

The main problem I had, the slow calculation of light and the process to record it in the image.

So, I came up with several improvements.
I saved every pixel of light source that was recorded in main pixel map.
This way I just had to remove only the pixels that are necessary in the update - light moving or map changing.

Later on, I changed all the pixel map drawing to scaled image on the screen.
All that was left, to overwrite buffer image only when necessary, that is when player or light is moving, or walls appearing/disappearing.

In the end, I managed to create an algorithm that generates light pixels way damn faster, that was the last step till now.

3. Practical Use
Finally, my lighting library was finished. I searched for the ways to use it. The library was written in BlitzMax and C++Languages.
Surprisingly, it was applied on new CS2D version (

Don't mind that daylight shadows shows up in room, that was decided by the creator of the game.
The original library disabled day lighting in the rooms ;}

Comparison between new with Lighting and old CS2D.
Posted Image

Video Preview Of The Engine

4. Open Source 2D Lighting Library
I didn't intend to release it to public, however I think I could share it if someone ask it privately :}
I'm also searching for the people whom I could use this engine for!

I could also create a tutorial, that will depend on interest and feedback.


#2 Ashaman73   Members   


Posted 23 May 2012 - 11:56 PM

The work you have done looks really impressive Posted Image , thought the announcement forum would be better suited for this kind of post. Or even better a journal here on gamedev.



Gnoblins: Website - Facebook - Twitter - Youtube - Steam Greenlit - IndieDB - Gamedev Log

#3 SimanQzia   Members   


Posted 24 May 2012 - 08:03 AM

Sure, I'll check those sections before posting all the other projects :}

Edited by SimanQzia, 24 May 2012 - 08:04 AM.

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.