materialPluginEvent.d.ts 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. import type { ShaderCustomProcessingFunction } from "../Engines/Processors/shaderProcessingOptions";
  2. import type { SmartArray } from "../Misc/smartArray";
  3. import type { BaseTexture } from "./Textures/baseTexture";
  4. import type { EffectFallbacks } from "./effectFallbacks";
  5. import type { MaterialDefines } from "./materialDefines";
  6. import type { UniformBuffer } from "./uniformBuffer";
  7. import type { SubMesh } from "../Meshes/subMesh";
  8. import type { AbstractMesh } from "../Meshes/abstractMesh";
  9. import type { IAnimatable } from "../Animations/animatable.interface";
  10. import type { RenderTargetTexture } from "./Textures/renderTargetTexture";
  11. /** @internal */
  12. export type MaterialPluginCreated = {};
  13. /** @internal */
  14. export type MaterialPluginDisposed = {
  15. forceDisposeTextures?: boolean;
  16. };
  17. /** @internal */
  18. export type MaterialPluginHasTexture = {
  19. hasTexture: boolean;
  20. texture: BaseTexture;
  21. };
  22. /** @internal */
  23. export type MaterialPluginIsReadyForSubMesh = {
  24. isReadyForSubMesh: boolean;
  25. defines: MaterialDefines;
  26. subMesh: SubMesh;
  27. };
  28. /** @internal */
  29. export type MaterialPluginGetDefineNames = {
  30. defineNames?: {
  31. [name: string]: {
  32. type: string;
  33. default: any;
  34. };
  35. };
  36. };
  37. /** @internal */
  38. export type MaterialPluginPrepareEffect = {
  39. defines: MaterialDefines;
  40. fallbacks: EffectFallbacks;
  41. fallbackRank: number;
  42. customCode?: ShaderCustomProcessingFunction;
  43. attributes: string[];
  44. uniforms: string[];
  45. samplers: string[];
  46. uniformBuffersNames: string[];
  47. mesh: AbstractMesh;
  48. indexParameters: any;
  49. };
  50. /** @internal */
  51. export type MaterialPluginPrepareDefines = {
  52. defines: MaterialDefines;
  53. mesh: AbstractMesh;
  54. };
  55. /** @internal */
  56. export type MaterialPluginPrepareUniformBuffer = {
  57. ubo: UniformBuffer;
  58. };
  59. /** @internal */
  60. export type MaterialPluginBindForSubMesh = {
  61. subMesh: SubMesh;
  62. };
  63. /** @internal */
  64. export type MaterialPluginGetAnimatables = {
  65. animatables: IAnimatable[];
  66. };
  67. /** @internal */
  68. export type MaterialPluginGetActiveTextures = {
  69. activeTextures: BaseTexture[];
  70. };
  71. /** @internal */
  72. export type MaterialPluginFillRenderTargetTextures = {
  73. renderTargets: SmartArray<RenderTargetTexture>;
  74. };
  75. /** @internal */
  76. export type MaterialPluginHasRenderTargetTextures = {
  77. hasRenderTargetTextures: boolean;
  78. };
  79. /** @internal */
  80. export type MaterialPluginHardBindForSubMesh = {
  81. subMesh: SubMesh;
  82. };
  83. /**
  84. * @internal
  85. */
  86. export declare enum MaterialPluginEvent {
  87. Created = 1,
  88. Disposed = 2,
  89. GetDefineNames = 4,
  90. PrepareUniformBuffer = 8,
  91. IsReadyForSubMesh = 16,
  92. PrepareDefines = 32,
  93. BindForSubMesh = 64,
  94. PrepareEffect = 128,
  95. GetAnimatables = 256,
  96. GetActiveTextures = 512,
  97. HasTexture = 1024,
  98. FillRenderTargetTextures = 2048,
  99. HasRenderTargetTextures = 4096,
  100. HardBindForSubMesh = 8192
  101. }