ComSer Forum
Welcome, Guest. Please login or register.
September 25, 2018, 01:00:14 PM

Login with username, password and session length
Search:     Advanced search
Visit us on IRC
irc.quakenet.org
#liero
8133 Posts in 708 Topics by 253 Members
Latest Member: Maxigenzztop
* Home Help Search Calendar Login Register
+  ComSer Forum
|-+  Gusanos Forum
| |-+  Gusanos Development
| | |-+  Light algorithm
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Go Down Print
Author Topic: Light algorithm  (Read 2796 times)
Keraj
Recon
Jr. Member
*

Karma: 0
Offline Offline

Posts: 7


Don't tolerate any less than you deserve.


View Profile WWW
« on: June 11, 2010, 02:21:49 PM »

Hi all...

As I have seen on CVS repository of gusanos, lighter algorighm looks like this...
go through all pixels of lightmap and check if they are in range of any light sources.
if they are, apply alpha (or whatever) depending on distance to light sources.

Is this actual ligh algorithm? or there is another?
Have you any better(faster) idea for lights? Smiley
Logged

//voice of reason
basara
Administrator
Historic Member
*****

Karma: 31
Offline Offline

Posts: 841



View Profile
« Reply #1 on: June 11, 2010, 05:08:03 PM »

Gusanos lights are rendered onto a an 8 bit lightmap using additive blending, this bitmap is then blended onto the screen using some sort of multiply blend.
Maps have a lightmap which is what is used to clear the screen lightmap each frame.
Light occlusion algorithm is a bit complex to explain, so I wont Smiley
Logged
Keraj
Recon
Jr. Member
*

Karma: 0
Offline Offline

Posts: 7


Don't tolerate any less than you deserve.


View Profile WWW
« Reply #2 on: June 11, 2010, 05:36:23 PM »

Gusanos lights are rendered onto a an 8 bit lightmap using additive blending, this bitmap is then blended onto the screen using some sort of multiply blend.
Maps have a lightmap which is what is used to clear the screen lightmap each frame.
Light occlusion algorithm is a bit complex to explain, so I wont Smiley
Light occlusion is what I am interested in.. so at least give me a hint where I can find the code, please Smiley
Logged

//voice of reason
albert
Member
**

Karma: 1
Offline Offline

Posts: 33


View Profile WWW
« Reply #3 on: June 12, 2010, 06:37:16 AM »

This should be it:
http://openlierox.git.sourceforge.net/git/gitweb.cgi?p=openlierox/openlierox;a=blob;f=src/gusanos/culling.h;hb=HEAD

Used here:
http://openlierox.git.sourceforge.net/git/gitweb.cgi?p=openlierox/openlierox;a=blob;f=src/gusanos/level.cpp;hb=HEAD

And here (look for culledDraw*):
http://openlierox.git.sourceforge.net/git/gitweb.cgi?p=openlierox/openlierox;a=blob;f=src/gusanos/particle.cpp;hb=HEAD
« Last Edit: June 12, 2010, 06:41:37 AM by albert » Logged
Gliptic
Gusanos Team
Veteran Member
*****

Karma: 8
Offline Offline

Posts: 208


View Profile
« Reply #4 on: June 12, 2010, 08:34:54 AM »

The occlusion algorithm is more complicated than it really needs to be, because I wanted it to work with only horizontal lines (for performance). There's a simpler algorithm commented out (yay) in culling.h.
Logged
Pages: [1] Go Up Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.13 | SMF © 2006-2011, Simple Machines LLC Valid XHTML 1.0! Valid CSS!