
SSAO discussion
Moderator: Graf Zahl
-
- Developer
- Posts: 798
- Joined: Sat Jul 23, 2016 7:53
Re: SSAO discussion
Not too surprised that it doesn't work with the status bar. It makes no attempt at trying to hit the 3D scene except for the full screen HUD at the moment. 

- Nash
- Developer
- Posts: 1226
- Joined: Sun Sep 25, 2005 1:49
- Location: Kuala Lumpur, Malaysia
- Contact:
Re: SSAO discussion

Made some comparison footage. I love SSAO already, even in its incomplete stage. I'm pretty sure I'm leaving it on as my default when it's fully ready in the engine. ;) Good work, as always, dpJudas!
-
- Developer
- Posts: 798
- Joined: Sat Jul 23, 2016 7:53
Re: SSAO discussion
I see you tried playing with the light math mode too.
Ideally per material stuff would make it use less specular highlight on something like sand. Looks nice on the wall tho. Funny thing is the highlight reveals better the actual position of the dynamic light - in this case I think its near the ground of the vase and not slightly above where the fire is.
I'm not sure if you'll see the SSAO in an official release of gzdoom. I still don't have a (realistic) idea of how to split transparency rendering from the opaque parts when it comes to portals.

I'm not sure if you'll see the SSAO in an official release of gzdoom. I still don't have a (realistic) idea of how to split transparency rendering from the opaque parts when it comes to portals.
- Graf Zahl
- GZDoom Developer
- Posts: 7148
- Joined: Wed Jul 20, 2005 9:48
- Location: Germany
- Contact:
Re: SSAO discussion
I really like what I see. Once the next version is released, which should be soon now (just waiting for feedback from _mental_ for GL 3 on Apple and some Linux users), I think we can do a bit more here, especially creating an actually usable depth buffer and define proper materials that can be assigned to textures.
-
- Developer
- Posts: 798
- Joined: Sat Jul 23, 2016 7:53
Re: SSAO discussion
Glad you guys like it.
The light part I don't see that many showstoppers for (besides the work involved defining materials). The SSAO pass is the tricky part.
I know a relatively simple way to fix the depth problem. It involves having main.fp output pixelpos.w in FragColor.a for opaque and then change the blend modes so that dest alpha is grabbed from FragColor.a on opaque stuff and not modified on transparent stuff. That will cause the scene texture to contain RGB + depth. Normal passes will read the RGB part, and the SSAO pass will grab the depth.
The problem is the transparent/sprite rendering. Right now the pass runs after the scene is rendered, which means the darkening is put on top of the scene. That adds the darkening on top of the sprites - even the player weapon. If we can find a solution to this part of the puzzle we have a winner.

I know a relatively simple way to fix the depth problem. It involves having main.fp output pixelpos.w in FragColor.a for opaque and then change the blend modes so that dest alpha is grabbed from FragColor.a on opaque stuff and not modified on transparent stuff. That will cause the scene texture to contain RGB + depth. Normal passes will read the RGB part, and the SSAO pass will grab the depth.
The problem is the transparent/sprite rendering. Right now the pass runs after the scene is rendered, which means the darkening is put on top of the scene. That adds the darkening on top of the sprites - even the player weapon. If we can find a solution to this part of the puzzle we have a winner.
-
- Posts: 43
- Joined: Fri Sep 02, 2005 3:23
Re: SSAO discussion
This is an awesome start... I loaded my Star Trek TC up with this and the effect is very nice.
One thing to note moving forward... If the weapon is a model, it looks like only the weapon is shaded, not the rest of the view (unless certain hudmessages are displaying, apparently, which makes no sense to me?)... If I switch to a sprite weapon, everything behaves as normal... This also happens in Enjay's Gene-Tech mod - the shadows only appear when the weapons are off-screen while being switched.
One thing to note moving forward... If the weapon is a model, it looks like only the weapon is shaded, not the rest of the view (unless certain hudmessages are displaying, apparently, which makes no sense to me?)... If I switch to a sprite weapon, everything behaves as normal... This also happens in Enjay's Gene-Tech mod - the shadows only appear when the weapons are off-screen while being switched.
-
- Developer
- Posts: 798
- Joined: Sat Jul 23, 2016 7:53
Re: SSAO discussion
You mean when the weapon is a 3D model? Then the SSAO pass should be affecting it. Does that look bad?
Edit: okay I think I get what you're saying. The SSAO effect disappears from the rest of the scene? That's probably another depth buffer clear (like skies and portals).
Edit: okay I think I get what you're saying. The SSAO effect disappears from the rest of the scene? That's probably another depth buffer clear (like skies and portals).
Last edited by dpJudas on Wed Aug 31, 2016 22:34, edited 1 time in total.
-
- Posts: 43
- Joined: Fri Sep 02, 2005 3:23
Re: SSAO discussion
Yes... The weapon itself looks fine, but the overlay is *only* affecting the weapon model, and not the rest of the screen (turning on the debug view gives a white screen with the shadow effect showing only over the weapon).dpJudas wrote:You mean when the weapon is a 3D model? Then the SSAO pass should be affecting it. Does that look bad?
Unless this is just me, somehow...
- Graf Zahl
- GZDoom Developer
- Posts: 7148
- Joined: Wed Jul 20, 2005 9:48
- Location: Germany
- Contact:
Re: SSAO discussion
The 3D weapon pass clears the depth buffer. This is needed so that the weapon does not clip into walls.
See gl_scene.cpp, line 665.
See gl_scene.cpp, line 665.
- Ozymandias81
- Posts: 12
- Joined: Fri Jan 16, 2015 21:08
- Location: Olympus Mons, Mars
Re: SSAO discussion
Hi dpJudas, while I am working on BoA is there any hope to get the 32bit version of this experimental build? I can't run it on my Win7 32bit sp1 Ultimate and I want to test something (no, I don't know how to compile builds though)dpJudas wrote:Okay, here it is: https://github.com/dpjudas/zdoom/releases/tag/ssao1
Note that the pass has some outstanding issues that causes it to create some annoying shadows due to some bug in the shader itself. You can see how the SSAO part looks like using ssao_debug 1. The gaussian blur also needs to be depth aware.
Overall though, without a solution to the portal situation, the entire thing is more or less useless.

Thanks in advance and also AMAZING WORK RECENTLY WITH BLOOM AND TONEMAPS TOO!

...And all these new additions will make GZDoom an engine similar to Unreal Engine 4!

- Rachael
- Developer
- Posts: 3651
- Joined: Sat May 13, 2006 10:30
Re: SSAO discussion
I highly doubt GZDoom will ever come close to that.Ozymandias81 wrote:...And all these new additions will make GZDoom an engine similar to Unreal Engine 4!
But I will agree it's getting some really nice modern features.
-
- Developer
- Posts: 798
- Joined: Sat Jul 23, 2016 7:53
Re: SSAO discussion
You're welcome, Ozymandias81. It's been fun adding (well, maybe except the black screen issues
).
I'll upload a build later today for you - just need to tie up some loose ends first in the code. I've managed to fix the SSAO shader, so now it looks much much better than before. The screenshots Nash showed hided the fact that the image was very unpleasant to look at when moving around, but NOW it looks ace live too!

I'll upload a build later today for you - just need to tie up some loose ends first in the code. I've managed to fix the SSAO shader, so now it looks much much better than before. The screenshots Nash showed hided the fact that the image was very unpleasant to look at when moving around, but NOW it looks ace live too!
- Tormentor667
- Stronghold Team
- Posts: 3555
- Joined: Sun Nov 13, 2005 23:15
- Location: Germany
- Contact:
Re: SSAO discussion
This is brilliant dpJudas, really, it was about time that someone starts to enhances GZDoom in these perspectives 

- Ozymandias81
- Posts: 12
- Joined: Fri Jan 16, 2015 21:08
- Location: Olympus Mons, Mars
Re: SSAO discussion
Ikr just kiddin' a bitEruanna wrote: I highly doubt GZDoom will ever come close to that.

Totally agree with uEruanna wrote: But I will agree it's getting some really nice modern features.

Thanks a lot dpJudas then! I am "watching & following" you on github since today, so I'll keep an eye on your releases from time to timedpJudas wrote:You're welcome, Ozymandias81. It's been fun adding (well, maybe except the black screen issues).
I'll upload a build later today for you - just need to tie up some loose ends first in the code. I've managed to fix the SSAO shader, so now it looks much much better than before. The screenshots Nash showed hided the fact that the image was very unpleasant to look at when moving around, but NOW it looks ace live too!

-
- Posts: 152
- Joined: Tue Oct 25, 2011 13:05
Re: SSAO discussion
My Ray cast simulator looks strange with the higher dynamic light settings :S
Also, why theres no sound under your build? I only hear midi sound but nothing else :S
EDIT:
I tested with my map and I saw this.

and, the dynamic lights weren't showing under my map ( I belive it's because my mod has a modified main.vp/fp [used for a custom fog shader] inside of it but idk)...
Still, it's a great work
As a plus, here's a screenshot from the tomb raider 2 map using your new effects

Spoiler:but, that's ok, since it's a special case and can be "disabled"...
Also, why theres no sound under your build? I only hear midi sound but nothing else :S
EDIT:
I tested with my map and I saw this.

and, the dynamic lights weren't showing under my map ( I belive it's because my mod has a modified main.vp/fp [used for a custom fog shader] inside of it but idk)...
Still, it's a great work

As a plus, here's a screenshot from the tomb raider 2 map using your new effects
