DSSDO as a replacement for SSAO
by Lukas Joergensen · in Torque 3D Professional · 01/26/2014 (1:34 pm) · 31 replies
Hey guys!
Ever since I saw Ron's blog about SSDO as a method of adding Single-Bounce global illumination as well as Indirect Lighting I have been wanting to get a hold of a SSDO shader myself.
Bonus info: Did you know that if you google "SSDO", Ron's blog is the 5th hit? Don't come here and tell me the GarageGames community have fallen behind the Game Development frontline!
So I recently decided to give it a go, I read this article and downloaded this shader from Kayru.org.
And really, it was just a small amount of work getting it working in T3D! Just a matter of connecting the dots.
First off, what is SSDO?
Watch this fantastic video on the subject:
So where am I at?
I've got it mostly working, it seems like the occlusion is working fine, but I don't have the "bounce" part which is what gives the color-bleeding effect and allows for global illumination.
Here is a picture of the DSSDOVizPostFx:

Still seems like there is some issues here and there, I'm just not sure what they are and how to solve them.. Work goes on, I'd really wish I knew what I was doing LOL, I'm just poking my way through this because honestly I know little and less about hlsl and shaders, I'm just learning as I go.
Ever since I saw Ron's blog about SSDO as a method of adding Single-Bounce global illumination as well as Indirect Lighting I have been wanting to get a hold of a SSDO shader myself.
Bonus info: Did you know that if you google "SSDO", Ron's blog is the 5th hit? Don't come here and tell me the GarageGames community have fallen behind the Game Development frontline!
So I recently decided to give it a go, I read this article and downloaded this shader from Kayru.org.
And really, it was just a small amount of work getting it working in T3D! Just a matter of connecting the dots.
First off, what is SSDO?
Watch this fantastic video on the subject:
So where am I at?
I've got it mostly working, it seems like the occlusion is working fine, but I don't have the "bounce" part which is what gives the color-bleeding effect and allows for global illumination.
Here is a picture of the DSSDOVizPostFx:

Still seems like there is some issues here and there, I'm just not sure what they are and how to solve them.. Work goes on, I'd really wish I knew what I was doing LOL, I'm just poking my way through this because honestly I know little and less about hlsl and shaders, I'm just learning as I go.
About the author
IPS Bundle available at: https://www.winterleafentertainment.com/Products/IPS.aspx
#2
But it's very likely that I would release it as a resource!
Here is a comparison of the occlusion techniques:
View the images seperately: Plain, SSAO and SSDO
There is a huge difference, personally I like the SSDO most.
But remember that it is not exactly the same settings for SSDO and SSAO.
01/26/2014 (2:09 pm)
Not sure yet, still figuring it out.But it's very likely that I would release it as a resource!
Here is a comparison of the occlusion techniques:
View the images seperately: Plain, SSAO and SSDOThere is a huge difference, personally I like the SSDO most.
But remember that it is not exactly the same settings for SSDO and SSAO.
#4
http://imageshack.com/a/img833/8898/qc0e.png
Highlighted the 2 most apparent differences, basically with SSAO you sometimes get that "floating" look because it isn't affected by the direction of the light, but only by proximity.
SSDO takes the direction of the light into account, and therefore you will sometimes get some shadows on the environment, that wouldn't be there with SSAO. (Lower-right red box)
SSDO is also more "context-sensitive" imo, so sometimes when SSAO would indiscriminately darken a whole surface, SSDO will be more accurate in only darkening the parts that's actually blocked from the light source (upper left red box)
Generally it looks more realistic imo, and looks better. But it comes down to taste ofc!
The other side of SSDO is that it opens up for other techniques, like Single-bounce Global Illumination and color bleeding (my next project) which you can't do with SSAO.
01/26/2014 (4:24 pm)
X-post from Facebook:http://imageshack.com/a/img833/8898/qc0e.png
Highlighted the 2 most apparent differences, basically with SSAO you sometimes get that "floating" look because it isn't affected by the direction of the light, but only by proximity.
SSDO takes the direction of the light into account, and therefore you will sometimes get some shadows on the environment, that wouldn't be there with SSAO. (Lower-right red box)
SSDO is also more "context-sensitive" imo, so sometimes when SSAO would indiscriminately darken a whole surface, SSDO will be more accurate in only darkening the parts that's actually blocked from the light source (upper left red box)
Generally it looks more realistic imo, and looks better. But it comes down to taste ofc!
The other side of SSDO is that it opens up for other techniques, like Single-bounce Global Illumination and color bleeding (my next project) which you can't do with SSAO.
#5
Nice job... same shader I built mine around.... though I hope you manage to get more consistent frame rates then I have. Once you calculate the single bounce stuff I think you will see what I mean. Of late I have been playing around with a combo of this in conjunction with a simple image based lighting (IBL) model..... interesting but, probably not for ideal for games.
Be interested to see what you came up with.
Ron
01/26/2014 (9:01 pm)
Lukas, Nice job... same shader I built mine around.... though I hope you manage to get more consistent frame rates then I have. Once you calculate the single bounce stuff I think you will see what I mean. Of late I have been playing around with a combo of this in conjunction with a simple image based lighting (IBL) model..... interesting but, probably not for ideal for games.
Be interested to see what you came up with.
Ron
#6
01/27/2014 (12:25 am)
Thanks Ron, I'm still working on the single bounce, my biggest hurdle is getting the position of the occluder projected onto the depth buffer, I'm trying to do it in an efficient way that will have the smallest possible impact on FPS.
#9
It's mostly the same, the process is the same as with SSAO basically, the math is just a little different.
More images because I wanted to make a GIF (never done that before!)

(I placed a PointLight on the front of the vehicle, the pointlight is affected by both the SSAO and the SSDO)
01/27/2014 (6:11 am)
@NilsIt's mostly the same, the process is the same as with SSAO basically, the math is just a little different.
More images because I wanted to make a GIF (never done that before!)

(I placed a PointLight on the front of the vehicle, the pointlight is affected by both the SSAO and the SSDO)
#10
01/27/2014 (9:56 am)
Do you can publish fix?
#11
01/27/2014 (3:46 pm)
Yes Lukas, do you can publish fix?
#12
@All, the future of all this is not yet decided. We are still discussing it.
01/28/2014 (2:15 pm)
@Nils heh correction, I'm experiencing a 10 FPS boost using the DSSDO instead of the SSAO.@All, the future of all this is not yet decided. We are still discussing it.
#13
My correction; Found that I use Sunlight objects in my indoor scenes to overall brighten the dark shadows a bit. When disabled, the SSAO disappears.
01/28/2014 (5:52 pm)
@Lukas; That's very interesting! An improvement in quality is one thing, but even in rendering speed?! With my big outdoor scenes (like 2km2 of forest) SSAO makes it drop from 60 to 50 fps (6000K polys, 1920 x 1080, advanced lighting, PostFx etc...). I wonder what DSSDO does with that. Anyway, it looks very promising, can't wait to try this out!My correction; Found that I use Sunlight objects in my indoor scenes to overall brighten the dark shadows a bit. When disabled, the SSAO disappears.
#14
05/31/2014 (7:20 pm)
How's about a quick tip on where to paste in what codes exactly to achieve DSSDO :D
#15
06/03/2014 (2:33 am)
@Frank the code is not ready for release :) Having a couple of issues with it.
#16
06/05/2014 (9:55 pm)
Nice work so far Lukas, it's definitely a visual improvement.
#17
06/05/2014 (10:33 pm)
So... forgive my ignorance, but this is Global Illumination? If so, Lukas once again, is awesome.
#18
06/06/2014 (12:34 am)
@Raa From the video, it seems, it's NOT global illumination, but it simulates it(sorta) with a similar algorithm to ambient occlusion that makes use of color, rather than just black.
#19
It's not global illumination, it's a step in that direction but the shader I've shown in T3D is only an occlusion shader, it doesn't bounce the light.
I've been working on global illumination as well, but the math is screwing me lol, I thought it would be simple but I'm having such a hard time converting screen coordinates to world coordinates and back again...
06/09/2014 (4:24 pm)
Quote:I've got it mostly working, it seems like the occlusion is working fine, but I don't have the "bounce" part which is what gives the color-bleeding effect and allows for global illumination.
It's not global illumination, it's a step in that direction but the shader I've shown in T3D is only an occlusion shader, it doesn't bounce the light.
I've been working on global illumination as well, but the math is screwing me lol, I thought it would be simple but I'm having such a hard time converting screen coordinates to world coordinates and back again...
#20
Maybe you could post the code somewhere. Maybe someone that has a little knowledge and time could help resolve the issue. I know I know a few people that may be able to help out!
Unless you have other plans and that's fine also!!!
06/09/2014 (5:32 pm)
LukasMaybe you could post the code somewhere. Maybe someone that has a little knowledge and time could help resolve the issue. I know I know a few people that may be able to help out!
Unless you have other plans and that's fine also!!!
RoundedIcon