Просмотр исходного кода

example of light configuration

Raanan Weber 7 лет назад
Родитель
Сommit
df0f0eebea
2 измененных файлов с 9 добавлено и 2 удалено
  1. 7 0
      Viewer/dist/domExample.html
  2. 2 2
      Viewer/src/viewer/defaultViewer.ts

+ 7 - 0
Viewer/dist/domExample.html

@@ -24,6 +24,13 @@
                     <behavior type="0"></behavior>
                 </behaviors>
             </camera>
+            <lights array="true">
+                <light type="1" shadow-enabled="true" position.y="0.5" direction.y="-1" intensity="4.5">
+                    <shadow-config use-blur-exponential-shadow-map="true" use-kernel-blur="true" blur-kernel="64" blur-scale="4">
+
+                    </shadow-config>
+                </light>
+            </lights>
         </babylon>
         <script src="viewer.js"></script>
     </body>

+ 2 - 2
Viewer/src/viewer/defaultViewer.ts

@@ -160,9 +160,9 @@ export class DefaultViewer extends AbstractViewer {
         if (this.configuration.ground) {
             let groundConfig = (typeof this.configuration.ground === 'boolean') ? {} : this.configuration.ground;
 
-            var ground = Mesh.CreateGround('ground', groundConfig.size || 100, groundConfig.size || 100, 8, this.scene);
+            var ground = Mesh.CreateGround('ground', groundConfig.size || 1000, groundConfig.size || 1000, 8, this.scene);
             if (this.configuration.ground === true || groundConfig.shadowOnly) {
-                ground.material = new BABYLON.ShadowOnlyMaterial('groundmat', this.scene);
+                ground.material = new ShadowOnlyMaterial('groundmat', this.scene);
             } else {
                 ground.material = new StandardMaterial('groundmat', this.scene);
             }