Add shading for shapes and the floor

This commit is contained in:
2023-03-15 18:24:09 +00:00
parent 21f87b96d8
commit 989140d46e
16 changed files with 158 additions and 69 deletions
+5 -1
View File
@@ -1,10 +1,14 @@
#version 450 core
in vec4 vCol;
in vec4 vPos;
in vec4 vNorm;
layout (location=0) out vec4 fCol;
layout (location=1) out vec4 fPos;
layout (location=2) out vec4 fNorm;
void main()
{
fCol = vCol;
fPos = vec4(vPos.xyz,1);
fPos = vPos;
fNorm = vNorm;
//fNorm = vec4(vPos.x,vPos.y+2,vPos.z,1);
}
+3
View File
@@ -1,11 +1,14 @@
#version 450 core
layout (location = 0) in vec4 pos;
layout (location = 1) in vec4 col;
layout (location = 2) in vec4 norm;
layout (std140, binding = 0) uniform TheMat { mat4 theMat; } ;
out vec4 vCol;
out vec4 vPos;
out vec4 vNorm;
void main() {
gl_Position = theMat * vec4(pos.xyz,1);
vCol = col;
vPos = pos;
vNorm = norm;
}