2
0

BsCommonVert.glsl 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. // Common code for all vertex shaders of BS
  2. #define DEFAULT_FLOAT_PRECISION mediump
  3. #pragma anki include "shaders/MsBsCommon.glsl"
  4. layout(location = 0) in vec3 position;
  5. layout(location = 3) in vec2 texCoord;
  6. /// @name Varyings
  7. /// @{
  8. out vec2 vTexCoord;
  9. flat out float vAlpha;
  10. /// @}
  11. //==============================================================================
  12. #define setPositionVec3_DEFINED
  13. void setPositionVec3(in vec3 pos)
  14. {
  15. gl_Position = vec4(pos, 1.0);
  16. }
  17. //==============================================================================
  18. #define setPositionVec4_DEFINED
  19. void setPositionVec4(in vec4 pos)
  20. {
  21. gl_Position = pos;
  22. }
  23. //==============================================================================
  24. #define setTexCoords_DEFINED
  25. void setTexCoords(in vec2 x)
  26. {
  27. vTexCoord = x;
  28. }
  29. //==============================================================================
  30. #define particle_DEFINED
  31. void particle(in mat4 mvp)
  32. {
  33. vTexCoord = texCoord;
  34. gl_Position = mvp * vec4(position, 1);
  35. }
  36. //==============================================================================
  37. #define writeAlpha_DEFINED
  38. void writeAlpha(in float alpha)
  39. {
  40. vAlpha = alpha;
  41. }