Raanan Weber 7 年之前
父節點
當前提交
55b957cd5f
共有 2 個文件被更改,包括 4 次插入21 次删除
  1. 1 17
      Viewer/src/viewer/sceneManager.ts
  2. 3 4
      Viewer/src/viewer/viewer.ts

+ 1 - 17
Viewer/src/viewer/sceneManager.ts

@@ -312,7 +312,6 @@ export class SceneManager {
         // create a new scene
         this.scene = new Scene(this._viewer.engine);
 
-        // TODO - is this needed, now that Babylon is integrated? 
         // set a default PBR material
         if (!sceneConfiguration.defaultMaterial) {
             var defaultMaterial = new BABYLON.PBRMaterial('defaultMaterial', this.scene);
@@ -935,29 +934,15 @@ export class SceneManager {
 
         let groundConfig = (typeof groundConfiguration === 'boolean') ? {} : groundConfiguration;
         if (this.environmentHelper.groundMaterial && groundConfig && groundConfig.material) {
-            //if (!this.environmentHelper.groundMaterial._perceptualColor) {
-
             this.environmentHelper.groundMaterial._perceptualColor = this.mainColor;
-            //}
-            //this.environmentHelper.groundMaterial._perceptualColor.copyFrom(this.mainColor);
-            // to be configured using the configuration object
-
-            /*this.environmentHelper.groundMaterial.primaryColorHighlightLevel = groundConfig.material.highlightLevel;
-            this.environmentHelper.groundMaterial.primaryColorShadowLevel = groundConfig.material.shadowLevel;
-            this.environmentHelper.groundMaterial.enableNoise = true;
-            if (this.environmentHelper.groundMaterial.diffuseTexture) {
-                this.environmentHelper.groundMaterial.diffuseTexture.gammaSpace = true;
-            }
-            this.environmentHelper.groundMaterial.useRGBColor = false;
-            this.environmentHelper.groundMaterial.maxSimultaneousLights = 1;*/
             extendClassWithConfig(this.environmentHelper.groundMaterial, groundConfig.material);
 
             if (this.environmentHelper.groundMirror) {
                 const mirrorClearColor = this.environmentHelper.groundMaterial._perceptualColor.toLinearSpace();
+                // TODO user camera exposure value to set the mirror clear color
                 //let exposure = Math.pow(2.0, -this.configuration.camera.exposure) * Math.PI;
                 //mirrorClearColor.scaleToRef(1 / exposure, mirrorClearColor);
 
-                // TODO use highlight if required
                 this.environmentHelper.groundMirror.clearColor.r = Scalar.Clamp(mirrorClearColor.r);
                 this.environmentHelper.groundMirror.clearColor.g = Scalar.Clamp(mirrorClearColor.g);
                 this.environmentHelper.groundMirror.clearColor.b = Scalar.Clamp(mirrorClearColor.b);
@@ -1106,7 +1091,6 @@ export class SceneManager {
 
                     if (!shadowGenerator) {
                         shadowGenerator = new ShadowGenerator(bufferSize, light);
-                        // TODO blur kernel definition ?
                     }
 
                     var blurKernel = this.getBlurKernel(light, bufferSize);

+ 3 - 4
Viewer/src/viewer/viewer.ts

@@ -164,7 +164,7 @@ export abstract class AbstractViewer {
         // add this viewer to the viewer manager
         viewerManager.addViewer(this);
 
-        // create a new template manager. TODO - singleton?
+        // create a new template manager for this viewer
         this.templateManager = new TemplateManager(containerElement);
         this.sceneManager = new SceneManager(this);
 
@@ -179,8 +179,8 @@ export abstract class AbstractViewer {
             if (this._configuration.observers) {
                 this._configureObservers(this._configuration.observers);
             }
+            // TODO remove this after testing, as this is done in the updateCOnfiguration as well.
             if (this._configuration.loaderPlugins) {
-                // TODO should plugins be removed?
                 Object.keys(this._configuration.loaderPlugins).forEach((name => {
                     if (this._configuration.loaderPlugins && this._configuration.loaderPlugins[name]) {
                         this.modelLoader.addPlugin(name);
@@ -299,7 +299,7 @@ export abstract class AbstractViewer {
             } else {
                 this.engine.performanceMonitor.disable();
 
-                // TODO - is this needed?
+                // update camera instead of rendering
                 this.sceneManager.scene.activeCamera && this.sceneManager.scene.activeCamera.update();
             }
         }
@@ -352,7 +352,6 @@ export abstract class AbstractViewer {
         }
 
         if (newConfiguration.loaderPlugins) {
-            // TODO should plugins be removed?
             Object.keys(newConfiguration.loaderPlugins).forEach((name => {
                 if (newConfiguration.loaderPlugins && newConfiguration.loaderPlugins[name]) {
                     this.modelLoader.addPlugin(name);