清理代码 添加usePass选项.

pull/7/head
ChenX 7 years ago
parent d6da2d1b0d
commit 340be443f1

@ -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);
}

Loading…
Cancel
Save