rsm.frag 299 B

123456789101112131415
  1. uniform sampler2D tex;
  2. in vec2 uv;
  3. in vec3 nor;
  4. in vec4 color;
  5. layout (location = 0) out vec3 RSMColor;
  6. layout (location = 1) out vec3 RSMNormals;
  7. void main()
  8. {
  9. if (texture(tex, uv).a < .5) discard;
  10. RSMColor = texture(tex, uv).xyz * color.rgb;
  11. RSMNormals = .5 * normalize(nor) + .5;
  12. }