occlusionMaterial.js 686 B

1234567891011121314151617181920
  1. import { Color4 } from "../../Maths/math.color.js";
  2. import { ShaderMaterial } from "../shaderMaterial.js";
  3. import "../../Shaders/color.fragment.js";
  4. import "../../Shaders/color.vertex.js";
  5. /**
  6. * A material to use for fast depth-only rendering.
  7. * @since 5.0.0
  8. */
  9. export class OcclusionMaterial extends ShaderMaterial {
  10. constructor(name, scene) {
  11. super(name, scene, "color", {
  12. attributes: ["position"],
  13. uniforms: ["world", "viewProjection", "color"],
  14. });
  15. this.disableColorWrite = true;
  16. this.forceDepthWrite = true;
  17. this.setColor4("color", new Color4(0, 0, 0, 1));
  18. }
  19. }
  20. //# sourceMappingURL=occlusionMaterial.js.map