Jump to content

  • Log In with Google      Sign In   
  • Create Account


2D Dynamic Shadows, Lighting & Mapping


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   -  Reputation: 116

Like
0Likes
Like

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   101 downloads
2. Room and day lighting demo. Attached File  Room Lighting Demo.rar   205.46KB   97 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.
http://www.youtube.com/watch?v=ZcQnw2pY4wI

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 (0.1.2.0)


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
http://www.youtube.com/watch?v=FG7v1tPF7dI

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.

Enjoy!

Sponsor:

#2 Ashaman73   Crossbones+   -  Reputation: 6753

Like
1Likes
Like

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.

#3 SimanQzia   Members   -  Reputation: 116

Like
0Likes
Like

Posted 24 May 2012 - 08:03 AM

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

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.



PARTNERS