effectFallbacks.d.ts 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import type { IEffectFallbacks } from "./iEffectFallbacks";
  2. import type { Effect } from "./effect";
  3. import type { AbstractMesh } from "../Meshes/abstractMesh";
  4. /**
  5. * EffectFallbacks can be used to add fallbacks (properties to disable) to certain properties when desired to improve performance.
  6. * (Eg. Start at high quality with reflection and fog, if fps is low, remove reflection, if still low remove fog)
  7. */
  8. export declare class EffectFallbacks implements IEffectFallbacks {
  9. private _defines;
  10. private _currentRank;
  11. private _maxRank;
  12. private _mesh;
  13. /**
  14. * Removes the fallback from the bound mesh.
  15. */
  16. unBindMesh(): void;
  17. /**
  18. * Adds a fallback on the specified property.
  19. * @param rank The rank of the fallback (Lower ranks will be fallbacked to first)
  20. * @param define The name of the define in the shader
  21. */
  22. addFallback(rank: number, define: string): void;
  23. /**
  24. * Sets the mesh to use CPU skinning when needing to fallback.
  25. * @param rank The rank of the fallback (Lower ranks will be fallbacked to first)
  26. * @param mesh The mesh to use the fallbacks.
  27. */
  28. addCPUSkinningFallback(rank: number, mesh: AbstractMesh): void;
  29. /**
  30. * Checks to see if more fallbacks are still available.
  31. */
  32. get hasMoreFallbacks(): boolean;
  33. /**
  34. * Removes the defines that should be removed when falling back.
  35. * @param currentDefines defines the current define statements for the shader.
  36. * @param effect defines the current effect we try to compile
  37. * @returns The resulting defines with defines of the current rank removed.
  38. */
  39. reduce(currentDefines: string, effect: Effect): string;
  40. }