texture_render_with_depth.frag 290 B

1234567891011121314
  1. #version 460
  2. uniform sampler2D color_tex;
  3. uniform sampler2D depth_tex;
  4. in vec2 frag_uv;
  5. layout (location = 0) out vec4 frag_color;
  6. layout (depth_less) out float gl_FragDepth;
  7. void main() {
  8. frag_color = texture(color_tex, frag_uv);
  9. gl_FragDepth = texture(depth_tex, frag_uv).x;
  10. }