MeshToonMaterial.js 793 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import { MeshPhongMaterial } from './MeshPhongMaterial.js';
  2. /**
  3. * @author takahirox / http://github.com/takahirox
  4. *
  5. * parameters = {
  6. * gradientMap: new THREE.Texture( <Image> )
  7. * }
  8. */
  9. function MeshToonMaterial( parameters ) {
  10. MeshPhongMaterial.call( this );
  11. this.defines = { 'TOON': '' };
  12. this.type = 'MeshToonMaterial';
  13. this.gradientMap = null;
  14. this.setValues( parameters );
  15. }
  16. MeshToonMaterial.prototype = Object.create( MeshPhongMaterial.prototype );
  17. MeshToonMaterial.prototype.constructor = MeshToonMaterial;
  18. MeshToonMaterial.prototype.isMeshToonMaterial = true;
  19. MeshToonMaterial.prototype.copy = function ( source ) {
  20. MeshPhongMaterial.prototype.copy.call( this, source );
  21. this.gradientMap = source.gradientMap;
  22. return this;
  23. };
  24. export { MeshToonMaterial };