refractionTexture.d.ts 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import type { Scene } from "../../scene";
  2. import { Plane } from "../../Maths/math.plane";
  3. import { RenderTargetTexture } from "../../Materials/Textures/renderTargetTexture";
  4. /**
  5. * Creates a refraction texture used by refraction channel of the standard material.
  6. * It is like a mirror but to see through a material.
  7. * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/reflectionTexture#refractiontexture
  8. */
  9. export declare class RefractionTexture extends RenderTargetTexture {
  10. /**
  11. * Define the reflection plane we want to use. The refractionPlane is usually set to the constructed refractor.
  12. * It is possible to directly set the refractionPlane by directly using a Plane(a, b, c, d) where a, b and c give the plane normal vector (a, b, c) and d is a scalar displacement from the refractionPlane to the origin. However in all but the very simplest of situations it is more straight forward to set it to the refractor as stated in the doc.
  13. * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/reflectionTexture#refraction
  14. */
  15. refractionPlane: Plane;
  16. /**
  17. * Define how deep under the surface we should see.
  18. */
  19. depth: number;
  20. /**
  21. * Creates a refraction texture used by refraction channel of the standard material.
  22. * It is like a mirror but to see through a material.
  23. * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/reflectionTexture#refraction
  24. * @param name Define the texture name
  25. * @param size Define the size of the underlying texture
  26. * @param scene Define the scene the refraction belongs to
  27. * @param generateMipMaps Define if we need to generate mips level for the refraction
  28. */
  29. constructor(name: string, size: number, scene?: Scene, generateMipMaps?: boolean);
  30. /**
  31. * Clone the refraction texture.
  32. * @returns the cloned texture
  33. */
  34. clone(): RefractionTexture;
  35. /**
  36. * Serialize the texture to a JSON representation you could use in Parse later on
  37. * @returns the serialized JSON representation
  38. */
  39. serialize(): any;
  40. }