diff --git a/src/GraphicsSystem/Viewer.ts b/src/GraphicsSystem/Viewer.ts index b103b2fb2..a8f0f8fe6 100644 --- a/src/GraphicsSystem/Viewer.ts +++ b/src/GraphicsSystem/Viewer.ts @@ -43,6 +43,8 @@ export class Viewer //相机类 m_Camera: Camera; + m_bUsePass = true; + m_RenderType: RenderType = RenderType.Wireframe; //场景 引用自数据库 @@ -210,12 +212,11 @@ export class Viewer // this.m_Render.gammaOutput = true; // this.m_Render.shadowMap.enabled = true; // this.m_Render.toneMapping = THREE.ReinhardToneMapping; - this.m_Render.setPixelRatio(window.devicePixelRatio); - this.m_Render.physicallyCorrectLights = true; - this.m_Render.toneMappingExposure = Math.pow(1, 5.0); // to allow for very bright scenes. - //设置设备像素比。 这通常用于HiDPI设备,以防止模糊输出画布。 this.m_Render.setPixelRatio(window.devicePixelRatio); + //this.m_Render.physicallyCorrectLights = true; + //this.m_Render.toneMappingExposure = Math.pow(1, 5.0); // to allow for very bright scenes. + //设置它的背景色为黑色 this.m_Render.setClearColor(0x000000, 1); @@ -245,8 +246,15 @@ export class Viewer { this.m_Render.clear(); this.m_bNeedUpdate = false; - // this.m_Render.render(this.m_Scene, this.m_Camera.m_CurCamera); - this.m_Composer.render(); + + if (this.m_bUsePass) + { + this.m_Composer.render(); + } + else + { + this.m_Render.render(this.m_Scene, this.m_Camera.m_CurCamera); + } // this.m_Render.render(this.m_GripScence, this.m_Camera.m_CurCamera); }