Page 7 of 7
Re: SSAO discussion
Posted: Thu Sep 15, 2016 15:58
by Tormentor667
dpJudas wrote:For the bloom, the problem here is how it calculates camera exposure. I cheated and used the sector brightness level as the indicator instead of what pixels are on the screen. I can probably fix this by calculating the real exposure, but it won't make it into the upcoming release I'm afraid.
Thanks for the reply. I think it's not bad if it doesn't make it into the upcoming release as long as it is being adressed somewhere in the future. As of now, the bloom shader isn't of any use in winter-themed maps to be honest :-/
Re: SSAO discussion
Posted: Sun Sep 18, 2016 3:59
by dpJudas
Tormentor667, how do I get to that winter map you showed a screenshot of? I've implemented an automatic exposure calculation pass for the bloom that I want to test on it.
Re: SSAO discussion
Posted: Sun Sep 18, 2016 16:20
by AFADoomer
dpJudas wrote:Tormentor667, how do I get to that winter map you showed a screenshot of? I've implemented an automatic exposure calculation pass for the bloom that I want to test on it.
It's in WolfenDoom: Blade of Agony. Your best bet is probably to pull the current version of the mod from its git repository
here.
That image was taken on map c2m6_a at around coordinates 1500, 4000.
Re: SSAO discussion
Posted: Sun Sep 18, 2016 18:42
by dpJudas
Thanks AFADoomer, that's exactly what I needed.
Re: SSAO discussion
Posted: Wed Sep 21, 2016 1:01
by dpJudas
Managed to get fog applied to the SSAO pass. This is how it looks like with the new automatic exposure adjustment and ambient occlusion:
Not that easy to spot at this location, but it is there! Also, it is the first screenshot of gzdoom with gbuffers!

Re: SSAO discussion
Posted: Wed Sep 21, 2016 20:54
by Gez
So SSAO fog makes the corners foggier?
Re: SSAO discussion
Posted: Wed Sep 21, 2016 21:07
by dpJudas
Pretty much. The normal scene pass outputs the color SSAO should attenuate towards in a second color buffer. The SSAO combine shader then grabs that color for the fragment and blends it back to the scene's primary color buffer.
The code picking the color looks like this right now:
Code: Select all
vec3 AmbientOcclusionColor()
{
float fogdist;
float fogfactor;
//
// calculate fog factor
//
if (uFogEnabled == -1)
{
fogdist = pixelpos.w;
}
else
{
fogdist = max(16.0, length(pixelpos.xyz));
}
fogfactor = exp2 (uFogDensity * fogdist);
return mix(uFogColor.rgb, vec3(0.0), fogfactor);
}
Re: SSAO discussion
Posted: Thu Sep 22, 2016 3:57
by Nash
Oh so that's how it works? One would think that the "correct" image would be: still darkened shadows (black) in corners, except the fog is drawn on top of the shadows, so that the fog's translucency will cover both the level and the shadow...
This was a similar issue when mapping in ZDoom/GZDoom with fog: Let's say you make a 3D ceiling that's at the exterior. You'd want to make the area below the ceiling cast a "shadow" therefore you'd think to darken the sector brightness. Except what actually happens when you do this is that the fog under that ceiling just looks thicker because of how the fogging works in Doom. It doesn't look like a shadow is being cast. :S Fortunately this can be worked around by making the SECTOR COLOR darker/more black instead (and leave the brightness alone so that the fog density will remain consistent in and outside of that ceiling area).
But, well, your latest image is much better than the Hexen ones I posted back there where there's just this black stuff sticking out of the thick fog. :P
Nice job with the fixes, and the improved exposure system too!
Re: SSAO discussion
Posted: Thu Sep 22, 2016 5:37
by dpJudas
The AmbientOcclusionColor function should be returning the color that a fully darkened shadow (black) should have for that fragment. It uses this color with the occlusion amount/attenuation as the alpha value to calculate the final pixel color as follows:
output.rgb = occlusionColor.rgb * occlusionAmount + level.rgb * (1 - occlusionAmount)
For a normal non-fogged pixel occlusionColor is black. For a white scene, like on the screenshot, it is black at the viewer and then increasingly more white as the distance to the eye increases for the pixel. I believe this is mathematically correct within the behavior of how all other fog in GZDoom works. It just happens to look like it fades towards the fog color because a solid black is a more dominant color than the variations in a texture.
Re: SSAO discussion
Posted: Sat Oct 01, 2016 14:51
by Tormentor667
dpJudas wrote:Managed to get fog applied to the SSAO pass. This is how it looks like with the new automatic exposure adjustment and ambient occlusion:
Not that easy to spot at this location, but it is there! Also, it is the first screenshot of gzdoom with gbuffers!

Awesome

Much better now!