Screen Space Global Illumination

A place to show off your latest screenshots and for people to comment on them. Only start a new thread here if you have some nice images to show off!

Screen Space Global Illumination

Postby nullsquared » Sun Dec 28, 2008 11:35 pm

A bit of an over-ambitious title for such a big hack, but, hey, it looks cool :D

This is just an 'extension' to SSAO that grabs values from the light buffer as a second light bounce... It's completely dependent on having lights in the scene, otherwise it looks like normal SSAO. The good part, though, is that the number of lights doesn't matter - they all accumulate into the same buffer, and for each SSAO sample there is only 1 corresponding light buffer sample (currently, 15 samples, and it's pretty noise-free due to a 100% uniform distribution).

Off:
Image
On:
Image

Off:
Image
On:
Image

Another:
Image

A screen shot of the second bounce:
Image

Since objects with an emissive property are correctly accumulated into the light buffer, they actually behave as ... well, emissive :D

Off:
Image
On:
Image

As you can see, it looks pretty cool and add details, but it's not nearly 'correct' or accurate in any way whatsoever. Sorry, no demo this time :(. Maybe later on when Portalized reaches a more final stage I'll redo the SSAO demo and add in some SSGI :D

Anyways, what do you guys think? Thumbs up or down?
Last edited by nullsquared on Mon Dec 29, 2008 5:11 pm, edited 4 times in total.
User avatar
nullsquared
Old One
 
Posts: 3245
Kudos: 9
Joined: 24 Apr 2007
Location: NY, NY, USA

Re: Screen Space Global Illumination

Postby jacmoe » Sun Dec 28, 2008 11:43 pm

Definitely up! :)
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
 
Posts: 20570
Kudos: 181
Joined: 22 Jan 2004
Location: Denmark

Re: Screen Space Global Illumination

Postby jjp » Mon Dec 29, 2008 12:55 am

To hell with "correctness" when it comes to diffuse indirect lighting. This actually looks pretty decent :)
Enough is never enough.
jjp
Silver Sponsor
Silver Sponsor
 
Posts: 597
Kudos: 0
Joined: 07 Jan 2007
Location: Cologne, Germany

Re: Screen Space Global Illumination

Postby nullsquared » Mon Dec 29, 2008 1:01 am

jjp wrote:To hell with "correctness" when it comes to diffuse indirect lighting. This actually looks pretty decent :)

It does suffer from the common SSAO issues. Colour can only be contributed from front-facing things on the screen, that is, only whatever is rendered.
User avatar
nullsquared
Old One
 
Posts: 3245
Kudos: 9
Joined: 24 Apr 2007
Location: NY, NY, USA

Re: Screen Space Global Illumination

Postby Praetor » Mon Dec 29, 2008 2:08 am

Unless you do a front and back face render and use them both for your AO and GI calculations. Of course, that'll be about twice as slow.
Game Development, Engine Development, Porting
http://www.darkwindmedia.com
User avatar
Praetor
OGRE Retired Team Member
OGRE Retired Team Member
 
Posts: 3335
Kudos: 3
Joined: 21 Jun 2005
Location: Rochester, New York, US

Re: Screen Space Global Illumination

Postby nullsquared » Mon Dec 29, 2008 2:15 am

Praetor wrote:Unless you do a front and back face render and use them both for your AO and GI calculations. Of course, that'll be about twice as slow.

Yeah, that defeats the whole purpose of having it screen-space. Right now at 1024x768 with 15 samples (quite noise free, can use a blur though) it runs at about 50-60 FPS on my 8800GTS, so I'm happy :D. Svenstaro says on his 8800GTX it runs at 40 FPS at 1440x900, which is excellent considering he was rendering a 3DSMax animation in the background :lol:

The system uses an MRT of four R8G8B8A8 textures. There's depth, specular, emissive, diffuse, baked ambient occlusion and normals all packed into there, it's pretty crazy :mrgreen: . The speed is excellent in my opinion, and visual trade off is not that bad :D
User avatar
nullsquared
Old One
 
Posts: 3245
Kudos: 9
Joined: 24 Apr 2007
Location: NY, NY, USA

Re: Screen Space Global Illumination

Postby PolyVox » Mon Dec 29, 2008 2:24 am

Looks very cool! :D I trust you're following the current GameDev thread about this?

http://www.gamedev.net/community/forums ... _id=517130
User avatar
PolyVox
OGRE Contributor
OGRE Contributor
 
Posts: 1316
Kudos: 18
Joined: 21 Nov 2006
Location: Groningen, The Netherlands

Re: Screen Space Global Illumination

Postby nullsquared » Mon Dec 29, 2008 2:33 am

PolyVox wrote:Looks very cool! :D I trust you're following the current GameDev thread about this?

http://www.gamedev.net/community/forums ... _id=517130

I had the idea long ago, but never got anywhere and ditched it. Then, yes, I saw that thread and went on a journey to redo what I had before and make it better :mrgreen:

I actually tried the 'coherent SSAO' implementation on there, but never got it to work. It seems to always artifact on edges, I'm not sure how the OP did it considering all of the code is right there :lol:. I was going to post some results and ideas on there, but my new account 'nullsquared' got banned, and my original 'agi_shi' got suspended. I forgot they don't like alts on there :(. agi_shi is so not me anymore, and that was the first forum I was ever on (since I was like 12), so agi_shi != nullsquared. Oh well.

The implementation on there seems extremely slow, though. It's got a million normalizations and samples and what-not that aren't needed. On the other hand, I tried to optimize mine as much as possible - it actually doesn't run much slower than SSAO itself, just all the extra texture fetches really add up. Loop body:
Code: Select all
        // reflected direction to move in for the sphere
        // (based on random samples and a random texture sample)
        // bias the random direction away from the normal
        // this tends to minimize self occlusion
        float3 randomDir = reflect(RAND_SAMPLES[i], randN) + viewNorm;

        // move new view-space position back into texture space
        #define RADIUS 0.2125
        float4 nuv = mul(ptMat, float4(viewPos.xyz + randomDir * RADIUS, 1));
        nuv.xy /= nuv.w;

        // compute occlusion based on the (scaled) Z difference
        float zd = max(far * (depth - unpack(TEX2DLOD(depthMap, nuv.xy))), 0);

        #define OCC_POW 11
        occ += saturate(pow(1.0 - saturate(zd), OCC_POW) + zd);

        // the colour-factor prevents leakage from near to far objects
        float c = smoothstep(1, 0, saturate(zd));//zd > 0.75 ? 0 : 1;
        light += TEX2DLOD(lightMap, nuv.xy).xyz * c;
        numLightSamples += c;
User avatar
nullsquared
Old One
 
Posts: 3245
Kudos: 9
Joined: 24 Apr 2007
Location: NY, NY, USA

Re: Screen Space Global Illumination

Postby Praetor » Mon Dec 29, 2008 2:40 am

I tried his shader as well, with the same results as nullsquared. I got really terrible artifacting around the corners of my boxes too. Maybe it has something to do with the fact he was using spheres and columns in his tests and we are using boxes. Anyway, your results look really great. In a normal scene it's really going to add a lot of realism.
Game Development, Engine Development, Porting
http://www.darkwindmedia.com
User avatar
Praetor
OGRE Retired Team Member
OGRE Retired Team Member
 
Posts: 3335
Kudos: 3
Joined: 21 Jun 2005
Location: Rochester, New York, US

Re: Screen Space Global Illumination

Postby nullsquared » Mon Dec 29, 2008 2:45 am

Praetor wrote: In a normal scene it's really going to add a lot of realism.

For Portalized we created a mockup render with GI and AO in Max to see what our graphics style should look like. We're going to post a news update on www.portalized.org when we do a comparison of Portalized's real-time rendering and our original mockup...
User avatar
nullsquared
Old One
 
Posts: 3245
Kudos: 9
Joined: 24 Apr 2007
Location: NY, NY, USA

Re: Screen Space Global Illumination

Postby _tommo_ » Mon Dec 29, 2008 2:41 pm

Genius. :shock:

I really like the effect, i think that it would greatly improve a real detailed scene!
I like less the framerate impact (it wouldn't even run on my $70 card :roll: )... but on higher level configurations it can be really good!

Anyway, I the "grainy" look of the thing really ruins the effect... diffuse lighting should be "diffused". Maybe you can add some blur to the global illumination buffer, this would kill the grainy look and would also mask some of the artifacts... at the cost of a couple more frames. :wink:
OverMindGames Blog
IndieVault.it: Il nuovo portale italiano su Game Dev & Indie Games
User avatar
_tommo_
Gnoll
 
Posts: 677
Kudos: 3
Joined: 19 Sep 2006

Re: Screen Space Global Illumination

Postby nullsquared » Mon Dec 29, 2008 2:50 pm

There's a blur and everything in place already, I even did a half-resolution option which I'm playing with to speed it up (just not in those screenshots, :lol:). What card do you have? If SSAO runs on your card, this will, too, just slower :mrgreen:

There's no floating point textures being used at all. So it's a lot more compatible than you'd thing.
User avatar
nullsquared
Old One
 
Posts: 3245
Kudos: 9
Joined: 24 Apr 2007
Location: NY, NY, USA

Re: Screen Space Global Illumination

Postby _tommo_ » Mon Dec 29, 2008 2:53 pm

Good to hear that :D
I have an X1950 pro, and considering the 50 fps on a 8800GTX... I don't have much hopes of it being playable :roll:

Will you release a demo of your "graphic framework"?
OverMindGames Blog
IndieVault.it: Il nuovo portale italiano su Game Dev & Indie Games
User avatar
_tommo_
Gnoll
 
Posts: 677
Kudos: 3
Joined: 19 Sep 2006

Re: Screen Space Global Illumination

Postby nullsquared » Mon Dec 29, 2008 2:58 pm

_tommo_ wrote:Good to hear that :D
I have an X1950 pro, and considering the 50 fps on a 8800GTX... I don't have much hopes of it being playable :roll:

50 FPS on 8800GTX at 1440x900 full-resolution SSGI. Half-resolution is much faster, and therefore it should run fine, especially at something like 1024x768...

Will you release a demo of your "graphic framework"?

No, only betas for testers (private testing, though), and releases of Portalized :) Sorry.

Edit:
Just tested half-resolution. This seems to be the sweet-spot: much faster, and free 'blur' due to bilinear filtering :)

Edit:
Updated first post with half-resolution results.
User avatar
nullsquared
Old One
 
Posts: 3245
Kudos: 9
Joined: 24 Apr 2007
Location: NY, NY, USA

Re: Screen Space Global Illumination

Postby _tommo_ » Mon Dec 29, 2008 3:46 pm

Hmm the thumb is not-so-up with the half resolution screens... the grains have become splats, and the whole image is much less "crispy" and defined... wich was to me the best thing about the GI... and the artifacts at the edges are heavy...
OverMindGames Blog
IndieVault.it: Il nuovo portale italiano su Game Dev & Indie Games
User avatar
_tommo_
Gnoll
 
Posts: 677
Kudos: 3
Joined: 19 Sep 2006

Re: Screen Space Global Illumination

Postby nullsquared » Mon Dec 29, 2008 4:02 pm

Hm. Yes, it does look less 'crisp' and I agree, the edge artifacts are pretty bad. We'll see how it goes.

Anyways, benefits of completely independent first and second bounce? Emissive-lit objects ... actually emit light :D See the first post for a screenshot...

There's no light source in there except the objects themselves, which have an emissive property.
Last edited by nullsquared on Mon Dec 29, 2008 5:09 pm, edited 1 time in total.
User avatar
nullsquared
Old One
 
Posts: 3245
Kudos: 9
Joined: 24 Apr 2007
Location: NY, NY, USA

Re: Screen Space Global Illumination

Postby jacmoe » Mon Dec 29, 2008 4:43 pm

Looks great! :)

There should be a law against teasing us like this, and not giving us any source! :evil: :twisted: :lol:
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
 
Posts: 20570
Kudos: 181
Joined: 22 Jan 2004
Location: Denmark

Re: Screen Space Global Illumination

Postby nullsquared » Mon Dec 29, 2008 5:02 pm

Scroll up, you'll see pretty much all of the 'meat' :D. Slap it in a loop and you're good to go :mrgreen:

Anyways, full-resolution looks much better than half-resolution, and performs very well with 6 samples instead of 15. Will post updates soon.

Edit:
Updated first post with emissive light bounces and removed half-resolution as it looked bad - the new performance increase comes from a blurred 6-sample version rather than 15 samples. This means 6 * 2 = 12 texture fetches in the loop, plus an addition 3 outside, 15 texture fetches for the full SSGI implementation, plus an added 10 samples for the gaussian blur.
User avatar
nullsquared
Old One
 
Posts: 3245
Kudos: 9
Joined: 24 Apr 2007
Location: NY, NY, USA

Re: Screen Space Global Illumination

Postby DanielSefton » Mon Dec 29, 2008 5:16 pm

You're a genius, null!

What kind of overhead does it have? i.e. framerate with it on, and framerate with it off.
User avatar
DanielSefton
Ogre Magi
 
Posts: 1235
Kudos: 10
Joined: 26 Oct 2007
Location: Mountain View, CA

Re: Screen Space Global Illumination

Postby jacmoe » Mon Dec 29, 2008 5:22 pm

I really dig the emissive objects! :D
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
 
Posts: 20570
Kudos: 181
Joined: 22 Jan 2004
Location: Denmark

Re: Screen Space Global Illumination

Postby nullsquared » Mon Dec 29, 2008 5:24 pm

DanielSefton wrote:You're a genius, null!

What kind of overhead does it have? i.e. framerate with it on, and framerate with it off.

The new version is basically the same speed as 12-sample SSAO with a gaussian blur (6-sample SSAO and 6-sample SSGI).

FPS is a non-linear measurement, so it doesn't really make much sense to compare on-off FPS measures (turning off SSGI turns off SSAO, they're one shader). But in a relatively simple scene it's about 66 FPS average on an 8800GTS at 1024x768 with the normal 'full resolution'. We'll see how it scales with larger scenes (not too bad considering it's screen space).

@ jacmoe: whatever ends up in the light buffer is whatever the SSGI uses :D
User avatar
nullsquared
Old One
 
Posts: 3245
Kudos: 9
Joined: 24 Apr 2007
Location: NY, NY, USA

Re: Screen Space Global Illumination

Postby KungFooMasta » Mon Dec 29, 2008 10:22 pm

Looks really sweet! I did notice in the first screenshots you posted, there are no shadows below the chairs. I don't know a lot about shadows, but thought I'd point that out, if it wasn't already obvious. :P
Creator of QuickGUI!
User avatar
KungFooMasta
OGRE Contributor
OGRE Contributor
 
Posts: 2087
Kudos: 16
Joined: 03 Mar 2005
Location: WA, USA

Re: Screen Space Global Illumination

Postby nullsquared » Mon Dec 29, 2008 10:52 pm

KungFooMasta wrote:Looks really sweet! I did notice in the first screenshots you posted, there are no shadows below the chairs. I don't know a lot about shadows, but thought I'd point that out, if it wasn't already obvious. :P

Yeah, the SSAO/SSGI is really faint (read: pretty much not there) for thin objects like the chair legs, especially when they happen to be in light... It will look a lot better once direct shadows are added for the light buffer (shadows for the light sources).
User avatar
nullsquared
Old One
 
Posts: 3245
Kudos: 9
Joined: 24 Apr 2007
Location: NY, NY, USA

Re: Screen Space Global Illumination

Postby iloseall » Wed Dec 31, 2008 4:28 pm

Sorry, no demo this time

I like the screenshot.
User avatar
iloseall
Gremlin
 
Posts: 156
Kudos: 0
Joined: 14 Sep 2003
Location: Beijing China

Re: Screen Space Global Illumination

Postby broli » Wed Dec 31, 2008 7:23 pm

On that gamedev thread there's also mention of this cool website with a recent research paper about the subject...

Approximating Dynamic Global Illumination in Image Space: http://www.uni-koblenz.de/~ritschel/

Maybe this can help compare and maybe optimize/add some things. Their video is awesome btw.
broli
Halfling
 
Posts: 48
Kudos: 0
Joined: 31 Mar 2006

Next

Return to Showcase

Who is online

Users browsing this forum: No registered users and 3 guests