25 lines
669 B
GLSL
25 lines
669 B
GLSL
#version 450 core
|
|
layout (location=0) out vec4 fCol;
|
|
layout (location=1) out vec4 fPos;
|
|
layout (location=2) out vec4 fNorm;
|
|
in vec2 tPos;
|
|
in vec3 gTexCoords;
|
|
in vec4 gPos;
|
|
in vec4 gNorm;
|
|
in vec4 gColor;
|
|
in float gAng;
|
|
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,gTexCoords);
|
|
fPos = gPos;
|
|
vec4 basenorm = texture(normalSampler,gTexCoords) - 0.5;
|
|
vec2 n1 = rotateV2(gAng,vec2(basenorm.x,basenorm.z));
|
|
fNorm = vec4(-vec3(n1,basenorm.y),0);
|
|
}
|