September 09, 2010, 05:38:41 AM
News: As promised, here is another update of the editor with improvements and bug fixes
Pages: [1]
Print
Author Topic: Deferred lighting  (Read 1015 times)
Jochen Stier
Administrator
Sr. Member
*****
Posts: 498


Founder/Programmer

jochen.stier@gmail.com
View Profile
« on: May 07, 2009, 12:04:47 AM »

I haven’t posted anything in a while, but I would like to ensure everyone that I am still hard at work! First I have started to perfect HDR and Bloom and then I have added SSAO. The problem with SSAO is that you need depth information about every pixel. Normally that information is in the z-buffer of the graphics card anyways and you could just access that to do SSAO. But, because of the large distances in Geist3D, the scene has to be rendered into three different frustums, one for near, medium and far distances. After that the information in the z-buffer is useless, because it only contains the distances of the last rendering pass. So, I decided to render the scene into different frame buffers one of which stores the distance. Once I did that, I realized that deferred lighting is a real option for Geist3D as well. Now, deferred lighting is a an amazing new technique where you compute the lighting at the end using only 2D buffers containing color, depth, normals in screen space. Long story short this technique allows you to handles dozens, if not hundreds of different lights in a single scene. Imagine a shuttle with two spot light flying over the dark side of the planet approaching a base with several lights illuminating the surroundings. This is actually possible now! Not to mention the type of lighting that you can create inside a station. However, there is a problem; When rendering into screen buffers there is no hardware support for antialiasing, which is a very big deal! Have a look at the following three pics. The one on the left is rendered into the hardware buffer with AA, the one on the middle comes straight from the framebuffer and then one on the right has some off-the-shelf edge detection blurring applied to the image in the middle (which is quite expensive BTW)



Long story short, both of the ones on the right suck in my mind, but that’s the best that can be done, I think. I have started a thread on gamedev to see if anyone has a solution. I am thinking of going ahead with deferred lighting for now and just forget about AA. But, it will be a noticeable drawback. On the other hand, and unfortunately I have no images to show yet other than the one below (only 2 light sources, but it might as well be a dozen), it will be possible to create some amazing lighting effects. Inside of ships and shuttles, where the distances to triangles is small the lack of AA will not be so visible. On the surface of the planet however it will be almost unbearable.



What do you think; deferred lighting or not? I have not supplied enough visuals in support of deferred lighting yet, but trust me, it could become amazing. The shuttle could have a few of those long lights (whose English name I have yet forgotten again) in that walk-in hangar in the back. Not to mention what could be done on the dark side of the planet. Heck, even laser swords are now an option. Nevertheless, also have a look at the images at the top... The lack of AA is really appearent on the horizon.
« Last Edit: May 18, 2009, 11:10:34 PM by Jochen Stier » Logged
Tamarin
Full Member
***
Posts: 208


View Profile
« Reply #1 on: May 07, 2009, 01:04:00 AM »

I think I understand the problem Undecided

I found an article that describes finding a silhouette and drawing a line along the discontinuous edge. The line is then composited into the frame buffer with alpha-blending. The link has a brief description with some sample code. I'm not sure if this idea will apply for this engine(might be too expensive, the article shows a single triangle Tongue), but it might be a way to deal with AA.

http://people.csail.mit.edu/ericchan/articles/prefilter/

 
Logged
StormGnu
Full Member
***
Posts: 118


Script Programmer

wizzyz@hotmail.com
View Profile
« Reply #2 on: May 07, 2009, 09:55:25 AM »

Id say go for deferred lighting for now, as you said, and look for some way to do AA later. I saw a journal from Infinity about deferred lightning and it was awesome! See:
http://www.infinity-universe.com/Infinity/index.php?option=com_content&task=view&id=105&Itemid=47
Logged
Jochen Stier
Administrator
Sr. Member
*****
Posts: 498


Founder/Programmer

jochen.stier@gmail.com
View Profile
« Reply #3 on: May 07, 2009, 01:53:26 PM »

Yeah, I have seen the Infinity articles. It looks very nice. We will be able to do the same thing in Geist3D. It will really only show up once we have a nicely textured interior area like the hangar in the article. Infinity also has a problem with antialiasing. It just isn’t apparent in those screenshots. But yeah, deferred lighting is the way to go. It will be awesome.

Thx for the link Tamarin. It’s an interesting approach, but I think I will try MSAA on the framebuffers first. The drawback will be that this requires even more hardware resources. So, I am thinking the 8600GT may at the end be the minimum required card to run Pangea.
« Last Edit: May 07, 2009, 01:55:17 PM by Jochen Stier » Logged
Pages: [1]
Print
Jump to: