ambient occlusion + sun shadow

Fd80f81596aa1cf809ceb1c2077e190b
0
rouncer 103 Jan 08, 2012 at 21:14

just thought id show this screen, looks alot like cryengine gi :)
its the simplest ao solution i could come up with, just check for cavities
and dot product it with the viewspace normal. then adding the sun and sun shadows
finishes it off, and you get this really nice ambient effect. note -> no blue used, with all
the bright light everywhere the grey just ends up looking blue. :) also its going 12 fps, without
the shadows it would go about 40, its just ive got this really stupid shadow maker at the moment i plan
on swapping to shadow maps soon. theyll come out alot better. ambient light is at 0.75f in this shot, so its pretty bright, but i like it bright!
shot3t.png

14 Replies

Please log in or register to post a reply.

Fd80f81596aa1cf809ceb1c2077e190b
0
rouncer 103 Jan 08, 2012 at 21:20

from further back ->
shot2fo.png

i used to think ssao was pretty crappy compared to real ao, now im actually into this ssao shortcut thing. :) it looks kinda cool!

Fd80f81596aa1cf809ceb1c2077e190b
0
rouncer 103 Jan 09, 2012 at 06:47

I can never help myself, now its going 1fps but heres one bounce of global illumination. :)
shot6f.png

Fd80f81596aa1cf809ceb1c2077e190b
0
rouncer 103 Jan 09, 2012 at 07:53

reduced the size of the screen and got it to 10 fps :)
shot7e.png

5000fdaaeeeb9f038be93cf67eb3b130
0
David_Gallagher 102 Jan 09, 2012 at 08:37

I think it looks awsome, wish the effect wasn’t so expensive but really nice renders. is that dx11? how many polies does your charactor have, would reducing it , using tessellation for the detail or hardware instancing be of any benefit to performance with this effect? just curious…

Fd80f81596aa1cf809ceb1c2077e190b
0
rouncer 103 Jan 09, 2012 at 09:19

thanks man! yes dx11. its about 200,000 polys i think all up, one character. id benefit probably only 5 or so fps if i reduced the character more, really all the work is the actual rendering unfortunately. but yeh, if i was rendering even more it would definitely go even slower, but the real area to optimize is the screenspace effect.
im thinking hard about how i could possibly get it to go faster, if i reduce quality it can go fast, if only i could reduct quality in a way its not so bad for the look of it?

enhanced the colour spreading. at 4fps.
shot8.png

Fd80f81596aa1cf809ceb1c2077e190b
0
rouncer 103 Jan 09, 2012 at 09:31

just in case your interested, here it is going 21 fps, playable speed, its just it looks really shit, put bluntly. if only there was some way i could blur this or something… im thinking…
shot9o.png

B5262118b588a5a420230bfbef4a2cdf
0
Stainless 151 Jan 09, 2012 at 10:47

The way I do AO is very cheap.

I run the object through shadevis and store the AO value in the mesh data. Then just use this combined with the global ambient light setting.

It’s really cheap so shouldn’t slow you down at all. I think your bottle neck must be somewhere else unless you are doing the AO on the fly.

The only problem I have with shadevis is that it assumes the object is orientated with “up” in a specific direction. If your object is generated in a different coordinate system it goes wrong.

That’s trivial to get around though.

What are those streaks on the ground? Maybe that’s something to do with whatever is slowing your code :mellow:

Fd80f81596aa1cf809ceb1c2077e190b
0
rouncer 103 Jan 09, 2012 at 19:24

success!! 16 fps!
shote.png

I cut rays down, added mips to the screen and read off those instead of just single pixels, sorta making “cone rays” and then used a blur technique to final gather it, and it funnily looks like subsurface scattering. :)

(note smooth ground occlusion)
shotfuu.png

(definitely looks best with the direct light showing)
shotgh.png

B20d81438814b6ba7da7ff8eb502d039
0
Vilem_Otte 117 Jan 09, 2012 at 19:43

Good work rouncer!

What about trying less samples + bilateral blur (or are you actually using bilateral blur now)?

820ce9018b365a6aeba6e23847f17eda
0
geon 101 Jan 09, 2012 at 20:37

> then used a blur technique to final gather it, and it funnily looks like subsurface scattering

Isn’t that how you would usually do sss?

Fd80f81596aa1cf809ceb1c2077e190b
0
rouncer 103 Jan 09, 2012 at 20:37

thanks Vilem! a post from you means everything!

Yeh Geon! I dont think you could get quite to realistic marble just by blurring tho…

yeh as it is, the blur is totally unoptimized and slowing it down, ive got a funny feeling this could get to 20fps :)
The blur is just a 20x20 per pixel sampler, so thats not bilateral or anything, in other words REALLY slow.

love this…. hehe
shoth.png

5000fdaaeeeb9f038be93cf67eb3b130
0
David_Gallagher 102 Jan 09, 2012 at 21:19

great enhancments and really like the look of it!

Fd80f81596aa1cf809ceb1c2077e190b
0
rouncer 103 Jan 09, 2012 at 22:07

thanks david!!!!!!!!

heres 1280x1024 (big guns) , running 5 fps.
shoti.png

Fd80f81596aa1cf809ceb1c2077e190b
0
rouncer 103 Jan 10, 2012 at 00:55

20 fps… the blur slows it down when you go too close, this is about the right distance and it goes real nicely :)
shotj.png