gl01/internal/asset/shader/world/geometry.frag

29 lines
595 B
GLSL
Raw Normal View History

2022-01-22 23:06:41 +08:00
#version 330
uniform sampler2D tex;
in vec3 fragPosWorld;
in float fragPosLightspaceZ;
2022-02-05 19:25:44 +08:00
in float fragDepthView;
2022-01-22 23:06:41 +08:00
in vec2 fragTexCoord;
in vec3 fragNormal;
in float fragLight;
layout (location = 0) out vec4 outputPosition;
layout (location = 1) out vec4 outputNormal;
layout (location = 2) out vec4 outputColor;
const float gamma = 2.2;
void main() {
outputPosition.xyz = fragPosWorld;
2022-02-05 19:25:44 +08:00
outputPosition.w = fragDepthView;
2022-01-22 23:06:41 +08:00
outputNormal.xyz = fragNormal;
2022-02-05 19:25:44 +08:00
outputNormal.w = fragPosLightspaceZ;
2022-01-22 23:06:41 +08:00
outputColor = texture(tex, fragTexCoord);
2022-02-21 14:13:24 +08:00
outputColor = vec4(outputColor.rgb, outputColor.a);
2022-01-22 23:06:41 +08:00
}