Add normal maps to the floor

This commit is contained in:
2023-03-17 16:51:02 +00:00
parent 6425ef3f0a
commit 850fdf1783
16 changed files with 52 additions and 55 deletions
+6 -4
View File
@@ -4,11 +4,13 @@ in vec3 vPos;
layout (location=0) out vec4 fCol;
layout (location=1) out vec4 fPos;
layout (location=2) out vec4 normal;
uniform sampler2DArray tilesetSampler;
layout (binding=0) uniform sampler2DArray tilesetSampler;
layout (binding=1) uniform sampler2D normalSampler;
void main()
{
fCol = texture(tilesetSampler, vTexPos);
//fCol = texture(tilesetSampler, vec3(0.3,0.1,0) + vTexPos);
fCol = vec4(0.2,0.3,0.6,1);
//fCol = vec4(0.6,0.4,0.3,1);
fPos = vec4(vPos,1);
//normal = vec4(vPos.xy,vPos.z-1,1);
normal = vec4(vPos.xy,vPos.z-1,1);
normal = vec4(vPos + vec3(0.5) - texture(normalSampler,2*vTexPos.xy).xyz,0);
}