babylon.gridMaterial.d.ts 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. declare module BABYLON {
  2. /**
  3. * The grid materials allows you to wrap any shape with a grid.
  4. * Colors are customizable.
  5. */
  6. class GridMaterial extends BABYLON.PushMaterial {
  7. /**
  8. * Main color of the grid (e.g. between lines)
  9. */
  10. mainColor: Color3;
  11. /**
  12. * Color of the grid lines.
  13. */
  14. lineColor: Color3;
  15. /**
  16. * The scale of the grid compared to unit.
  17. */
  18. gridRatio: number;
  19. /**
  20. * Allows setting an offset for the grid lines.
  21. */
  22. gridOffset: Vector3;
  23. /**
  24. * The frequency of thicker lines.
  25. */
  26. majorUnitFrequency: number;
  27. /**
  28. * The visibility of minor units in the grid.
  29. */
  30. minorUnitVisibility: number;
  31. /**
  32. * The grid opacity outside of the lines.
  33. */
  34. opacity: number;
  35. /**
  36. * Determine RBG output is premultiplied by alpha value.
  37. */
  38. preMultiplyAlpha: boolean;
  39. private _opacityTexture;
  40. opacityTexture: BaseTexture;
  41. private _gridControl;
  42. private _renderId;
  43. /**
  44. * constructor
  45. * @param name The name given to the material in order to identify it afterwards.
  46. * @param scene The scene the material is used in.
  47. */
  48. constructor(name: string, scene: Scene);
  49. /**
  50. * Returns wehter or not the grid requires alpha blending.
  51. */
  52. needAlphaBlending(): boolean;
  53. needAlphaBlendingForMesh(mesh: AbstractMesh): boolean;
  54. isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
  55. bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
  56. dispose(forceDisposeEffect?: boolean): void;
  57. clone(name: string): GridMaterial;
  58. serialize(): any;
  59. getClassName(): string;
  60. static Parse(source: any, scene: Scene, rootUrl: string): GridMaterial;
  61. }
  62. }