Procházet zdrojové kódy

introducing the extendedDefault configuration
including light and scene configuration

Raanan Weber před 7 roky
rodič
revize
bb48cbceb1

+ 3 - 0
Viewer/src/configuration/configuration.ts

@@ -341,6 +341,9 @@ export interface ILightConfiguration {
     spotAngle?: number;
     spotAngle?: number;
     shadowFieldOfView?: number;
     shadowFieldOfView?: number;
     shadowBufferSize?: number;
     shadowBufferSize?: number;
+    shadowFrustumSize?: number;
+    shadowMinZ?: number;
+    shadowMaxZ?: number;
     [propName: string]: any;
     [propName: string]: any;
 
 
     // no behaviors for light at the moment, but allowing configuration for future reference.
     // no behaviors for light at the moment, but allowing configuration for future reference.

+ 0 - 15
Viewer/src/configuration/types/default.ts

@@ -69,21 +69,6 @@ export let defaultConfiguration: ViewerConfiguration = {
             }
             }
         }
         }
     },
     },
-    /*lights: {
-        "default": {
-            type: 1,
-            shadowEnabled: true,
-            direction: { x: -0.2, y: -0.8, z: 0 },
-            position: { x: 10, y: 10, z: 0 },
-            intensity: 4.5,
-            shadowConfig: {
-                useBlurExponentialShadowMap: true,
-                useKernelBlur: true,
-                blurKernel: 64,
-                blurScale: 4
-            }
-        }
-    },*/
     skybox: {
     skybox: {
         /*cubeTexture: {
         /*cubeTexture: {
             url: 'https://playground.babylonjs.com/textures/environment.dds',
             url: 'https://playground.babylonjs.com/textures/environment.dds',

+ 31 - 0
Viewer/src/configuration/types/extendedDefault.ts

@@ -0,0 +1,31 @@
+import { ViewerConfiguration } from './../configuration';
+
+export let extendedDefaultConfiguration: ViewerConfiguration = {
+    version: "3.2.0-alpha4",
+    extends: "default",
+
+    lights: {
+        "light1": {
+            type: 0,
+            shadowEnabled: true,
+            target: { x: -0.07100000337231904, y: -0.7150000339606777, z: -1.0 },
+            position: { x: -0.78, y: 1.298, z: 1.62 },
+            diffuse: { r: 1.0, g: 1.0, b: 1.0 },
+            intensity: 6,
+            intensityMode: 0,
+            radius: 0.135,
+            spotAngle: 59.9967,
+            shadowConfig: {
+                useBlurExponentialShadowMap: true,
+                useKernelBlur: true,
+                blurKernel: 64,
+                blurScale: 4,
+            },
+            shadowBufferSize: 512,
+            shadowFieldOfView: 60.977,
+            shadowFrustumSize: 2.0,
+            shadowMinZ: 1.0,
+            shadowMaxZ: 10.0
+        }
+    }
+}

+ 4 - 0
Viewer/src/configuration/types/index.ts

@@ -1,5 +1,6 @@
 import { minimalConfiguration } from './minimal';
 import { minimalConfiguration } from './minimal';
 import { defaultConfiguration } from './default';
 import { defaultConfiguration } from './default';
+import { extendedDefaultConfiguration } from './extendedDefault';
 import { ViewerConfiguration } from '../configuration';
 import { ViewerConfiguration } from '../configuration';
 import * as deepmerge from '../../../assets/deepmerge.min.js';
 import * as deepmerge from '../../../assets/deepmerge.min.js';
 
 
@@ -9,6 +10,9 @@ let getConfigurationType = function (type: string): ViewerConfiguration {
         case 'default':
         case 'default':
             config = defaultConfiguration;
             config = defaultConfiguration;
             break;
             break;
+        case 'extendedDefault':
+            config = extendedDefaultConfiguration;
+            break;
         case 'minimal':
         case 'minimal':
             config = minimalConfiguration;
             config = minimalConfiguration;
             break;
             break;