materialStencilState.d.ts 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. import type { IStencilState } from "../States/IStencilState";
  2. import type { Scene } from "../scene";
  3. /**
  4. * Class that holds the different stencil states of a material
  5. * Usage example: https://playground.babylonjs.com/#CW5PRI#10
  6. */
  7. export declare class MaterialStencilState implements IStencilState {
  8. /**
  9. * Creates a material stencil state instance
  10. */
  11. constructor();
  12. /**
  13. * Resets all the stencil states to default values
  14. */
  15. reset(): void;
  16. private _func;
  17. /**
  18. * Gets or sets the stencil function
  19. */
  20. get func(): number;
  21. set func(value: number);
  22. private _funcRef;
  23. /**
  24. * Gets or sets the stencil function reference
  25. */
  26. get funcRef(): number;
  27. set funcRef(value: number);
  28. private _funcMask;
  29. /**
  30. * Gets or sets the stencil function mask
  31. */
  32. get funcMask(): number;
  33. set funcMask(value: number);
  34. private _opStencilFail;
  35. /**
  36. * Gets or sets the operation when the stencil test fails
  37. */
  38. get opStencilFail(): number;
  39. set opStencilFail(value: number);
  40. private _opDepthFail;
  41. /**
  42. * Gets or sets the operation when the depth test fails
  43. */
  44. get opDepthFail(): number;
  45. set opDepthFail(value: number);
  46. private _opStencilDepthPass;
  47. /**
  48. * Gets or sets the operation when the stencil+depth test succeeds
  49. */
  50. get opStencilDepthPass(): number;
  51. set opStencilDepthPass(value: number);
  52. private _mask;
  53. /**
  54. * Gets or sets the stencil mask
  55. */
  56. get mask(): number;
  57. set mask(value: number);
  58. private _enabled;
  59. /**
  60. * Enables or disables the stencil test
  61. */
  62. get enabled(): boolean;
  63. set enabled(value: boolean);
  64. /**
  65. * Get the current class name, useful for serialization or dynamic coding.
  66. * @returns "MaterialStencilState"
  67. */
  68. getClassName(): string;
  69. /**
  70. * Makes a duplicate of the current configuration into another one.
  71. * @param stencilState defines stencil state where to copy the info
  72. */
  73. copyTo(stencilState: MaterialStencilState): void;
  74. /**
  75. * Serializes this stencil configuration.
  76. * @returns - An object with the serialized config.
  77. */
  78. serialize(): any;
  79. /**
  80. * Parses a stencil state configuration from a serialized object.
  81. * @param source - Serialized object.
  82. * @param scene Defines the scene we are parsing for
  83. * @param rootUrl Defines the rootUrl to load from
  84. */
  85. parse(source: any, scene: Scene, rootUrl: string): void;
  86. }