Added support to G-Buffer. (#532)

This commit is contained in:
Jonathas Costa
2018-02-26 21:11:22 -05:00
committed by Alexander Bock
parent f0a55b21ff
commit 95e0cf478d
2 changed files with 7 additions and 2 deletions
+6 -2
View File
@@ -28,6 +28,7 @@ in vec2 vs_st;
in vec3 vs_normalViewSpace;
in vec4 vs_positionCameraSpace;
in float vs_screenSpaceDepth;
in vec3 vs_normalObjSpace;
uniform bool performShading = true;
uniform vec3 directionToSunViewSpace;
@@ -68,8 +69,11 @@ Fragment getFragment() {
frag.color.rgb = diffuseAlbedo;
}
frag.color.a = 1.0;
frag.depth = vs_screenSpaceDepth;
frag.color.a = 1.0;
frag.depth = vs_screenSpaceDepth;
frag.gPosition = vs_positionCameraSpace;
frag.gNormal = vec4(vs_normalObjSpace, 1.0);
return frag;
}
+1
View File
@@ -34,6 +34,7 @@ out vec2 vs_st;
out vec3 vs_normalViewSpace;
out float vs_screenSpaceDepth;
out vec4 vs_positionCameraSpace;
out vec3 vs_normalObjSpace;
uniform mat4 modelViewTransform;
uniform mat4 projectionTransform;