common-vert-params.glsl.ts 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. export const common_vert_params = `
  2. uniform mat4 uProjection, uModel, uView;
  3. uniform vec3 uCameraPosition;
  4. uniform int uObjectId;
  5. uniform int uVertexCount;
  6. uniform int uInstanceCount;
  7. uniform int uGroupCount;
  8. uniform vec4 uInvariantBoundingSphere;
  9. uniform bool uDoubleSided;
  10. uniform int uPickType;
  11. #if dClipObjectCount != 0
  12. uniform int uClipObjectType[dClipObjectCount];
  13. uniform bool uClipObjectInvert[dClipObjectCount];
  14. uniform vec3 uClipObjectPosition[dClipObjectCount];
  15. uniform vec4 uClipObjectRotation[dClipObjectCount];
  16. uniform vec3 uClipObjectScale[dClipObjectCount];
  17. #if defined(dClipping)
  18. uniform vec2 uClippingTexDim;
  19. uniform sampler2D tClipping;
  20. #if __VERSION__ == 100
  21. varying float vClipping;
  22. #else
  23. flat out float vClipping;
  24. #endif
  25. #endif
  26. #endif
  27. #if defined(dRenderVariant_color) || defined(dRenderVariant_marking)
  28. uniform float uMarker;
  29. uniform vec2 uMarkerTexDim;
  30. uniform sampler2D tMarker;
  31. #if __VERSION__ == 100
  32. varying float vMarker;
  33. #else
  34. flat out float vMarker;
  35. #endif
  36. #endif
  37. varying vec3 vModelPosition;
  38. varying vec3 vViewPosition;
  39. #if __VERSION__ == 100
  40. attribute float aVertex;
  41. #define VertexID int(aVertex)
  42. #else
  43. // not using gl_VertexID but aVertex to ensure there is an active attribute with divisor 0
  44. // since FF 85 this is not needed anymore but lets keep it for backwards compatibility
  45. // https://bugzilla.mozilla.org/show_bug.cgi?id=1679693
  46. // see also note in src/mol-gl/webgl/render-item.ts
  47. attribute float aVertex;
  48. #define VertexID int(aVertex)
  49. // #define VertexID gl_VertexID
  50. #endif
  51. `;