engineCapabilities.ts 4.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /**
  2. * Interface used to describe the capabilities of the engine relatively to the current browser
  3. */
  4. export interface EngineCapabilities {
  5. /** Maximum textures units per fragment shader */
  6. maxTexturesImageUnits: number;
  7. /** Maximum texture units per vertex shader */
  8. maxVertexTextureImageUnits: number;
  9. /** Maximum textures units in the entire pipeline */
  10. maxCombinedTexturesImageUnits: number;
  11. /** Maximum texture size */
  12. maxTextureSize: number;
  13. /** Maximum texture samples */
  14. maxSamples?: number;
  15. /** Maximum cube texture size */
  16. maxCubemapTextureSize: number;
  17. /** Maximum render texture size */
  18. maxRenderTextureSize: number;
  19. /** Maximum number of vertex attributes */
  20. maxVertexAttribs: number;
  21. /** Maximum number of varyings */
  22. maxVaryingVectors: number;
  23. /** Maximum number of uniforms per vertex shader */
  24. maxVertexUniformVectors: number;
  25. /** Maximum number of uniforms per fragment shader */
  26. maxFragmentUniformVectors: number;
  27. /** Defines if standard derivatives (dx/dy) are supported */
  28. standardDerivatives: boolean;
  29. /** Defines if s3tc texture compression is supported */
  30. s3tc?: WEBGL_compressed_texture_s3tc;
  31. /** Defines if pvrtc texture compression is supported */
  32. pvrtc: any; //WEBGL_compressed_texture_pvrtc;
  33. /** Defines if etc1 texture compression is supported */
  34. etc1: any; //WEBGL_compressed_texture_etc1;
  35. /** Defines if etc2 texture compression is supported */
  36. etc2: any; //WEBGL_compressed_texture_etc;
  37. /** Defines if astc texture compression is supported */
  38. astc: any; //WEBGL_compressed_texture_astc;
  39. /** Defines if bptc texture compression is supported */
  40. bptc: any; //EXT_texture_compression_bptc;
  41. /** Defines if float textures are supported */
  42. textureFloat: boolean;
  43. /** Defines if vertex array objects are supported */
  44. vertexArrayObject: boolean;
  45. /** Gets the webgl extension for anisotropic filtering (null if not supported) */
  46. textureAnisotropicFilterExtension?: EXT_texture_filter_anisotropic;
  47. /** Gets the maximum level of anisotropy supported */
  48. maxAnisotropy: number;
  49. /** Defines if instancing is supported */
  50. instancedArrays: boolean;
  51. /** Defines if 32 bits indices are supported */
  52. uintIndices: boolean;
  53. /** Defines if high precision shaders are supported */
  54. highPrecisionShaderSupported: boolean;
  55. /** Defines if depth reading in the fragment shader is supported */
  56. fragmentDepthSupported: boolean;
  57. /** Defines if float texture linear filtering is supported*/
  58. textureFloatLinearFiltering: boolean;
  59. /** Defines if rendering to float textures is supported */
  60. textureFloatRender: boolean;
  61. /** Defines if half float textures are supported*/
  62. textureHalfFloat: boolean;
  63. /** Defines if half float texture linear filtering is supported*/
  64. textureHalfFloatLinearFiltering: boolean;
  65. /** Defines if rendering to half float textures is supported */
  66. textureHalfFloatRender: boolean;
  67. /** Defines if textureLOD shader command is supported */
  68. textureLOD: boolean;
  69. /** Defines if draw buffers extension is supported */
  70. drawBuffersExtension: boolean;
  71. /** Defines if depth textures are supported */
  72. depthTextureExtension: boolean;
  73. /** Defines if float color buffer are supported */
  74. colorBufferFloat: boolean;
  75. /** Gets disjoint timer query extension (null if not supported) */
  76. timerQuery?: EXT_disjoint_timer_query;
  77. /** Defines if timestamp can be used with timer query */
  78. canUseTimestampForTimerQuery: boolean;
  79. /** Defines if multiview is supported (https://www.khronos.org/registry/webgl/extensions/WEBGL_multiview/) */
  80. multiview?: any;
  81. /** Defines if oculus multiview is supported (https://developer.oculus.com/documentation/oculus-browser/latest/concepts/browser-multiview/) */
  82. oculusMultiview?: any;
  83. /** Function used to let the system compiles shaders in background */
  84. parallelShaderCompile?: {
  85. COMPLETION_STATUS_KHR: number;
  86. };
  87. /** Max number of texture samples for MSAA */
  88. maxMSAASamples: number;
  89. /** Defines if the blend min max extension is supported */
  90. blendMinMax: boolean;
  91. /** In some iOS + WebGL1, gl_InstanceID (and gl_InstanceIDEXT) is undefined even if instancedArrays is true. So don't use gl_InstanceID in those cases */
  92. canUseGLInstanceID: boolean;
  93. /** Defines if gl_vertexID is available */
  94. canUseGLVertexID: boolean;
  95. }