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 :-/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.
SSAO discussion
Moderator: Graf Zahl
- Tormentor667
- Stronghold Team
- Posts: 3555
- Joined: Sun Nov 13, 2005 23:15
- Location: Germany
- Contact:
Re: SSAO discussion
-
- Developer
- Posts: 798
- Joined: Sat Jul 23, 2016 7:53
Re: SSAO discussion
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.
-
- Posts: 43
- Joined: Fri Sep 02, 2005 3:23
Re: SSAO discussion
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.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.
That image was taken on map c2m6_a at around coordinates 1500, 4000.
-
- Developer
- Posts: 798
- Joined: Sat Jul 23, 2016 7:53
Re: SSAO discussion
Thanks AFADoomer, that's exactly what I needed.
-
- Developer
- Posts: 798
- Joined: Sat Jul 23, 2016 7:53
Re: SSAO discussion
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!
Not that easy to spot at this location, but it is there! Also, it is the first screenshot of gzdoom with gbuffers!
- Gez
- Developer
- Posts: 1399
- Joined: Mon Oct 22, 2007 16:47
Re: SSAO discussion
So SSAO fog makes the corners foggier?
-
- Developer
- Posts: 798
- Joined: Sat Jul 23, 2016 7:53
Re: SSAO discussion
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:
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);
}
- Nash
- Developer
- Posts: 1226
- Joined: Sun Sep 25, 2005 1:49
- Location: Kuala Lumpur, Malaysia
- Contact:
Re: SSAO discussion
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!
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!
-
- Developer
- Posts: 798
- Joined: Sat Jul 23, 2016 7:53
Re: SSAO discussion
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.
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.
- Tormentor667
- Stronghold Team
- Posts: 3555
- Joined: Sun Nov 13, 2005 23:15
- Location: Germany
- Contact:
Re: SSAO discussion
Awesome Much better now!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!