20 lines
624 B
GLSL
20 lines
624 B
GLSL
#version 450 core
|
|
layout (location=0) out vec4 fCol;
|
|
layout (location=1) out vec3 fPos;
|
|
layout (location=2) out vec4 fNorm;
|
|
in vec3 vTexCoords;
|
|
in vec4 vPos;
|
|
in float vAng;
|
|
layout (binding=40) uniform sampler2DArray diffuseSampler;
|
|
layout (binding=41) uniform sampler2DArray normalSampler;
|
|
vec2 rotateV2 (float a, vec2 v)
|
|
{ return vec2(v.x*cos(a) - v.y*sin(a), v.x*sin(a) + v.y*cos(a)); }
|
|
void main()
|
|
{
|
|
fCol = texture(diffuseSampler,vTexCoords);
|
|
fPos = vPos.xyz;
|
|
vec4 basenorm = texture(normalSampler,vTexCoords) - 0.5;
|
|
vec2 n1 = rotateV2(vAng,vec2(basenorm.x,basenorm.z));
|
|
fNorm = vec4(-vec3(n1,basenorm.y),0);
|
|
}
|