Files
axyz/resources/Shaders/SSAOViewSpaceZ.frag.glsl
T
Teejoon adceccf402 SSAO now working. Changed in DrawFinalePass so that th AOTexture is on texture position 0 and only get binded once.
Changed so that the picking pass get drawn once in the beginning so that the AO shatde could calculate AO from the depthbuffer generated during pthe pickingpass.

In the ImGUI debugg window there is now sliders to change the behavior of the AO shader. Only the minimum ambient lightning is HardCoded in to the frowardPlus fragmentshaders with a define in the begining.
2016-02-22 14:48:20 +01:00

14 lines
471 B
GLSL

#version 430
layout (binding = 0) uniform sampler2D DepthBuffer;
uniform vec3 ClipInfo;
out float depthLinear;
//Just for Debug, should be depthLinear
//out vec4 fragmentColor;
void main() {
float depthSample = texelFetch(DepthBuffer, ivec2(gl_FragCoord.xy), 0).r;
depthLinear = ClipInfo[0] / (ClipInfo[1] * depthSample + ClipInfo[2]);
//float depthLinear = (NearClip) / ( -depthSample + 1.0f);
//fragmentColor = vec4(depthLinear, depthLinear, depthLinear, 1.0f);
}