feed.glsl 621 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /* clang-format off */
  2. #[modes]
  3. mode_default =
  4. #[specializations]
  5. USE_EXTERNAL_SAMPLER = false
  6. #[vertex]
  7. layout(location = 0) in vec2 vertex_attrib;
  8. out vec2 uv_interp;
  9. void main() {
  10. uv_interp = vertex_attrib * 0.5 + 0.5;
  11. gl_Position = vec4(vertex_attrib, 1.0, 1.0);
  12. }
  13. /* clang-format off */
  14. #[fragment]
  15. layout(location = 0) out vec4 frag_color;
  16. in vec2 uv_interp;
  17. /* clang-format on */
  18. #ifdef USE_EXTERNAL_SAMPLER
  19. uniform samplerExternalOES sourceFeed; // texunit:0
  20. #else
  21. uniform sampler2D sourceFeed; // texunit:0
  22. #endif
  23. void main() {
  24. vec4 color = texture(sourceFeed, uv_interp);
  25. frag_color = color;
  26. }