Implement something like deferred lighting

This commit is contained in:
2021-09-01 00:37:07 +01:00
parent 2d139adc8f
commit 1c587d4b9a
13 changed files with 90 additions and 71 deletions
+4 -2
View File
@@ -2,11 +2,13 @@
layout (location = 0) in vec4 position;
layout (location = 1) in vec4 color;
layout (std140, binding = 0) uniform TheMat { mat4 theMat; } ;
out vec4 vColor;
out vec4 vCol;
out vec3 vPos;
void main()
{
vec4 posxy = theMat * vec4(position.xyz,1);
vec4 posz = theMat * vec4(position.xyw,1);
gl_Position = vec4(posxy.xy,posz.z,1);
vColor = color;
vCol = color;
vPos = position.xyz;
}