SSAO is working, but is kinda crappy. You can change shade variables in the debug window.

This commit is contained in:
Teejoon
2016-02-19 16:50:04 +01:00
parent 0d665c10fe
commit 201480b17f
16 changed files with 444 additions and 38 deletions
@@ -0,0 +1,14 @@
#version 430
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;
float depthLinear = ClipInfo[0] / (ClipInfo[1] * depthSample + ClipInfo[2]);
//float depthLinear = (NearClip) / ( -depthSample + 1.0f);
fragmentColor = vec4(depthLinear, depthLinear, depthLinear, 1.0f);
}