lmesh改为冯氏材质。

This commit is contained in:
liteng 2018-09-22 15:17:45 +08:00
parent 51fd012fe5
commit b697aba674
2 changed files with 2 additions and 32 deletions

View File

@ -64,36 +64,7 @@ function Model(options) {
self.texture = null;
self.geometry = new THREE.BufferGeometry();
self.material = new THREE.RawShaderMaterial({
uniforms: {
uAmbientColor: {
value: new THREE.Vector4().fromArray(self.ambientColor)
},
uPrimaryColor: {
value: new THREE.Vector4().fromArray(self.primaryColor)
},
uSecondaryColor: {
value: new THREE.Vector4().fromArray(self.secondaryColor)
},
uLightDir1: {
value: new THREE.Vector3().fromArray(self.lightDir1)
},
uLightDir2: {
value: new THREE.Vector3().fromArray(self.lightDir2)
},
uLightDir3: {
value: new THREE.Vector3().fromArray(self.lightDir3)
},
uHasTexture: {
value: 0
},
uTexture: {
value: null
}
},
vertexShader: vertShader,
fragmentShader: fragShader,
});
self.material = new THREE.MeshPhongMaterial();
var promise1 = new Promise(resolve => {
self.dispatch.on('loadMesh.Model', () => {

View File

@ -21,8 +21,7 @@ Texture.prototype.load = function () {
Texture.prototype.onLoad = function (texture) {
var self = this;
texture.flipY = false;
self.model.material.uniforms.uHasTexture.value = 1;
self.model.material.uniforms.uTexture.value = texture;
self.model.material.map = texture;
self.model.material.needsUpdate = true;
self.model.dispatch.call('loadTexture');