ShadowNodeMaterial.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. import NodeMaterial from './NodeMaterial.js';
  2. import ShadowMaskModel from '../../nodes/functions/ShadowMaskModel.js';
  3. import { ShadowMaterial } from '../ShadowMaterial.js';
  4. const _defaultValues = /*@__PURE__*/ new ShadowMaterial();
  5. /**
  6. * Node material version of `ShadowMaterial`.
  7. *
  8. * @augments NodeMaterial
  9. */
  10. class ShadowNodeMaterial extends NodeMaterial {
  11. static get type() {
  12. return 'ShadowNodeMaterial';
  13. }
  14. /**
  15. * Constructs a new shadow node material.
  16. *
  17. * @param {?Object} parameters - The configuration parameter.
  18. */
  19. constructor( parameters ) {
  20. super();
  21. /**
  22. * This flag can be used for type testing.
  23. *
  24. * @type {boolean}
  25. * @readonly
  26. * @default true
  27. */
  28. this.isShadowNodeMaterial = true;
  29. /**
  30. * Set to `true` because so it's possible to implement
  31. * the shadow mask effect.
  32. *
  33. * @type {boolean}
  34. * @default true
  35. */
  36. this.lights = true;
  37. this.setDefaultValues( _defaultValues );
  38. this.setValues( parameters );
  39. }
  40. /**
  41. * Setups the lighting model.
  42. *
  43. * @return {ShadowMaskModel} The lighting model.
  44. */
  45. setupLightingModel( /*builder*/ ) {
  46. return new ShadowMaskModel();
  47. }
  48. }
  49. export default ShadowNodeMaterial;
粤ICP备19079148号