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

30 lines
580 B
GLSL

#version 330
uniform sampler2D tex;
in vec3 fragPosWorld;
in float fragPosLightspaceZ;
in float fragDepthView;
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() {
outputColor = texture(tex, fragTexCoord);
if (outputColor.a < 1e-3)
discard;
outputPosition.xyz = fragPosWorld;
outputPosition.w = fragDepthView;
outputNormal.xyz = fragNormal;
outputNormal.w = fragPosLightspaceZ;
}