Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / [DBP] - fast enough lights for 2d games

Author
Message
noobnerd
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location:
Posted: 29th Sep 2013 14:28 Edited at: 29th Sep 2013 14:34
Hi there, i made this 2d "lightmap" thing recently for a litle project im working on, thought id share it as i found it to be fairly effective and neat.





its part of a bigger code and needs a light image (attached in the next post )but the code is very heavily commented so you should be able to figure it out.
It requires Matr1x utils and advanced2d which can both be found on theese forums

Attachments

Login to view attachments
noobnerd
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location:
Posted: 29th Sep 2013 14:33
the above image has 11 huge area lights all rendered every frame (and recalculated that is they can be moved dynamically) running at 30fps and theres also the game running in the background so performance is quite good. this post has the lightarea image attached which i use in the function.

Attachments

Login to view attachments
janbo
15
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 20th Nov 2013 23:06 Edited at: 22nd Nov 2013 22:52
Hi noobnerd,

It looks incredible, and great work.
What you have done is what i am looking for a long time and trying myself.
But could you help me to complete my demo.
I have found the missing functions

[edit]
I got it to work.
But having problems with the alpha/blendmode.
Here is the demo code (no media needed):



[/edit]

sorry for my English and thank you for sharing with us.

Login to post a reply

Server time is: 2024-04-25 00:20:47
Your offset time is: 2024-04-25 00:20:47