mirror of
https://github.com/tengge1/ShadowEditor.git
synced 2026-01-25 15:08:11 +00:00
lmesh改为冯氏材质。
This commit is contained in:
parent
51fd012fe5
commit
b697aba674
@ -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', () => {
|
||||
|
||||
@ -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');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user