xray.shader 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. [shaders]
  2. vertex =
  3. uniform highp mat4 u_modelMatrix;
  4. uniform highp mat4 u_viewMatrix;
  5. uniform highp mat4 u_projectionMatrix;
  6. attribute highp vec4 a_vertex;
  7. void main()
  8. {
  9. gl_Position = u_projectionMatrix * u_viewMatrix * u_modelMatrix * a_vertex;
  10. }
  11. fragment =
  12. #ifdef GL_ES
  13. #ifdef GL_FRAGMENT_PRECISION_HIGH
  14. precision highp float;
  15. #else
  16. precision mediump float;
  17. #endif // GL_FRAGMENT_PRECISION_HIGH
  18. #endif // GL_ES
  19. uniform vec4 u_color;
  20. void main()
  21. {
  22. gl_FragColor = u_color;
  23. }
  24. vertex41core =
  25. #version 410
  26. uniform highp mat4 u_modelMatrix;
  27. uniform highp mat4 u_viewMatrix;
  28. uniform highp mat4 u_projectionMatrix;
  29. in highp vec4 a_vertex;
  30. void main()
  31. {
  32. gl_Position = u_projectionMatrix * u_viewMatrix * u_modelMatrix * a_vertex;
  33. }
  34. fragment41core =
  35. #version 410
  36. uniform vec4 u_color;
  37. out vec4 frag_color;
  38. void main()
  39. {
  40. frag_color = u_color;
  41. }
  42. [defaults]
  43. u_color = [0.02, 0.02, 0.02, 1.0]
  44. [bindings]
  45. u_modelMatrix = model_matrix
  46. u_viewMatrix = view_matrix
  47. u_projectionMatrix = projection_matrix
  48. [attributes]
  49. a_vertex = vertex