渲染顺序问题,暂时去除GIS背景。

This commit is contained in:
tengge1 2019-04-05 08:37:32 +08:00
parent 5357bd21cd
commit 4d755f251b
2 changed files with 17 additions and 11 deletions

View File

@ -13,14 +13,15 @@ Scene.prototype.start = function () {
var editor = this.app.editor;
this.oldBackground = editor.scene.background;
editor.scene.background = new THREE.CubeTextureLoader().load([
'assets/textures/MilkyWay/dark-s_px.jpg',
'assets/textures/MilkyWay/dark-s_nx.jpg',
'assets/textures/MilkyWay/dark-s_py.jpg',
'assets/textures/MilkyWay/dark-s_ny.jpg',
'assets/textures/MilkyWay/dark-s_pz.jpg',
'assets/textures/MilkyWay/dark-s_nz.jpg',
]);
editor.scene.background = null;
// editor.scene.background = new THREE.CubeTextureLoader().load([
// 'assets/textures/MilkyWay/dark-s_px.jpg',
// 'assets/textures/MilkyWay/dark-s_nx.jpg',
// 'assets/textures/MilkyWay/dark-s_py.jpg',
// 'assets/textures/MilkyWay/dark-s_ny.jpg',
// 'assets/textures/MilkyWay/dark-s_pz.jpg',
// 'assets/textures/MilkyWay/dark-s_nz.jpg',
// ]);
editor.sceneHelpers.visible = false
editor.controls.enabled = false;
@ -31,7 +32,8 @@ Scene.prototype.start = function () {
this.globe = new Globe(editor.camera, editor.renderer);
editor.scene.add(this.globe);
this.app.on(`afterRender.${this.id}`, this.update.bind(this));
this.oldSceneBeforeRender = editor.scene.onBeforeRender;
editor.scene.onBeforeRender = this.update.bind(this);
};
Scene.prototype.update = function () {
@ -45,8 +47,12 @@ Scene.prototype.stop = function () {
var editor = this.app.editor;
editor.scene.onBeforeRender = this.oldSceneBeforeRender;
delete this.oldSceneBeforeRender;
editor.background = this.oldBackground;
delete this.oldBackground;
// delete this.oldBackground;
editor.sceneHelpers.visible = true;
editor.controls = new THREE.EditorControls(editor.camera, editor.renderer.domElement);

View File

@ -163,7 +163,7 @@ TiledLayerRenderer.prototype.renderMesh = function () {
gl.cullFace(gl.BACK);
gl.frontFace(gl.CW);
gl.enable(gl.DEPTH_TEST);
gl.disable(gl.DEPTH_TEST);
// gl.depthFunc(gl.LEQUAL);
gl.uniformMatrix4fv(this.uniforms.modelMatrix, false, this.mesh.matrix.elements);