MeshLambertMaterial.js 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. /**
  2. * @author mrdoob / http://mrdoob.com/
  3. * @author alteredq / http://alteredqualia.com/
  4. *
  5. * parameters = {
  6. * color: <hex>,
  7. * opacity: <float>,
  8. *
  9. * map: new THREE.Texture( <Image> ),
  10. *
  11. * lightMap: new THREE.Texture( <Image> ),
  12. * lightMapIntensity: <float>
  13. *
  14. * aoMap: new THREE.Texture( <Image> ),
  15. * aoMapIntensity: <float>
  16. *
  17. * emissive: <hex>,
  18. * emissiveIntensity: <float>
  19. * emissiveMap: new THREE.Texture( <Image> ),
  20. *
  21. * specularMap: new THREE.Texture( <Image> ),
  22. *
  23. * alphaMap: new THREE.Texture( <Image> ),
  24. *
  25. * envMap: new THREE.TextureCube( [posx, negx, posy, negy, posz, negz] ),
  26. * combine: THREE.Multiply,
  27. * reflectivity: <float>,
  28. * refractionRatio: <float>,
  29. *
  30. * blending: THREE.PremultipliedAlphaNormalBlending,
  31. * depthTest: <bool>,
  32. * depthWrite: <bool>,
  33. *
  34. * wireframe: <boolean>,
  35. * wireframeLinewidth: <float>,
  36. *
  37. * vertexColors: THREE.NoColors / THREE.VertexColors / THREE.FaceColors,
  38. *
  39. * skinning: <bool>,
  40. * morphTargets: <bool>,
  41. * morphNormals: <bool>,
  42. *
  43. * fog: <bool>
  44. * }
  45. */
  46. THREE.MeshLambertMaterial = function ( parameters ) {
  47. THREE.Material.call( this );
  48. this.type = 'MeshLambertMaterial';
  49. this.color = new THREE.Color( 0xffffff ); // diffuse
  50. this.map = null;
  51. this.lightMap = null;
  52. this.lightMapIntensity = 1.0;
  53. this.aoMap = null;
  54. this.aoMapIntensity = 1.0;
  55. this.emissive = new THREE.Color( 0x000000 );
  56. this.emissiveIntensity = 1.0;
  57. this.emissiveMap = null;
  58. this.specularMap = null;
  59. this.alphaMap = null;
  60. this.envMap = null;
  61. this.combine = THREE.MultiplyOperation;
  62. this.reflectivity = 1;
  63. this.refractionRatio = 0.98;
  64. this.fog = true;
  65. this.blending = THREE.PremultipliedAlphaNormalBlending;
  66. this.wireframe = false;
  67. this.wireframeLinewidth = 1;
  68. this.wireframeLinecap = 'round';
  69. this.wireframeLinejoin = 'round';
  70. this.vertexColors = THREE.NoColors;
  71. this.skinning = false;
  72. this.morphTargets = false;
  73. this.morphNormals = false;
  74. this.setValues( parameters );
  75. };
  76. THREE.MeshLambertMaterial.prototype = Object.create( THREE.Material.prototype );
  77. THREE.MeshLambertMaterial.prototype.constructor = THREE.MeshLambertMaterial;
  78. THREE.MeshLambertMaterial.prototype.copy = function ( source ) {
  79. THREE.Material.prototype.copy.call( this, source );
  80. this.color.copy( source.color );
  81. this.map = source.map;
  82. this.lightMap = source.lightMap;
  83. this.lightMapIntensity = source.lightMapIntensity;
  84. this.aoMap = source.aoMap;
  85. this.aoMapIntensity = source.aoMapIntensity;
  86. this.emissive.copy( source.emissive );
  87. this.emissiveMap = source.emissiveMap;
  88. this.emissiveIntensity = source.emissiveIntensity;
  89. this.specularMap = source.specularMap;
  90. this.alphaMap = source.alphaMap;
  91. this.envMap = source.envMap;
  92. this.combine = source.combine;
  93. this.reflectivity = source.reflectivity;
  94. this.refractionRatio = source.refractionRatio;
  95. this.fog = source.fog;
  96. this.wireframe = source.wireframe;
  97. this.wireframeLinewidth = source.wireframeLinewidth;
  98. this.wireframeLinecap = source.wireframeLinecap;
  99. this.wireframeLinejoin = source.wireframeLinejoin;
  100. this.vertexColors = source.vertexColors;
  101. this.skinning = source.skinning;
  102. this.morphTargets = source.morphTargets;
  103. this.morphNormals = source.morphNormals;
  104. return this;
  105. };
粤ICP备19079148号