constants.ts 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. /** Defines the cross module used constants to avoid circular dependncies */
  2. export class Constants {
  3. /** Defines that alpha blending is disabled */
  4. public static readonly ALPHA_DISABLE = 0;
  5. /** Defines that alpha blending to SRC ALPHA * SRC + DEST */
  6. public static readonly ALPHA_ADD = 1;
  7. /** Defines that alpha blending to SRC ALPHA * SRC + (1 - SRC ALPHA) * DEST */
  8. public static readonly ALPHA_COMBINE = 2;
  9. /** Defines that alpha blending to DEST - SRC * DEST */
  10. public static readonly ALPHA_SUBTRACT = 3;
  11. /** Defines that alpha blending to SRC * DEST */
  12. public static readonly ALPHA_MULTIPLY = 4;
  13. /** Defines that alpha blending to SRC ALPHA * SRC + (1 - SRC) * DEST */
  14. public static readonly ALPHA_MAXIMIZED = 5;
  15. /** Defines that alpha blending to SRC + DEST */
  16. public static readonly ALPHA_ONEONE = 6;
  17. /** Defines that alpha blending to SRC + (1 - SRC ALPHA) * DEST */
  18. public static readonly ALPHA_PREMULTIPLIED = 7;
  19. /**
  20. * Defines that alpha blending to SRC + (1 - SRC ALPHA) * DEST
  21. * Alpha will be set to (1 - SRC ALPHA) * DEST ALPHA
  22. */
  23. public static readonly ALPHA_PREMULTIPLIED_PORTERDUFF = 8;
  24. /** Defines that alpha blending to CST * SRC + (1 - CST) * DEST */
  25. public static readonly ALPHA_INTERPOLATE = 9;
  26. /**
  27. * Defines that alpha blending to SRC + (1 - SRC) * DEST
  28. * Alpha will be set to SRC ALPHA + (1 - SRC ALPHA) * DEST ALPHA
  29. */
  30. public static readonly ALPHA_SCREENMODE = 10;
  31. /** Defines that the ressource is not delayed*/
  32. public static readonly DELAYLOADSTATE_NONE = 0;
  33. /** Defines that the ressource was successfully delay loaded */
  34. public static readonly DELAYLOADSTATE_LOADED = 1;
  35. /** Defines that the ressource is currently delay loading */
  36. public static readonly DELAYLOADSTATE_LOADING = 2;
  37. /** Defines that the ressource is delayed and has not started loading */
  38. public static readonly DELAYLOADSTATE_NOTLOADED = 4;
  39. // Depht or Stencil test Constants.
  40. /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will never pass. i.e. Nothing will be drawn */
  41. public static readonly NEVER = 0x0200;
  42. /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will always pass. i.e. Pixels will be drawn in the order they are drawn */
  43. public static readonly ALWAYS = 0x0207;
  44. /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than the stored value */
  45. public static readonly LESS = 0x0201;
  46. /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is equals to the stored value */
  47. public static readonly EQUAL = 0x0202;
  48. /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is less than or equal to the stored value */
  49. public static readonly LEQUAL = 0x0203;
  50. /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than the stored value */
  51. public static readonly GREATER = 0x0204;
  52. /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is greater than or equal to the stored value */
  53. public static readonly GEQUAL = 0x0206;
  54. /** Passed to depthFunction or stencilFunction to specify depth or stencil tests will pass if the new depth value is not equal to the stored value */
  55. public static readonly NOTEQUAL = 0x0205;
  56. // Stencil Actions Constants.
  57. /** Passed to stencilOperation to specify that stencil value must be kept */
  58. public static readonly KEEP = 0x1E00;
  59. /** Passed to stencilOperation to specify that stencil value must be replaced */
  60. public static readonly REPLACE = 0x1E01;
  61. /** Passed to stencilOperation to specify that stencil value must be incremented */
  62. public static readonly INCR = 0x1E02;
  63. /** Passed to stencilOperation to specify that stencil value must be decremented */
  64. public static readonly DECR = 0x1E03;
  65. /** Passed to stencilOperation to specify that stencil value must be inverted */
  66. public static readonly INVERT = 0x150A;
  67. /** Passed to stencilOperation to specify that stencil value must be incremented with wrapping */
  68. public static readonly INCR_WRAP = 0x8507;
  69. /** Passed to stencilOperation to specify that stencil value must be decremented with wrapping */
  70. public static readonly DECR_WRAP = 0x8508;
  71. /** Texture is not repeating outside of 0..1 UVs */
  72. public static readonly TEXTURE_CLAMP_ADDRESSMODE = 0;
  73. /** Texture is repeating outside of 0..1 UVs */
  74. public static readonly TEXTURE_WRAP_ADDRESSMODE = 1;
  75. /** Texture is repeating and mirrored */
  76. public static readonly TEXTURE_MIRROR_ADDRESSMODE = 2;
  77. /** ALPHA */
  78. public static readonly TEXTUREFORMAT_ALPHA = 0;
  79. /** LUMINANCE */
  80. public static readonly TEXTUREFORMAT_LUMINANCE = 1;
  81. /** LUMINANCE_ALPHA */
  82. public static readonly TEXTUREFORMAT_LUMINANCE_ALPHA = 2;
  83. /** RGB */
  84. public static readonly TEXTUREFORMAT_RGB = 4;
  85. /** RGBA */
  86. public static readonly TEXTUREFORMAT_RGBA = 5;
  87. /** RED */
  88. public static readonly TEXTUREFORMAT_RED = 6;
  89. /** RED (2nd reference) */
  90. public static readonly TEXTUREFORMAT_R = 6;
  91. /** RG */
  92. public static readonly TEXTUREFORMAT_RG = 7;
  93. /** RED_INTEGER */
  94. public static readonly TEXTUREFORMAT_RED_INTEGER = 8;
  95. /** RED_INTEGER (2nd reference) */
  96. public static readonly TEXTUREFORMAT_R_INTEGER = 8;
  97. /** RG_INTEGER */
  98. public static readonly TEXTUREFORMAT_RG_INTEGER = 9;
  99. /** RGB_INTEGER */
  100. public static readonly TEXTUREFORMAT_RGB_INTEGER = 10;
  101. /** RGBA_INTEGER */
  102. public static readonly TEXTUREFORMAT_RGBA_INTEGER = 11;
  103. /** UNSIGNED_BYTE */
  104. public static readonly TEXTURETYPE_UNSIGNED_BYTE = 0;
  105. /** UNSIGNED_BYTE (2nd reference) */
  106. public static readonly TEXTURETYPE_UNSIGNED_INT = 0;
  107. /** FLOAT */
  108. public static readonly TEXTURETYPE_FLOAT = 1;
  109. /** HALF_FLOAT */
  110. public static readonly TEXTURETYPE_HALF_FLOAT = 2;
  111. /** BYTE */
  112. public static readonly TEXTURETYPE_BYTE = 3;
  113. /** SHORT */
  114. public static readonly TEXTURETYPE_SHORT = 4;
  115. /** UNSIGNED_SHORT */
  116. public static readonly TEXTURETYPE_UNSIGNED_SHORT = 5;
  117. /** INT */
  118. public static readonly TEXTURETYPE_INT = 6;
  119. /** UNSIGNED_INT */
  120. public static readonly TEXTURETYPE_UNSIGNED_INTEGER = 7;
  121. /** UNSIGNED_SHORT_4_4_4_4 */
  122. public static readonly TEXTURETYPE_UNSIGNED_SHORT_4_4_4_4 = 8;
  123. /** UNSIGNED_SHORT_5_5_5_1 */
  124. public static readonly TEXTURETYPE_UNSIGNED_SHORT_5_5_5_1 = 9;
  125. /** UNSIGNED_SHORT_5_6_5 */
  126. public static readonly TEXTURETYPE_UNSIGNED_SHORT_5_6_5 = 10;
  127. /** UNSIGNED_INT_2_10_10_10_REV */
  128. public static readonly TEXTURETYPE_UNSIGNED_INT_2_10_10_10_REV = 11;
  129. /** UNSIGNED_INT_24_8 */
  130. public static readonly TEXTURETYPE_UNSIGNED_INT_24_8 = 12;
  131. /** UNSIGNED_INT_10F_11F_11F_REV */
  132. public static readonly TEXTURETYPE_UNSIGNED_INT_10F_11F_11F_REV = 13;
  133. /** UNSIGNED_INT_5_9_9_9_REV */
  134. public static readonly TEXTURETYPE_UNSIGNED_INT_5_9_9_9_REV = 14;
  135. /** FLOAT_32_UNSIGNED_INT_24_8_REV */
  136. public static readonly TEXTURETYPE_FLOAT_32_UNSIGNED_INT_24_8_REV = 15;
  137. /** nearest is mag = nearest and min = nearest and mip = linear */
  138. public static readonly TEXTURE_NEAREST_SAMPLINGMODE = 1;
  139. /** Bilinear is mag = linear and min = linear and mip = nearest */
  140. public static readonly TEXTURE_BILINEAR_SAMPLINGMODE = 2;
  141. /** Trilinear is mag = linear and min = linear and mip = linear */
  142. public static readonly TEXTURE_TRILINEAR_SAMPLINGMODE = 3;
  143. /** nearest is mag = nearest and min = nearest and mip = linear */
  144. public static readonly TEXTURE_NEAREST_NEAREST_MIPLINEAR = 1;
  145. /** Bilinear is mag = linear and min = linear and mip = nearest */
  146. public static readonly TEXTURE_LINEAR_LINEAR_MIPNEAREST = 2;
  147. /** Trilinear is mag = linear and min = linear and mip = linear */
  148. public static readonly TEXTURE_LINEAR_LINEAR_MIPLINEAR = 3;
  149. /** mag = nearest and min = nearest and mip = nearest */
  150. public static readonly TEXTURE_NEAREST_NEAREST_MIPNEAREST = 4;
  151. /** mag = nearest and min = linear and mip = nearest */
  152. public static readonly TEXTURE_NEAREST_LINEAR_MIPNEAREST = 5;
  153. /** mag = nearest and min = linear and mip = linear */
  154. public static readonly TEXTURE_NEAREST_LINEAR_MIPLINEAR = 6;
  155. /** mag = nearest and min = linear and mip = none */
  156. public static readonly TEXTURE_NEAREST_LINEAR = 7;
  157. /** mag = nearest and min = nearest and mip = none */
  158. public static readonly TEXTURE_NEAREST_NEAREST = 8;
  159. /** mag = linear and min = nearest and mip = nearest */
  160. public static readonly TEXTURE_LINEAR_NEAREST_MIPNEAREST = 9;
  161. /** mag = linear and min = nearest and mip = linear */
  162. public static readonly TEXTURE_LINEAR_NEAREST_MIPLINEAR = 10;
  163. /** mag = linear and min = linear and mip = none */
  164. public static readonly TEXTURE_LINEAR_LINEAR = 11;
  165. /** mag = linear and min = nearest and mip = none */
  166. public static readonly TEXTURE_LINEAR_NEAREST = 12;
  167. /** Explicit coordinates mode */
  168. public static readonly TEXTURE_EXPLICIT_MODE = 0;
  169. /** Spherical coordinates mode */
  170. public static readonly TEXTURE_SPHERICAL_MODE = 1;
  171. /** Planar coordinates mode */
  172. public static readonly TEXTURE_PLANAR_MODE = 2;
  173. /** Cubic coordinates mode */
  174. public static readonly TEXTURE_CUBIC_MODE = 3;
  175. /** Projection coordinates mode */
  176. public static readonly TEXTURE_PROJECTION_MODE = 4;
  177. /** Skybox coordinates mode */
  178. public static readonly TEXTURE_SKYBOX_MODE = 5;
  179. /** Inverse Cubic coordinates mode */
  180. public static readonly TEXTURE_INVCUBIC_MODE = 6;
  181. /** Equirectangular coordinates mode */
  182. public static readonly TEXTURE_EQUIRECTANGULAR_MODE = 7;
  183. /** Equirectangular Fixed coordinates mode */
  184. public static readonly TEXTURE_FIXED_EQUIRECTANGULAR_MODE = 8;
  185. /** Equirectangular Fixed Mirrored coordinates mode */
  186. public static readonly TEXTURE_FIXED_EQUIRECTANGULAR_MIRRORED_MODE = 9;
  187. // Texture rescaling mode
  188. /** Defines that texture rescaling will use a floor to find the closer power of 2 size */
  189. public static readonly SCALEMODE_FLOOR = 1;
  190. /** Defines that texture rescaling will look for the nearest power of 2 size */
  191. public static readonly SCALEMODE_NEAREST = 2;
  192. /** Defines that texture rescaling will use a ceil to find the closer power of 2 size */
  193. public static readonly SCALEMODE_CEILING = 3;
  194. /**
  195. * The dirty texture flag value
  196. */
  197. public static readonly MATERIAL_TextureDirtyFlag = 1;
  198. /**
  199. * The dirty light flag value
  200. */
  201. public static readonly MATERIAL_LightDirtyFlag = 2;
  202. /**
  203. * The dirty fresnel flag value
  204. */
  205. public static readonly MATERIAL_FresnelDirtyFlag = 4;
  206. /**
  207. * The dirty attribute flag value
  208. */
  209. public static readonly MATERIAL_AttributesDirtyFlag = 8;
  210. /**
  211. * The dirty misc flag value
  212. */
  213. public static readonly MATERIAL_MiscDirtyFlag = 16;
  214. /**
  215. * The all dirty flag value
  216. */
  217. public static readonly MATERIAL_AllDirtyFlag = 31;
  218. }