@combeenation/3d-viewer 5.1.2 → 5.2.0-alpha4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +111 -111
- package/dist/lib-cjs/api/classes/animationInterface.d.ts +8 -8
- package/dist/lib-cjs/api/classes/animationInterface.js +2 -1
- package/dist/lib-cjs/api/classes/dottedPath.d.ts +79 -79
- package/dist/lib-cjs/api/classes/dottedPath.js +166 -187
- package/dist/lib-cjs/api/classes/dottedPath.js.map +1 -1
- package/dist/lib-cjs/api/classes/element.d.ts +149 -149
- package/dist/lib-cjs/api/classes/element.js +668 -823
- package/dist/lib-cjs/api/classes/element.js.map +1 -1
- package/dist/lib-cjs/api/classes/event.d.ts +326 -326
- package/dist/lib-cjs/api/classes/event.js +349 -371
- package/dist/lib-cjs/api/classes/event.js.map +1 -1
- package/dist/lib-cjs/api/classes/eventBroadcaster.d.ts +26 -26
- package/dist/lib-cjs/api/classes/eventBroadcaster.js +49 -53
- package/dist/lib-cjs/api/classes/eventBroadcaster.js.map +1 -1
- package/dist/lib-cjs/api/classes/parameter.d.ts +336 -336
- package/dist/lib-cjs/api/classes/parameter.js +461 -471
- package/dist/lib-cjs/api/classes/parameter.js.map +1 -1
- package/dist/lib-cjs/api/classes/parameterObservable.d.ts +36 -36
- package/dist/lib-cjs/api/classes/parameterObservable.js +97 -101
- package/dist/lib-cjs/api/classes/parameterObservable.js.map +1 -1
- package/dist/lib-cjs/api/classes/parameterizable.d.ts +15 -15
- package/dist/lib-cjs/api/classes/parameterizable.js +102 -149
- package/dist/lib-cjs/api/classes/parameterizable.js.map +1 -1
- package/dist/lib-cjs/api/classes/placementAnimation.d.ts +45 -44
- package/dist/lib-cjs/api/classes/placementAnimation.js +175 -163
- package/dist/lib-cjs/api/classes/placementAnimation.js.map +1 -1
- package/dist/lib-cjs/api/classes/variant.d.ts +234 -234
- package/dist/lib-cjs/api/classes/variant.js +836 -1203
- package/dist/lib-cjs/api/classes/variant.js.map +1 -1
- package/dist/lib-cjs/api/classes/variantInstance.d.ts +45 -45
- package/dist/lib-cjs/api/classes/variantInstance.js +101 -108
- package/dist/lib-cjs/api/classes/variantInstance.js.map +1 -1
- package/dist/lib-cjs/api/classes/variantParameterizable.d.ts +17 -17
- package/dist/lib-cjs/api/classes/variantParameterizable.js +88 -99
- package/dist/lib-cjs/api/classes/variantParameterizable.js.map +1 -1
- package/dist/lib-cjs/api/classes/viewer.d.ts +187 -184
- package/dist/lib-cjs/api/classes/viewer.js +593 -731
- package/dist/lib-cjs/api/classes/viewer.js.map +1 -1
- package/dist/lib-cjs/api/classes/viewerLight.d.ts +66 -66
- package/dist/lib-cjs/api/classes/viewerLight.js +343 -392
- package/dist/lib-cjs/api/classes/viewerLight.js.map +1 -1
- package/dist/lib-cjs/api/internal/lensRendering.d.ts +8 -8
- package/dist/lib-cjs/api/internal/lensRendering.js +11 -11
- package/dist/lib-cjs/api/internal/lensRendering.js.map +1 -1
- package/dist/lib-cjs/api/internal/sceneSetup.d.ts +13 -13
- package/dist/lib-cjs/api/internal/sceneSetup.js +225 -238
- package/dist/lib-cjs/api/internal/sceneSetup.js.map +1 -1
- package/dist/lib-cjs/api/manager/animationManager.d.ts +30 -29
- package/dist/lib-cjs/api/manager/animationManager.js +126 -130
- package/dist/lib-cjs/api/manager/animationManager.js.map +1 -1
- package/dist/lib-cjs/api/manager/gltfExportManager.d.ts +65 -65
- package/dist/lib-cjs/api/manager/gltfExportManager.js +196 -223
- package/dist/lib-cjs/api/manager/gltfExportManager.js.map +1 -1
- package/dist/lib-cjs/api/manager/sceneManager.d.ts +31 -31
- package/dist/lib-cjs/api/manager/sceneManager.js +127 -152
- package/dist/lib-cjs/api/manager/sceneManager.js.map +1 -1
- package/dist/lib-cjs/api/manager/variantInstanceManager.d.ts +92 -92
- package/dist/lib-cjs/api/manager/variantInstanceManager.js +260 -335
- package/dist/lib-cjs/api/manager/variantInstanceManager.js.map +1 -1
- package/dist/lib-cjs/api/store/specStorage.d.ts +24 -24
- package/dist/lib-cjs/api/store/specStorage.js +50 -51
- package/dist/lib-cjs/api/store/specStorage.js.map +1 -1
- package/dist/lib-cjs/api/util/babylonHelper.d.ts +174 -174
- package/dist/lib-cjs/api/util/babylonHelper.js +591 -611
- package/dist/lib-cjs/api/util/babylonHelper.js.map +1 -1
- package/dist/lib-cjs/api/util/globalTypes.d.ts +366 -366
- package/dist/lib-cjs/api/util/globalTypes.js +1 -1
- package/dist/lib-cjs/api/util/resourceHelper.d.ts +58 -58
- package/dist/lib-cjs/api/util/resourceHelper.js +201 -257
- package/dist/lib-cjs/api/util/resourceHelper.js.map +1 -1
- package/dist/lib-cjs/api/util/sceneLoaderHelper.d.ts +35 -35
- package/dist/lib-cjs/api/util/sceneLoaderHelper.js +141 -140
- package/dist/lib-cjs/api/util/sceneLoaderHelper.js.map +1 -1
- package/dist/lib-cjs/api/util/stringHelper.d.ts +9 -9
- package/dist/lib-cjs/api/util/stringHelper.js +23 -25
- package/dist/lib-cjs/api/util/stringHelper.js.map +1 -1
- package/dist/lib-cjs/api/util/structureHelper.d.ts +9 -9
- package/dist/lib-cjs/api/util/structureHelper.js +48 -48
- package/dist/lib-cjs/api/util/structureHelper.js.map +1 -1
- package/dist/lib-cjs/buildinfo.json +3 -3
- package/dist/lib-cjs/index.d.ts +51 -49
- package/dist/lib-cjs/index.js +110 -89
- package/dist/lib-cjs/index.js.map +1 -1
- package/dist/lib-es6/api/classes/animationInterface.d.ts +8 -8
- package/dist/lib-es6/api/classes/animationInterface.js +1 -1
- package/dist/lib-es6/api/classes/dottedPath.d.ts +79 -79
- package/dist/lib-es6/api/classes/dottedPath.js +162 -184
- package/dist/lib-es6/api/classes/dottedPath.js.map +1 -1
- package/dist/lib-es6/api/classes/element.d.ts +149 -149
- package/dist/lib-es6/api/classes/element.js +664 -820
- package/dist/lib-es6/api/classes/element.js.map +1 -1
- package/dist/lib-es6/api/classes/event.d.ts +326 -326
- package/dist/lib-es6/api/classes/event.js +345 -368
- package/dist/lib-es6/api/classes/event.js.map +1 -1
- package/dist/lib-es6/api/classes/eventBroadcaster.d.ts +26 -26
- package/dist/lib-es6/api/classes/eventBroadcaster.js +42 -50
- package/dist/lib-es6/api/classes/eventBroadcaster.js.map +1 -1
- package/dist/lib-es6/api/classes/parameter.d.ts +336 -336
- package/dist/lib-es6/api/classes/parameter.js +457 -468
- package/dist/lib-es6/api/classes/parameter.js.map +1 -1
- package/dist/lib-es6/api/classes/parameterObservable.d.ts +36 -36
- package/dist/lib-es6/api/classes/parameterObservable.js +93 -98
- package/dist/lib-es6/api/classes/parameterObservable.js.map +1 -1
- package/dist/lib-es6/api/classes/parameterizable.d.ts +15 -15
- package/dist/lib-es6/api/classes/parameterizable.js +98 -146
- package/dist/lib-es6/api/classes/parameterizable.js.map +1 -1
- package/dist/lib-es6/api/classes/placementAnimation.d.ts +45 -44
- package/dist/lib-es6/api/classes/placementAnimation.js +171 -160
- package/dist/lib-es6/api/classes/placementAnimation.js.map +1 -1
- package/dist/lib-es6/api/classes/variant.d.ts +234 -234
- package/dist/lib-es6/api/classes/variant.js +832 -1198
- package/dist/lib-es6/api/classes/variant.js.map +1 -1
- package/dist/lib-es6/api/classes/variantInstance.d.ts +45 -45
- package/dist/lib-es6/api/classes/variantInstance.js +97 -105
- package/dist/lib-es6/api/classes/variantInstance.js.map +1 -1
- package/dist/lib-es6/api/classes/variantParameterizable.d.ts +17 -17
- package/dist/lib-es6/api/classes/variantParameterizable.js +84 -96
- package/dist/lib-es6/api/classes/variantParameterizable.js.map +1 -1
- package/dist/lib-es6/api/classes/viewer.d.ts +187 -184
- package/dist/lib-es6/api/classes/viewer.js +586 -728
- package/dist/lib-es6/api/classes/viewer.js.map +1 -1
- package/dist/lib-es6/api/classes/viewerLight.d.ts +66 -66
- package/dist/lib-es6/api/classes/viewerLight.js +316 -389
- package/dist/lib-es6/api/classes/viewerLight.js.map +1 -1
- package/dist/lib-es6/api/internal/lensRendering.d.ts +8 -8
- package/dist/lib-es6/api/internal/lensRendering.js +8 -8
- package/dist/lib-es6/api/internal/lensRendering.js.map +1 -1
- package/dist/lib-es6/api/internal/sceneSetup.d.ts +13 -13
- package/dist/lib-es6/api/internal/sceneSetup.js +197 -233
- package/dist/lib-es6/api/internal/sceneSetup.js.map +1 -1
- package/dist/lib-es6/api/manager/animationManager.d.ts +30 -29
- package/dist/lib-es6/api/manager/animationManager.js +122 -127
- package/dist/lib-es6/api/manager/animationManager.js.map +1 -1
- package/dist/lib-es6/api/manager/gltfExportManager.d.ts +65 -65
- package/dist/lib-es6/api/manager/gltfExportManager.js +192 -220
- package/dist/lib-es6/api/manager/gltfExportManager.js.map +1 -1
- package/dist/lib-es6/api/manager/sceneManager.d.ts +31 -31
- package/dist/lib-es6/api/manager/sceneManager.js +123 -149
- package/dist/lib-es6/api/manager/sceneManager.js.map +1 -1
- package/dist/lib-es6/api/manager/variantInstanceManager.d.ts +92 -92
- package/dist/lib-es6/api/manager/variantInstanceManager.js +256 -332
- package/dist/lib-es6/api/manager/variantInstanceManager.js.map +1 -1
- package/dist/lib-es6/api/store/specStorage.d.ts +24 -24
- package/dist/lib-es6/api/store/specStorage.js +46 -48
- package/dist/lib-es6/api/store/specStorage.js.map +1 -1
- package/dist/lib-es6/api/util/babylonHelper.d.ts +174 -174
- package/dist/lib-es6/api/util/babylonHelper.js +561 -581
- package/dist/lib-es6/api/util/babylonHelper.js.map +1 -1
- package/dist/lib-es6/api/util/globalTypes.d.ts +366 -366
- package/dist/lib-es6/api/util/globalTypes.js +1 -1
- package/dist/lib-es6/api/util/resourceHelper.d.ts +58 -58
- package/dist/lib-es6/api/util/resourceHelper.js +191 -247
- package/dist/lib-es6/api/util/resourceHelper.js.map +1 -1
- package/dist/lib-es6/api/util/sceneLoaderHelper.d.ts +35 -35
- package/dist/lib-es6/api/util/sceneLoaderHelper.js +131 -133
- package/dist/lib-es6/api/util/sceneLoaderHelper.js.map +1 -1
- package/dist/lib-es6/api/util/stringHelper.d.ts +9 -9
- package/dist/lib-es6/api/util/stringHelper.js +19 -21
- package/dist/lib-es6/api/util/stringHelper.js.map +1 -1
- package/dist/lib-es6/api/util/structureHelper.d.ts +9 -9
- package/dist/lib-es6/api/util/structureHelper.js +45 -45
- package/dist/lib-es6/api/util/structureHelper.js.map +1 -1
- package/dist/lib-es6/buildinfo.json +3 -3
- package/dist/lib-es6/index.d.ts +51 -49
- package/dist/lib-es6/index.js +48 -50
- package/dist/lib-es6/index.js.map +1 -1
- package/dist/lib-full/lens-rendering.js +2 -0
- package/dist/lib-full/lens-rendering.js.map +1 -0
- package/dist/lib-full/main.js +3 -0
- package/dist/lib-full/main.js.LICENSE.txt +9 -0
- package/dist/lib-full/main.js.map +1 -0
- package/package.json +76 -88
- package/src/api/classes/animationInterface.ts +10 -10
- package/src/api/classes/dottedPath.ts +181 -181
- package/src/api/classes/element.ts +716 -716
- package/src/api/classes/event.ts +367 -367
- package/src/api/classes/eventBroadcaster.ts +52 -52
- package/src/api/classes/parameter.ts +494 -494
- package/src/api/classes/parameterObservable.ts +100 -100
- package/src/api/classes/parameterizable.ts +87 -87
- package/src/api/classes/placementAnimation.ts +161 -160
- package/src/api/classes/variant.ts +904 -905
- package/src/api/classes/variantInstance.ts +97 -97
- package/src/api/classes/variantParameterizable.ts +85 -85
- package/src/api/classes/viewer.ts +669 -668
- package/src/api/classes/viewerLight.ts +334 -334
- package/src/api/internal/debugViewer.ts +90 -90
- package/src/api/internal/lensRendering.ts +9 -10
- package/src/api/internal/sceneSetup.ts +204 -204
- package/src/api/manager/animationManager.ts +143 -142
- package/src/api/manager/gltfExportManager.ts +191 -191
- package/src/api/manager/sceneManager.ts +127 -127
- package/src/api/manager/variantInstanceManager.ts +265 -265
- package/src/api/store/specStorage.ts +51 -51
- package/src/api/util/babylonHelper.ts +663 -663
- package/src/api/util/globalTypes.ts +413 -413
- package/src/api/util/resourceHelper.ts +189 -189
- package/src/api/util/sceneLoaderHelper.ts +148 -147
- package/src/api/util/stringHelper.ts +23 -23
- package/src/api/util/structureHelper.ts +49 -49
- package/src/buildinfo.json +3 -3
- package/src/dev.ts +61 -64
- package/src/index.ts +96 -94
- package/src/types.d.ts +28 -28
- package/dist/lib-cjs/api/classes/elementParameterizable.d.ts +0 -14
- package/dist/lib-cjs/api/classes/elementParameterizable.js +0 -135
- package/dist/lib-cjs/api/classes/elementParameterizable.js.map +0 -1
- package/dist/lib-cjs/api/internal/debugViewer.d.ts +0 -13
- package/dist/lib-cjs/api/internal/debugViewer.js +0 -87
- package/dist/lib-cjs/api/internal/debugViewer.js.map +0 -1
- package/dist/lib-es6/api/internal/debugViewer.d.ts +0 -13
- package/dist/lib-es6/api/internal/debugViewer.js +0 -84
- package/dist/lib-es6/api/internal/debugViewer.js.map +0 -1
- package/dist/webpack-stats.json +0 -0
- package/src/commonjs.tsconfig.json +0 -10
- package/src/declaration.tsconfig.json +0 -8
- package/src/es6.tsconfig.json +0 -10
- package/src/pagesconfig.json +0 -81
- package/src/tsconfig.json +0 -33
- package/src/tsconfig.types.json +0 -9
package/dist/lib-es6/index.d.ts
CHANGED
|
@@ -1,49 +1,51 @@
|
|
|
1
|
-
/// <reference path="api/util/globalTypes.d.ts" />
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
import '@babylonjs/core/
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
import
|
|
45
|
-
import
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
1
|
+
/// <reference path="api/util/globalTypes.d.ts" />
|
|
2
|
+
/// <reference path="../../src/types.d.ts" />
|
|
3
|
+
import { AnimationInterface } from './api/classes/animationInterface';
|
|
4
|
+
import { Element } from './api/classes/element';
|
|
5
|
+
import { Event, emitter } from './api/classes/event';
|
|
6
|
+
import { EventBroadcaster } from './api/classes/eventBroadcaster';
|
|
7
|
+
import { Parameter } from './api/classes/parameter';
|
|
8
|
+
import { ParameterObservable } from './api/classes/parameterObservable';
|
|
9
|
+
import { Parameterizable } from './api/classes/parameterizable';
|
|
10
|
+
import { PlacementAnimation } from './api/classes/placementAnimation';
|
|
11
|
+
import { Variant } from './api/classes/variant';
|
|
12
|
+
import { VariantInstance } from './api/classes/variantInstance';
|
|
13
|
+
import { VariantParameterizable } from './api/classes/variantParameterizable';
|
|
14
|
+
import { Viewer } from './api/classes/viewer';
|
|
15
|
+
import { ViewerLight } from './api/classes/viewerLight';
|
|
16
|
+
import { AnimationManager } from './api/manager/animationManager';
|
|
17
|
+
import { GltfExportManager } from './api/manager/gltfExportManager';
|
|
18
|
+
import { SceneManager } from './api/manager/sceneManager';
|
|
19
|
+
import { VariantInstanceManager } from './api/manager/variantInstanceManager';
|
|
20
|
+
import * as BabylonHelper from './api/util/babylonHelper';
|
|
21
|
+
import { Animation as BabylonAnimation } from '@babylonjs/core/Animations/animation';
|
|
22
|
+
import { ArcRotateCamera } from '@babylonjs/core/Cameras/arcRotateCamera';
|
|
23
|
+
import { Engine } from '@babylonjs/core/Engines/engine';
|
|
24
|
+
import { DirectionalLight } from '@babylonjs/core/Lights/directionalLight';
|
|
25
|
+
import { HemisphericLight } from '@babylonjs/core/Lights/hemisphericLight';
|
|
26
|
+
import { PBRMaterial } from '@babylonjs/core/Materials/PBR/pbrMaterial';
|
|
27
|
+
import { CubeTexture } from '@babylonjs/core/Materials/Textures/cubeTexture';
|
|
28
|
+
import { DynamicTexture } from '@babylonjs/core/Materials/Textures/dynamicTexture';
|
|
29
|
+
import { Texture } from '@babylonjs/core/Materials/Textures/texture';
|
|
30
|
+
import { Material } from '@babylonjs/core/Materials/material';
|
|
31
|
+
import { StandardMaterial } from '@babylonjs/core/Materials/standardMaterial';
|
|
32
|
+
import { Color3, Color4 } from '@babylonjs/core/Maths/math.color';
|
|
33
|
+
import { Vector3 } from '@babylonjs/core/Maths/math.vector';
|
|
34
|
+
import { AbstractMesh } from '@babylonjs/core/Meshes/abstractMesh';
|
|
35
|
+
import { InstancedMesh } from '@babylonjs/core/Meshes/instancedMesh';
|
|
36
|
+
import { Mesh } from '@babylonjs/core/Meshes/mesh';
|
|
37
|
+
import { MeshBuilder } from '@babylonjs/core/Meshes/meshBuilder';
|
|
38
|
+
import { TransformNode } from '@babylonjs/core/Meshes/transformNode';
|
|
39
|
+
/**
|
|
40
|
+
* Without explicitly importing the "BoundingBoxRenderer", we're getting "scene.getBoundingBoxRenderer is undefined"
|
|
41
|
+
* errors when creating HighlightLayer instances. Not sure why but those errors only happen when using the built
|
|
42
|
+
* version of the viewer (e.g. when pulling it from NPM etc.)...
|
|
43
|
+
*/
|
|
44
|
+
import '@babylonjs/core/Rendering/boundingBoxRenderer';
|
|
45
|
+
import { Node } from '@babylonjs/core/node';
|
|
46
|
+
import { Scene } from '@babylonjs/core/scene';
|
|
47
|
+
import { EventEmitter } from 'eventemitter3';
|
|
48
|
+
/**
|
|
49
|
+
* Expose some frequently used babylon modules by our consumers.
|
|
50
|
+
*/
|
|
51
|
+
export { AnimationManager, AnimationInterface, Variant, VariantInstanceManager, Viewer, ParameterObservable, Parameterizable, VariantParameterizable, ViewerLight, emitter as Emitter, EventEmitter, Event, Parameter, VariantInstance, Color3, Color4, Vector3, AbstractMesh, InstancedMesh, Mesh, TransformNode, Node, Material, PBRMaterial, StandardMaterial, Scene, Engine, ArcRotateCamera, DynamicTexture, CubeTexture, MeshBuilder, Texture, BabylonAnimation, HemisphericLight, DirectionalLight, Element, EventBroadcaster, SceneManager, PlacementAnimation, BabylonHelper, GltfExportManager, };
|
package/dist/lib-es6/index.js
CHANGED
|
@@ -1,51 +1,49 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
import '@babylonjs/core/
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
import
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
*/
|
|
50
|
-
export { AnimationManager, Variant, VariantInstanceManager, Viewer, ParameterObservable, Parameterizable, VariantParameterizable, ViewerLight, emitter as Emitter, EventEmitter, Event, Parameter, VariantInstance, Color3, Color4, Vector3, AbstractMesh, InstancedMesh, Mesh, TransformNode, Node, Material, PBRMaterial, StandardMaterial, Scene, Engine, ArcRotateCamera, DynamicTexture, CubeTexture, MeshBuilder, Texture, BabylonAnimation, HemisphericLight, DirectionalLight, Element, EventBroadcaster, SceneManager, PlacementAnimation, BabylonHelper, GltfExportManager, };
|
|
1
|
+
import { Element } from './api/classes/element';
|
|
2
|
+
import { Event, emitter } from './api/classes/event';
|
|
3
|
+
import { EventBroadcaster } from './api/classes/eventBroadcaster';
|
|
4
|
+
import { Parameter } from './api/classes/parameter';
|
|
5
|
+
import { ParameterObservable } from './api/classes/parameterObservable';
|
|
6
|
+
import { Parameterizable } from './api/classes/parameterizable';
|
|
7
|
+
import { PlacementAnimation } from './api/classes/placementAnimation';
|
|
8
|
+
import { Variant } from './api/classes/variant';
|
|
9
|
+
import { VariantInstance } from './api/classes/variantInstance';
|
|
10
|
+
import { VariantParameterizable } from './api/classes/variantParameterizable';
|
|
11
|
+
import { Viewer } from './api/classes/viewer';
|
|
12
|
+
import { ViewerLight } from './api/classes/viewerLight';
|
|
13
|
+
import { AnimationManager } from './api/manager/animationManager';
|
|
14
|
+
import { GltfExportManager } from './api/manager/gltfExportManager';
|
|
15
|
+
import { SceneManager } from './api/manager/sceneManager';
|
|
16
|
+
import { VariantInstanceManager } from './api/manager/variantInstanceManager';
|
|
17
|
+
import * as BabylonHelper from './api/util/babylonHelper';
|
|
18
|
+
import { Animation as BabylonAnimation } from '@babylonjs/core/Animations/animation';
|
|
19
|
+
import { ArcRotateCamera } from '@babylonjs/core/Cameras/arcRotateCamera';
|
|
20
|
+
import { Engine } from '@babylonjs/core/Engines/engine';
|
|
21
|
+
import { DirectionalLight } from '@babylonjs/core/Lights/directionalLight';
|
|
22
|
+
import { HemisphericLight } from '@babylonjs/core/Lights/hemisphericLight';
|
|
23
|
+
import { PBRMaterial } from '@babylonjs/core/Materials/PBR/pbrMaterial';
|
|
24
|
+
import { CubeTexture } from '@babylonjs/core/Materials/Textures/cubeTexture';
|
|
25
|
+
import { DynamicTexture } from '@babylonjs/core/Materials/Textures/dynamicTexture';
|
|
26
|
+
import { Texture } from '@babylonjs/core/Materials/Textures/texture';
|
|
27
|
+
import { Material } from '@babylonjs/core/Materials/material';
|
|
28
|
+
import { StandardMaterial } from '@babylonjs/core/Materials/standardMaterial';
|
|
29
|
+
import { Color3, Color4 } from '@babylonjs/core/Maths/math.color';
|
|
30
|
+
import { Vector3 } from '@babylonjs/core/Maths/math.vector';
|
|
31
|
+
import { AbstractMesh } from '@babylonjs/core/Meshes/abstractMesh';
|
|
32
|
+
import { InstancedMesh } from '@babylonjs/core/Meshes/instancedMesh';
|
|
33
|
+
import { Mesh } from '@babylonjs/core/Meshes/mesh';
|
|
34
|
+
import { MeshBuilder } from '@babylonjs/core/Meshes/meshBuilder';
|
|
35
|
+
import { TransformNode } from '@babylonjs/core/Meshes/transformNode';
|
|
36
|
+
/**
|
|
37
|
+
* Without explicitly importing the "BoundingBoxRenderer", we're getting "scene.getBoundingBoxRenderer is undefined"
|
|
38
|
+
* errors when creating HighlightLayer instances. Not sure why but those errors only happen when using the built
|
|
39
|
+
* version of the viewer (e.g. when pulling it from NPM etc.)...
|
|
40
|
+
*/
|
|
41
|
+
import '@babylonjs/core/Rendering/boundingBoxRenderer';
|
|
42
|
+
import { Node } from '@babylonjs/core/node';
|
|
43
|
+
import { Scene } from '@babylonjs/core/scene';
|
|
44
|
+
import { EventEmitter } from 'eventemitter3';
|
|
45
|
+
/**
|
|
46
|
+
* Expose some frequently used babylon modules by our consumers.
|
|
47
|
+
*/
|
|
48
|
+
export { AnimationManager, Variant, VariantInstanceManager, Viewer, ParameterObservable, Parameterizable, VariantParameterizable, ViewerLight, emitter as Emitter, EventEmitter, Event, Parameter, VariantInstance, Color3, Color4, Vector3, AbstractMesh, InstancedMesh, Mesh, TransformNode, Node, Material, PBRMaterial, StandardMaterial, Scene, Engine, ArcRotateCamera, DynamicTexture, CubeTexture, MeshBuilder, Texture, BabylonAnimation, HemisphericLight, DirectionalLight, Element, EventBroadcaster, SceneManager, PlacementAnimation, BabylonHelper, GltfExportManager, };
|
|
51
49
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkcombeenation=self.webpackChunkcombeenation||[]).push([[288],{3862:(e,t,r)=>{r.r(t),r.d(t,{LensRenderingPipeline:()=>g});var i=r(5187),h=r(554),n=r(7334),o=r(1817),l=r(547),s=(r(6425),r(63),r(1206));const a="uniform sampler2D textureSampler; \nuniform float gain;\nuniform float threshold;\nuniform float screen_width;\nuniform float screen_height;\nvarying vec2 vUV;\nvec4 highlightColor(vec4 color) {\nvec4 highlight=color;\nfloat luminance=dot(highlight.rgb,vec3(0.2125,0.7154,0.0721));\nfloat lum_threshold;\nif (threshold>1.0) { lum_threshold=0.94+0.01*threshold; }\nelse { lum_threshold=0.5+0.44*threshold; }\nluminance=clamp((luminance-lum_threshold)*(1.0/(1.0-lum_threshold)),0.0,1.0);\nhighlight*=luminance*gain;\nhighlight.a=1.0;\nreturn highlight;\n}\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void)\n{\nvec4 original=texture2D(textureSampler,vUV);\nif (gain==-1.0) {\ngl_FragColor=vec4(0.0,0.0,0.0,1.0);\nreturn;\n}\nfloat w=2.0/screen_width;\nfloat h=2.0/screen_height;\nfloat weight=1.0;\nvec4 blurred=vec4(0.0,0.0,0.0,0.0);\n#ifdef PENTAGON\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.84*w,0.43*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.48*w,-1.29*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.61*w,1.51*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.55*w,-0.74*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.71*w,-0.52*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.94*w,1.59*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.40*w,-1.87*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.62*w,1.16*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.09*w,0.25*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.46*w,-1.71*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.08*w,2.42*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.85*w,-1.89*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.89*w,0.16*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.29*w,1.88*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.40*w,-2.81*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.54*w,2.26*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.60*w,-0.61*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.31*w,-1.30*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.83*w,2.53*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.12*w,-2.48*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.60*w,1.11*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.82*w,0.99*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.50*w,-2.81*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.85*w,3.33*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.94*w,-1.92*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.27*w,-0.53*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.95*w,2.48*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.23*w,-3.04*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.17*w,2.05*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.97*w,-0.04*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.25*w,-2.00*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.31*w,3.08*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.94*w,-2.59*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.37*w,0.64*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-3.13*w,1.93*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.03*w,-3.65*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.60*w,3.17*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-3.14*w,-1.19*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.00*w,-1.19*h)));\n#else\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.85*w,0.36*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.52*w,-1.14*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.46*w,1.42*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.46*w,-0.83*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.79*w,-0.42*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.11*w,1.62*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.29*w,-2.07*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.69*w,1.39*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.28*w,0.12*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.65*w,-1.69*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.08*w,2.44*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.63*w,-1.90*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.55*w,0.31*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.13*w,1.52*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.56*w,-2.61*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.38*w,2.34*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.64*w,-0.81*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.53*w,-1.21*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.06*w,2.63*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.00*w,-2.69*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.59*w,1.32*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.82*w,0.78*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.57*w,-2.50*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.54*w,2.93*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.39*w,-1.81*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.01*w,-0.28*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.04*w,2.25*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.02*w,-3.05*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.09*w,2.25*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-3.07*w,-0.25*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.44*w,-1.90*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.52*w,3.05*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.68*w,-2.61*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.01*w,0.79*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.76*w,1.46*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.05*w,-2.94*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.21*w,2.88*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.84*w,-1.30*h)));\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.98*w,-0.96*h)));\n#endif\nblurred/=39.0;\ngl_FragColor=blurred;\n}";s.v.ShadersStore.lensHighlightsPixelShader=a;const c="uniform sampler2D textureSampler;\nuniform sampler2D highlightsSampler;\nuniform sampler2D depthSampler;\nuniform sampler2D grainSampler;\nuniform float grain_amount;\nuniform bool blur_noise;\nuniform float screen_width;\nuniform float screen_height;\nuniform float distortion;\nuniform bool dof_enabled;\nuniform float screen_distance; \nuniform float aperture;\nuniform float darken;\nuniform float edge_blur;\nuniform bool highlights;\nuniform float near;\nuniform float far;\nvarying vec2 vUV;\n#define PI 3.14159265\n#define TWOPI 6.28318530\n#define inverse_focal_length 0.1 \nvec2 centered_screen_pos;\nvec2 distorted_coords;\nfloat radius2;\nfloat radius;\nvec2 rand(vec2 co)\n{\nfloat noise1=(fract(sin(dot(co,vec2(12.9898,78.233)))*43758.5453));\nfloat noise2=(fract(sin(dot(co,vec2(12.9898,78.233)*2.0))*43758.5453));\nreturn clamp(vec2(noise1,noise2),0.0,1.0);\n}\nvec2 getDistortedCoords(vec2 coords) {\nif (distortion==0.0) { return coords; }\nvec2 direction=1.0*normalize(centered_screen_pos);\nvec2 dist_coords=vec2(0.5,0.5);\ndist_coords.x=0.5+direction.x*radius2*1.0;\ndist_coords.y=0.5+direction.y*radius2*1.0;\nfloat dist_amount=clamp(distortion*0.23,0.0,1.0);\ndist_coords=mix(coords,dist_coords,dist_amount);\nreturn dist_coords;\n}\nfloat sampleScreen(inout vec4 color,in vec2 offset,in float weight) {\nvec2 coords=distorted_coords;\nfloat angle=rand(coords*100.0).x*TWOPI;\ncoords+=vec2(offset.x*cos(angle)-offset.y*sin(angle),offset.x*sin(angle)+offset.y*cos(angle));\ncolor+=texture2D(textureSampler,coords)*weight;\nreturn weight;\n}\nfloat getBlurLevel(float size) {\nreturn min(3.0,ceil(size/1.0));\n}\nvec4 getBlurColor(float size) {\nvec4 col=texture2D(textureSampler,distorted_coords);\nfloat blur_level=getBlurLevel(size);\nfloat w=(size/screen_width);\nfloat h=(size/screen_height);\nfloat total_weight=1.0;\nvec2 sample_coords;\ntotal_weight+=sampleScreen(col,vec2(-0.50*w,0.24*h),0.93);\ntotal_weight+=sampleScreen(col,vec2(0.30*w,-0.75*h),0.90);\ntotal_weight+=sampleScreen(col,vec2(0.36*w,0.96*h),0.87);\ntotal_weight+=sampleScreen(col,vec2(-1.08*w,-0.55*h),0.85);\ntotal_weight+=sampleScreen(col,vec2(1.33*w,-0.37*h),0.83);\ntotal_weight+=sampleScreen(col,vec2(-0.82*w,1.31*h),0.80);\ntotal_weight+=sampleScreen(col,vec2(-0.31*w,-1.67*h),0.78);\ntotal_weight+=sampleScreen(col,vec2(1.47*w,1.11*h),0.76);\ntotal_weight+=sampleScreen(col,vec2(-1.97*w,0.19*h),0.74);\ntotal_weight+=sampleScreen(col,vec2(1.42*w,-1.57*h),0.72);\nif (blur_level>1.0) {\ntotal_weight+=sampleScreen(col,vec2(0.01*w,2.25*h),0.70);\ntotal_weight+=sampleScreen(col,vec2(-1.62*w,-1.74*h),0.67);\ntotal_weight+=sampleScreen(col,vec2(2.49*w,0.20*h),0.65);\ntotal_weight+=sampleScreen(col,vec2(-2.07*w,1.61*h),0.63);\ntotal_weight+=sampleScreen(col,vec2(0.46*w,-2.70*h),0.61);\ntotal_weight+=sampleScreen(col,vec2(1.55*w,2.40*h),0.59);\ntotal_weight+=sampleScreen(col,vec2(-2.88*w,-0.75*h),0.56);\ntotal_weight+=sampleScreen(col,vec2(2.73*w,-1.44*h),0.54);\ntotal_weight+=sampleScreen(col,vec2(-1.08*w,3.02*h),0.52);\ntotal_weight+=sampleScreen(col,vec2(-1.28*w,-3.05*h),0.49);\n}\nif (blur_level>2.0) {\ntotal_weight+=sampleScreen(col,vec2(3.11*w,1.43*h),0.46);\ntotal_weight+=sampleScreen(col,vec2(-3.36*w,1.08*h),0.44);\ntotal_weight+=sampleScreen(col,vec2(1.80*w,-3.16*h),0.41);\ntotal_weight+=sampleScreen(col,vec2(0.83*w,3.65*h),0.38);\ntotal_weight+=sampleScreen(col,vec2(-3.16*w,-2.19*h),0.34);\ntotal_weight+=sampleScreen(col,vec2(3.92*w,-0.53*h),0.31);\ntotal_weight+=sampleScreen(col,vec2(-2.59*w,3.12*h),0.26);\ntotal_weight+=sampleScreen(col,vec2(-0.20*w,-4.15*h),0.22);\ntotal_weight+=sampleScreen(col,vec2(3.02*w,3.00*h),0.15);\n}\ncol/=total_weight; \nif (darken>0.0) {\ncol.rgb*=clamp(0.3,1.0,1.05-size*0.5*darken);\n}\nreturn col;\n}\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void)\n{\ncentered_screen_pos=vec2(vUV.x-0.5,vUV.y-0.5);\nradius2=centered_screen_pos.x*centered_screen_pos.x+centered_screen_pos.y*centered_screen_pos.y;\nradius=sqrt(radius2);\ndistorted_coords=getDistortedCoords(vUV); \nvec2 texels_coords=vec2(vUV.x*screen_width,vUV.y*screen_height); \nfloat depth=texture2D(depthSampler,distorted_coords).r; \nfloat distance=near+(far-near)*depth; \nvec4 color=texture2D(textureSampler,vUV); \nfloat coc=abs(aperture*(screen_distance*(inverse_focal_length-1.0/distance)-1.0));\nif (dof_enabled==false || coc<0.07) { coc=0.0; }\nfloat edge_blur_amount=0.0;\nif (edge_blur>0.0) {\nedge_blur_amount=clamp((radius*2.0-1.0+0.15*edge_blur)*1.5,0.0,1.0)*1.3;\n}\nfloat blur_amount=max(edge_blur_amount,coc);\nif (blur_amount==0.0) {\ngl_FragColor=texture2D(textureSampler,distorted_coords);\n}\nelse {\ngl_FragColor=getBlurColor(blur_amount*1.7);\nif (highlights) {\ngl_FragColor.rgb+=clamp(coc,0.0,1.0)*texture2D(highlightsSampler,distorted_coords).rgb;\n}\nif (blur_noise) {\nvec2 noise=rand(distorted_coords)*0.01*blur_amount;\nvec2 blurred_coord=vec2(distorted_coords.x+noise.x,distorted_coords.y+noise.y);\ngl_FragColor=0.04*texture2D(textureSampler,blurred_coord)+0.96*gl_FragColor;\n}\n}\nif (grain_amount>0.0) {\nvec4 grain_color=texture2D(grainSampler,texels_coords*0.003);\ngl_FragColor.rgb+=(-0.5+grain_color.rgb)*0.30*grain_amount;\n}\n}\n";s.v.ShadersStore.depthOfFieldPixelShader=c;class g extends o.${constructor(e,t,r,i=1,h){super(r.getEngine(),e),this.LensChromaticAberrationEffect="LensChromaticAberrationEffect",this.HighlightsEnhancingEffect="HighlightsEnhancingEffect",this.LensDepthOfFieldEffect="LensDepthOfFieldEffect",this._pentagonBokehIsEnabled=!1,this._scene=r,this._depthTexture=r.enableDepthRenderer().getDepthMap(),t.grain_texture?this._grainTexture=t.grain_texture:this._createGrainTexture(),this._edgeBlur=t.edge_blur?t.edge_blur:0,this._grainAmount=t.grain_amount?t.grain_amount:0,this._chromaticAberration=t.chromatic_aberration?t.chromatic_aberration:0,this._distortion=t.distortion?t.distortion:0,this._highlightsGain=void 0!==t.dof_gain?t.dof_gain:-1,this._highlightsThreshold=t.dof_threshold?t.dof_threshold:1,this._dofDistance=void 0!==t.dof_focus_distance?t.dof_focus_distance:-1,this._dofAperture=t.dof_aperture?t.dof_aperture:1,this._dofDarken=t.dof_darken?t.dof_darken:0,this._dofPentagon=void 0===t.dof_pentagon||t.dof_pentagon,this._blurNoise=void 0===t.blur_noise||t.blur_noise,this._createChromaticAberrationPostProcess(i),this._createHighlightsPostProcess(i),this._createDepthOfFieldPostProcess(i/4),this.addEffect(new l.L(r.getEngine(),this.LensChromaticAberrationEffect,(()=>this._chromaticAberrationPostProcess),!0)),this.addEffect(new l.L(r.getEngine(),this.HighlightsEnhancingEffect,(()=>this._highlightsPostProcess),!0)),this.addEffect(new l.L(r.getEngine(),this.LensDepthOfFieldEffect,(()=>this._depthOfFieldPostProcess),!0)),-1===this._highlightsGain&&this._disableEffect(this.HighlightsEnhancingEffect,null),r.postProcessRenderPipelineManager.addPipeline(this),h&&r.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(e,h)}getClassName(){return"LensRenderingPipeline"}get scene(){return this._scene}get edgeBlur(){return this._edgeBlur}set edgeBlur(e){this.setEdgeBlur(e)}get grainAmount(){return this._grainAmount}set grainAmount(e){this.setGrainAmount(e)}get chromaticAberration(){return this._chromaticAberration}set chromaticAberration(e){this.setChromaticAberration(e)}get dofAperture(){return this._dofAperture}set dofAperture(e){this.setAperture(e)}get edgeDistortion(){return this._distortion}set edgeDistortion(e){this.setEdgeDistortion(e)}get dofDistortion(){return this._dofDistance}set dofDistortion(e){this.setFocusDistance(e)}get darkenOutOfFocus(){return this._dofDarken}set darkenOutOfFocus(e){this.setDarkenOutOfFocus(e)}get blurNoise(){return this._blurNoise}set blurNoise(e){this._blurNoise=e}get pentagonBokeh(){return this._pentagonBokehIsEnabled}set pentagonBokeh(e){e?this.enablePentagonBokeh():this.disablePentagonBokeh()}get highlightsGain(){return this._highlightsGain}set highlightsGain(e){this.setHighlightsGain(e)}get highlightsThreshold(){return this._highlightsThreshold}set highlightsThreshold(e){this.setHighlightsThreshold(e)}setEdgeBlur(e){this._edgeBlur=e}disableEdgeBlur(){this._edgeBlur=0}setGrainAmount(e){this._grainAmount=e}disableGrain(){this._grainAmount=0}setChromaticAberration(e){this._chromaticAberration=e}disableChromaticAberration(){this._chromaticAberration=0}setEdgeDistortion(e){this._distortion=e}disableEdgeDistortion(){this._distortion=0}setFocusDistance(e){this._dofDistance=e}disableDepthOfField(){this._dofDistance=-1}setAperture(e){this._dofAperture=e}setDarkenOutOfFocus(e){this._dofDarken=e}enablePentagonBokeh(){this._highlightsPostProcess.updateEffect("#define PENTAGON\n"),this._pentagonBokehIsEnabled=!0}disablePentagonBokeh(){this._pentagonBokehIsEnabled=!1,this._highlightsPostProcess.updateEffect()}enableNoiseBlur(){this._blurNoise=!0}disableNoiseBlur(){this._blurNoise=!1}setHighlightsGain(e){this._highlightsGain=e}setHighlightsThreshold(e){-1===this._highlightsGain&&(this._highlightsGain=1),this._highlightsThreshold=e}disableHighlights(){this._highlightsGain=-1}dispose(e=!1){this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name,this._scene.cameras),this._chromaticAberrationPostProcess=null,this._highlightsPostProcess=null,this._depthOfFieldPostProcess=null,this._grainTexture.dispose(),e&&this._scene.disableDepthRenderer()}_createChromaticAberrationPostProcess(e){this._chromaticAberrationPostProcess=new n.D("LensChromaticAberration","chromaticAberration",["chromatic_aberration","screen_width","screen_height","direction","radialIntensity","centerPosition"],[],e,null,i.x.TRILINEAR_SAMPLINGMODE,this._scene.getEngine(),!1),this._chromaticAberrationPostProcess.onApply=e=>{e.setFloat("chromatic_aberration",this._chromaticAberration),e.setFloat("screen_width",this._scene.getEngine().getRenderWidth()),e.setFloat("screen_height",this._scene.getEngine().getRenderHeight()),e.setFloat("radialIntensity",1),e.setFloat2("direction",17,17),e.setFloat2("centerPosition",.5,.5)}}_createHighlightsPostProcess(e){this._highlightsPostProcess=new n.D("LensHighlights","lensHighlights",["gain","threshold","screen_width","screen_height"],[],e,null,i.x.TRILINEAR_SAMPLINGMODE,this._scene.getEngine(),!1,this._dofPentagon?"#define PENTAGON\n":""),this._highlightsPostProcess.externalTextureSamplerBinding=!0,this._highlightsPostProcess.onApply=e=>{e.setFloat("gain",this._highlightsGain),e.setFloat("threshold",this._highlightsThreshold),e.setTextureFromPostProcess("textureSampler",this._chromaticAberrationPostProcess),e.setFloat("screen_width",this._scene.getEngine().getRenderWidth()),e.setFloat("screen_height",this._scene.getEngine().getRenderHeight())}}_createDepthOfFieldPostProcess(e){this._depthOfFieldPostProcess=new n.D("LensDepthOfField","depthOfField",["grain_amount","blur_noise","screen_width","screen_height","distortion","dof_enabled","screen_distance","aperture","darken","edge_blur","highlights","near","far"],["depthSampler","grainSampler","highlightsSampler"],e,null,i.x.TRILINEAR_SAMPLINGMODE,this._scene.getEngine(),!1),this._depthOfFieldPostProcess.externalTextureSamplerBinding=!0,this._depthOfFieldPostProcess.onApply=e=>{e.setTexture("depthSampler",this._depthTexture),e.setTexture("grainSampler",this._grainTexture),e.setTextureFromPostProcess("textureSampler",this._highlightsPostProcess),e.setTextureFromPostProcess("highlightsSampler",this._depthOfFieldPostProcess),e.setFloat("grain_amount",this._grainAmount),e.setBool("blur_noise",this._blurNoise),e.setFloat("screen_width",this._scene.getEngine().getRenderWidth()),e.setFloat("screen_height",this._scene.getEngine().getRenderHeight()),e.setFloat("distortion",this._distortion),e.setBool("dof_enabled",-1!==this._dofDistance),e.setFloat("screen_distance",1/(.1-1/this._dofDistance)),e.setFloat("aperture",this._dofAperture),e.setFloat("darken",this._dofDarken),e.setFloat("edge_blur",this._edgeBlur),e.setBool("highlights",-1!==this._highlightsGain),this._scene.activeCamera&&(e.setFloat("near",this._scene.activeCamera.minZ),e.setFloat("far",this._scene.activeCamera.maxZ))}}_createGrainTexture(){this._grainTexture=new h.c("LensNoiseTexture",512,this._scene,!1,i.x.BILINEAR_SAMPLINGMODE),this._grainTexture.wrapU=i.x.WRAP_ADDRESSMODE,this._grainTexture.wrapV=i.x.WRAP_ADDRESSMODE;const e=this._grainTexture.getContext();let t;for(let i=0;i<512;i++)for(let h=0;h<512;h++)t=Math.floor(255*(r=.42,n=.58,Math.random()*(n-r)+r)),e.fillStyle="rgb("+t+", "+t+", "+t+")",e.fillRect(i,h,1,1);var r,n;this._grainTexture.update(!1)}}var u=r(1057),d=r(2122),_=r(4559);u.x.prototype.enableDepthRenderer=function(e,t=!1,r=!1){if(!(e=e||this.activeCamera))throw"No camera available to enable depth renderer";if(this._depthRenderer||(this._depthRenderer={}),!this._depthRenderer[e.id]){const i=!!this.getEngine().getCaps().textureFloatRender;let h=0;h=!this.getEngine().getCaps().textureHalfFloatRender||r&&i?i?1:0:2,this._depthRenderer[e.id]=new d.g(this,h,e,t)}return this._depthRenderer[e.id]},u.x.prototype.disableDepthRenderer=function(e){(e=e||this.activeCamera)&&this._depthRenderer&&this._depthRenderer[e.id]&&this._depthRenderer[e.id].dispose()};class p{constructor(e){this.name=_.l.NAME_DEPTHRENDERER,this.scene=e}register(){this.scene._gatherRenderTargetsStage.registerStep(_.l.STEP_GATHERRENDERTARGETS_DEPTHRENDERER,this,this._gatherRenderTargets),this.scene._gatherActiveCameraRenderTargetsStage.registerStep(_.l.STEP_GATHERACTIVECAMERARENDERTARGETS_DEPTHRENDERER,this,this._gatherActiveCameraRenderTargets)}rebuild(){}dispose(){for(const e in this.scene._depthRenderer)this.scene._depthRenderer[e].dispose()}_gatherRenderTargets(e){if(this.scene._depthRenderer)for(const t in this.scene._depthRenderer){const r=this.scene._depthRenderer[t];r.enabled&&!r.useOnlyInActiveCamera&&e.push(r.getDepthMap())}}_gatherActiveCameraRenderTargets(e){if(this.scene._depthRenderer)for(const t in this.scene._depthRenderer){const r=this.scene._depthRenderer[t];r.enabled&&r.useOnlyInActiveCamera&&this.scene.activeCamera.id===t&&e.push(r.getDepthMap())}}}d.g._SceneComponentInitialization=e=>{let t=e._getComponent(_.l.NAME_DEPTHRENDERER);t||(t=new p(e),e._addComponent(t))}}}]);
|
|
2
|
+
//# sourceMappingURL=lens-rendering.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lens-rendering.js","mappings":"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","sources":["webpack://combeenation/./node_modules/@babylonjs/core/Shaders/lensHighlights.fragment.js","webpack://combeenation/./node_modules/@babylonjs/core/PostProcesses/RenderPipeline/Pipelines/lensRenderingPipeline.js","webpack://combeenation/./node_modules/@babylonjs/core/Rendering/depthRendererSceneComponent.js","webpack://combeenation/./src/api/internal/lensRendering.ts"],"sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore.js\";\nconst name = \"lensHighlightsPixelShader\";\nconst shader = `uniform sampler2D textureSampler; \runiform float gain;\runiform float threshold;\runiform float screen_width;\runiform float screen_height;\rvarying vec2 vUV;\rvec4 highlightColor(vec4 color) {\rvec4 highlight=color;\rfloat luminance=dot(highlight.rgb,vec3(0.2125,0.7154,0.0721));\rfloat lum_threshold;\rif (threshold>1.0) { lum_threshold=0.94+0.01*threshold; }\relse { lum_threshold=0.5+0.44*threshold; }\rluminance=clamp((luminance-lum_threshold)*(1.0/(1.0-lum_threshold)),0.0,1.0);\rhighlight*=luminance*gain;\rhighlight.a=1.0;\rreturn highlight;\r}\r#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void)\r{\rvec4 original=texture2D(textureSampler,vUV);\rif (gain==-1.0) {\rgl_FragColor=vec4(0.0,0.0,0.0,1.0);\rreturn;\r}\rfloat w=2.0/screen_width;\rfloat h=2.0/screen_height;\rfloat weight=1.0;\rvec4 blurred=vec4(0.0,0.0,0.0,0.0);\r#ifdef PENTAGON\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.84*w,0.43*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.48*w,-1.29*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.61*w,1.51*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.55*w,-0.74*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.71*w,-0.52*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.94*w,1.59*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.40*w,-1.87*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.62*w,1.16*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.09*w,0.25*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.46*w,-1.71*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.08*w,2.42*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.85*w,-1.89*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.89*w,0.16*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.29*w,1.88*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.40*w,-2.81*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.54*w,2.26*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.60*w,-0.61*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.31*w,-1.30*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.83*w,2.53*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.12*w,-2.48*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.60*w,1.11*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.82*w,0.99*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.50*w,-2.81*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.85*w,3.33*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.94*w,-1.92*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.27*w,-0.53*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.95*w,2.48*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.23*w,-3.04*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.17*w,2.05*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.97*w,-0.04*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.25*w,-2.00*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.31*w,3.08*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.94*w,-2.59*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.37*w,0.64*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-3.13*w,1.93*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.03*w,-3.65*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.60*w,3.17*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-3.14*w,-1.19*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.00*w,-1.19*h)));\r#else\nblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.85*w,0.36*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.52*w,-1.14*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.46*w,1.42*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.46*w,-0.83*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.79*w,-0.42*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.11*w,1.62*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.29*w,-2.07*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.69*w,1.39*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.28*w,0.12*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.65*w,-1.69*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.08*w,2.44*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.63*w,-1.90*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.55*w,0.31*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.13*w,1.52*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.56*w,-2.61*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.38*w,2.34*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.64*w,-0.81*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.53*w,-1.21*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.06*w,2.63*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.00*w,-2.69*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.59*w,1.32*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.82*w,0.78*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.57*w,-2.50*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(0.54*w,2.93*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.39*w,-1.81*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.01*w,-0.28*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.04*w,2.25*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.02*w,-3.05*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.09*w,2.25*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-3.07*w,-0.25*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.44*w,-1.90*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-0.52*w,3.05*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-1.68*w,-2.61*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(3.01*w,0.79*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.76*w,1.46*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.05*w,-2.94*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(1.21*w,2.88*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(-2.84*w,-1.30*h)));\rblurred+=highlightColor(texture2D(textureSampler,vUV+vec2(2.98*w,-0.96*h)));\r#endif\nblurred/=39.0;\rgl_FragColor=blurred;\r}`;\n// Sideeffect\nShaderStore.ShadersStore[name] = shader;\n/** @internal */\nexport const lensHighlightsPixelShader = { name, shader };\n//# sourceMappingURL=lensHighlights.fragment.js.map","import { Texture } from \"../../../Materials/Textures/texture.js\";\nimport { DynamicTexture } from \"../../../Materials/Textures/dynamicTexture.js\";\nimport { PostProcess } from \"../../../PostProcesses/postProcess.js\";\nimport { PostProcessRenderPipeline } from \"../../../PostProcesses/RenderPipeline/postProcessRenderPipeline.js\";\nimport { PostProcessRenderEffect } from \"../../../PostProcesses/RenderPipeline/postProcessRenderEffect.js\";\nimport \"../../../PostProcesses/RenderPipeline/postProcessRenderPipelineManagerSceneComponent.js\";\nimport \"../../../Shaders/chromaticAberration.fragment.js\";\nimport \"../../../Shaders/lensHighlights.fragment.js\";\nimport \"../../../Shaders/depthOfField.fragment.js\";\n/**\n * BABYLON.JS Chromatic Aberration GLSL Shader\n * Author: Olivier Guyot\n * Separates very slightly R, G and B colors on the edges of the screen\n * Inspired by Francois Tarlier & Martins Upitis\n */\nexport class LensRenderingPipeline extends PostProcessRenderPipeline {\n /**\n * @constructor\n *\n * Effect parameters are as follow:\n * {\n * chromatic_aberration: number; // from 0 to x (1 for realism)\n * edge_blur: number; // from 0 to x (1 for realism)\n * distortion: number; // from 0 to x (1 for realism), note that this will effect the pointer position precision\n * grain_amount: number; // from 0 to 1\n * grain_texture: BABYLON.Texture; // texture to use for grain effect; if unset, use random B&W noise\n * dof_focus_distance: number; // depth-of-field: focus distance; unset to disable (disabled by default)\n * dof_aperture: number; // depth-of-field: focus blur bias (default: 1)\n * dof_darken: number; // depth-of-field: darken that which is out of focus (from 0 to 1, disabled by default)\n * dof_pentagon: boolean; // depth-of-field: makes a pentagon-like \"bokeh\" effect\n * dof_gain: number; // depth-of-field: highlights gain; unset to disable (disabled by default)\n * dof_threshold: number; // depth-of-field: highlights threshold (default: 1)\n * blur_noise: boolean; // add a little bit of noise to the blur (default: true)\n * }\n * Note: if an effect parameter is unset, effect is disabled\n *\n * @param name The rendering pipeline name\n * @param parameters - An object containing all parameters (see above)\n * @param scene The scene linked to this pipeline\n * @param ratio The size of the postprocesses (0.5 means that your postprocess will have a width = canvas.width 0.5 and a height = canvas.height 0.5)\n * @param cameras The array of cameras that the rendering pipeline will be attached to\n */\n constructor(name, parameters, scene, ratio = 1.0, cameras) {\n super(scene.getEngine(), name);\n // Lens effects can be of the following:\n // - chromatic aberration (slight shift of RGB colors)\n // - blur on the edge of the lens\n // - lens distortion\n // - depth-of-field blur & highlights enhancing\n // - depth-of-field 'bokeh' effect (shapes appearing in blurred areas)\n // - grain effect (noise or custom texture)\n // Two additional texture samplers are needed:\n // - depth map (for depth-of-field)\n // - grain texture\n /**\n * @ignore\n * The chromatic aberration PostProcess id in the pipeline\n */\n this.LensChromaticAberrationEffect = \"LensChromaticAberrationEffect\";\n /**\n * @ignore\n * The highlights enhancing PostProcess id in the pipeline\n */\n this.HighlightsEnhancingEffect = \"HighlightsEnhancingEffect\";\n /**\n * @ignore\n * The depth-of-field PostProcess id in the pipeline\n */\n this.LensDepthOfFieldEffect = \"LensDepthOfFieldEffect\";\n this._pentagonBokehIsEnabled = false;\n this._scene = scene;\n // Fetch texture samplers\n this._depthTexture = scene.enableDepthRenderer().getDepthMap(); // Force depth renderer \"on\"\n if (parameters.grain_texture) {\n this._grainTexture = parameters.grain_texture;\n }\n else {\n this._createGrainTexture();\n }\n // save parameters\n this._edgeBlur = parameters.edge_blur ? parameters.edge_blur : 0;\n this._grainAmount = parameters.grain_amount ? parameters.grain_amount : 0;\n this._chromaticAberration = parameters.chromatic_aberration ? parameters.chromatic_aberration : 0;\n this._distortion = parameters.distortion ? parameters.distortion : 0;\n this._highlightsGain = parameters.dof_gain !== undefined ? parameters.dof_gain : -1;\n this._highlightsThreshold = parameters.dof_threshold ? parameters.dof_threshold : 1;\n this._dofDistance = parameters.dof_focus_distance !== undefined ? parameters.dof_focus_distance : -1;\n this._dofAperture = parameters.dof_aperture ? parameters.dof_aperture : 1;\n this._dofDarken = parameters.dof_darken ? parameters.dof_darken : 0;\n this._dofPentagon = parameters.dof_pentagon !== undefined ? parameters.dof_pentagon : true;\n this._blurNoise = parameters.blur_noise !== undefined ? parameters.blur_noise : true;\n // Create effects\n this._createChromaticAberrationPostProcess(ratio);\n this._createHighlightsPostProcess(ratio);\n this._createDepthOfFieldPostProcess(ratio / 4);\n // Set up pipeline\n this.addEffect(new PostProcessRenderEffect(scene.getEngine(), this.LensChromaticAberrationEffect, () => {\n return this._chromaticAberrationPostProcess;\n }, true));\n this.addEffect(new PostProcessRenderEffect(scene.getEngine(), this.HighlightsEnhancingEffect, () => {\n return this._highlightsPostProcess;\n }, true));\n this.addEffect(new PostProcessRenderEffect(scene.getEngine(), this.LensDepthOfFieldEffect, () => {\n return this._depthOfFieldPostProcess;\n }, true));\n if (this._highlightsGain === -1) {\n this._disableEffect(this.HighlightsEnhancingEffect, null);\n }\n // Finish\n scene.postProcessRenderPipelineManager.addPipeline(this);\n if (cameras) {\n scene.postProcessRenderPipelineManager.attachCamerasToRenderPipeline(name, cameras);\n }\n }\n /**\n * Get the class name\n * @returns \"LensRenderingPipeline\"\n */\n getClassName() {\n return \"LensRenderingPipeline\";\n }\n // Properties\n /**\n * Gets associated scene\n */\n get scene() {\n return this._scene;\n }\n /**\n * Gets or sets the edge blur\n */\n get edgeBlur() {\n return this._edgeBlur;\n }\n set edgeBlur(value) {\n this.setEdgeBlur(value);\n }\n /**\n * Gets or sets the grain amount\n */\n get grainAmount() {\n return this._grainAmount;\n }\n set grainAmount(value) {\n this.setGrainAmount(value);\n }\n /**\n * Gets or sets the chromatic aberration amount\n */\n get chromaticAberration() {\n return this._chromaticAberration;\n }\n set chromaticAberration(value) {\n this.setChromaticAberration(value);\n }\n /**\n * Gets or sets the depth of field aperture\n */\n get dofAperture() {\n return this._dofAperture;\n }\n set dofAperture(value) {\n this.setAperture(value);\n }\n /**\n * Gets or sets the edge distortion\n */\n get edgeDistortion() {\n return this._distortion;\n }\n set edgeDistortion(value) {\n this.setEdgeDistortion(value);\n }\n /**\n * Gets or sets the depth of field distortion\n */\n get dofDistortion() {\n return this._dofDistance;\n }\n set dofDistortion(value) {\n this.setFocusDistance(value);\n }\n /**\n * Gets or sets the darken out of focus amount\n */\n get darkenOutOfFocus() {\n return this._dofDarken;\n }\n set darkenOutOfFocus(value) {\n this.setDarkenOutOfFocus(value);\n }\n /**\n * Gets or sets a boolean indicating if blur noise is enabled\n */\n get blurNoise() {\n return this._blurNoise;\n }\n set blurNoise(value) {\n this._blurNoise = value;\n }\n /**\n * Gets or sets a boolean indicating if pentagon bokeh is enabled\n */\n get pentagonBokeh() {\n return this._pentagonBokehIsEnabled;\n }\n set pentagonBokeh(value) {\n if (value) {\n this.enablePentagonBokeh();\n }\n else {\n this.disablePentagonBokeh();\n }\n }\n /**\n * Gets or sets the highlight grain amount\n */\n get highlightsGain() {\n return this._highlightsGain;\n }\n set highlightsGain(value) {\n this.setHighlightsGain(value);\n }\n /**\n * Gets or sets the highlight threshold\n */\n get highlightsThreshold() {\n return this._highlightsThreshold;\n }\n set highlightsThreshold(value) {\n this.setHighlightsThreshold(value);\n }\n // public methods (self explanatory)\n /**\n * Sets the amount of blur at the edges\n * @param amount blur amount\n */\n setEdgeBlur(amount) {\n this._edgeBlur = amount;\n }\n /**\n * Sets edge blur to 0\n */\n disableEdgeBlur() {\n this._edgeBlur = 0;\n }\n /**\n * Sets the amount of grain\n * @param amount Amount of grain\n */\n setGrainAmount(amount) {\n this._grainAmount = amount;\n }\n /**\n * Set grain amount to 0\n */\n disableGrain() {\n this._grainAmount = 0;\n }\n /**\n * Sets the chromatic aberration amount\n * @param amount amount of chromatic aberration\n */\n setChromaticAberration(amount) {\n this._chromaticAberration = amount;\n }\n /**\n * Sets chromatic aberration amount to 0\n */\n disableChromaticAberration() {\n this._chromaticAberration = 0;\n }\n /**\n * Sets the EdgeDistortion amount\n * @param amount amount of EdgeDistortion\n */\n setEdgeDistortion(amount) {\n this._distortion = amount;\n }\n /**\n * Sets edge distortion to 0\n */\n disableEdgeDistortion() {\n this._distortion = 0;\n }\n /**\n * Sets the FocusDistance amount\n * @param amount amount of FocusDistance\n */\n setFocusDistance(amount) {\n this._dofDistance = amount;\n }\n /**\n * Disables depth of field\n */\n disableDepthOfField() {\n this._dofDistance = -1;\n }\n /**\n * Sets the Aperture amount\n * @param amount amount of Aperture\n */\n setAperture(amount) {\n this._dofAperture = amount;\n }\n /**\n * Sets the DarkenOutOfFocus amount\n * @param amount amount of DarkenOutOfFocus\n */\n setDarkenOutOfFocus(amount) {\n this._dofDarken = amount;\n }\n /**\n * Creates a pentagon bokeh effect\n */\n enablePentagonBokeh() {\n this._highlightsPostProcess.updateEffect(\"#define PENTAGON\\n\");\n this._pentagonBokehIsEnabled = true;\n }\n /**\n * Disables the pentagon bokeh effect\n */\n disablePentagonBokeh() {\n this._pentagonBokehIsEnabled = false;\n this._highlightsPostProcess.updateEffect();\n }\n /**\n * Enables noise blur\n */\n enableNoiseBlur() {\n this._blurNoise = true;\n }\n /**\n * Disables noise blur\n */\n disableNoiseBlur() {\n this._blurNoise = false;\n }\n /**\n * Sets the HighlightsGain amount\n * @param amount amount of HighlightsGain\n */\n setHighlightsGain(amount) {\n this._highlightsGain = amount;\n }\n /**\n * Sets the HighlightsThreshold amount\n * @param amount amount of HighlightsThreshold\n */\n setHighlightsThreshold(amount) {\n if (this._highlightsGain === -1) {\n this._highlightsGain = 1.0;\n }\n this._highlightsThreshold = amount;\n }\n /**\n * Disables highlights\n */\n disableHighlights() {\n this._highlightsGain = -1;\n }\n /**\n * Removes the internal pipeline assets and detaches the pipeline from the scene cameras\n * @param disableDepthRender If the scene's depth rendering should be disabled (default: false)\n */\n dispose(disableDepthRender = false) {\n this._scene.postProcessRenderPipelineManager.detachCamerasFromRenderPipeline(this._name, this._scene.cameras);\n this._chromaticAberrationPostProcess = null;\n this._highlightsPostProcess = null;\n this._depthOfFieldPostProcess = null;\n this._grainTexture.dispose();\n if (disableDepthRender) {\n this._scene.disableDepthRenderer();\n }\n }\n // colors shifting and distortion\n _createChromaticAberrationPostProcess(ratio) {\n this._chromaticAberrationPostProcess = new PostProcess(\"LensChromaticAberration\", \"chromaticAberration\", [\"chromatic_aberration\", \"screen_width\", \"screen_height\", \"direction\", \"radialIntensity\", \"centerPosition\"], // uniforms\n [], // samplers\n ratio, null, Texture.TRILINEAR_SAMPLINGMODE, this._scene.getEngine(), false);\n this._chromaticAberrationPostProcess.onApply = (effect) => {\n effect.setFloat(\"chromatic_aberration\", this._chromaticAberration);\n effect.setFloat(\"screen_width\", this._scene.getEngine().getRenderWidth());\n effect.setFloat(\"screen_height\", this._scene.getEngine().getRenderHeight());\n effect.setFloat(\"radialIntensity\", 1);\n effect.setFloat2(\"direction\", 17, 17);\n effect.setFloat2(\"centerPosition\", 0.5, 0.5);\n };\n }\n // highlights enhancing\n _createHighlightsPostProcess(ratio) {\n this._highlightsPostProcess = new PostProcess(\"LensHighlights\", \"lensHighlights\", [\"gain\", \"threshold\", \"screen_width\", \"screen_height\"], // uniforms\n [], // samplers\n ratio, null, Texture.TRILINEAR_SAMPLINGMODE, this._scene.getEngine(), false, this._dofPentagon ? \"#define PENTAGON\\n\" : \"\");\n this._highlightsPostProcess.externalTextureSamplerBinding = true;\n this._highlightsPostProcess.onApply = (effect) => {\n effect.setFloat(\"gain\", this._highlightsGain);\n effect.setFloat(\"threshold\", this._highlightsThreshold);\n effect.setTextureFromPostProcess(\"textureSampler\", this._chromaticAberrationPostProcess);\n effect.setFloat(\"screen_width\", this._scene.getEngine().getRenderWidth());\n effect.setFloat(\"screen_height\", this._scene.getEngine().getRenderHeight());\n };\n }\n // colors shifting and distortion\n _createDepthOfFieldPostProcess(ratio) {\n this._depthOfFieldPostProcess = new PostProcess(\"LensDepthOfField\", \"depthOfField\", [\n \"grain_amount\",\n \"blur_noise\",\n \"screen_width\",\n \"screen_height\",\n \"distortion\",\n \"dof_enabled\",\n \"screen_distance\",\n \"aperture\",\n \"darken\",\n \"edge_blur\",\n \"highlights\",\n \"near\",\n \"far\",\n ], [\"depthSampler\", \"grainSampler\", \"highlightsSampler\"], ratio, null, Texture.TRILINEAR_SAMPLINGMODE, this._scene.getEngine(), false);\n this._depthOfFieldPostProcess.externalTextureSamplerBinding = true;\n this._depthOfFieldPostProcess.onApply = (effect) => {\n effect.setTexture(\"depthSampler\", this._depthTexture);\n effect.setTexture(\"grainSampler\", this._grainTexture);\n effect.setTextureFromPostProcess(\"textureSampler\", this._highlightsPostProcess);\n effect.setTextureFromPostProcess(\"highlightsSampler\", this._depthOfFieldPostProcess);\n effect.setFloat(\"grain_amount\", this._grainAmount);\n effect.setBool(\"blur_noise\", this._blurNoise);\n effect.setFloat(\"screen_width\", this._scene.getEngine().getRenderWidth());\n effect.setFloat(\"screen_height\", this._scene.getEngine().getRenderHeight());\n effect.setFloat(\"distortion\", this._distortion);\n effect.setBool(\"dof_enabled\", this._dofDistance !== -1);\n effect.setFloat(\"screen_distance\", 1.0 / (0.1 - 1.0 / this._dofDistance));\n effect.setFloat(\"aperture\", this._dofAperture);\n effect.setFloat(\"darken\", this._dofDarken);\n effect.setFloat(\"edge_blur\", this._edgeBlur);\n effect.setBool(\"highlights\", this._highlightsGain !== -1);\n if (this._scene.activeCamera) {\n effect.setFloat(\"near\", this._scene.activeCamera.minZ);\n effect.setFloat(\"far\", this._scene.activeCamera.maxZ);\n }\n };\n }\n // creates a black and white random noise texture, 512x512\n _createGrainTexture() {\n const size = 512;\n this._grainTexture = new DynamicTexture(\"LensNoiseTexture\", size, this._scene, false, Texture.BILINEAR_SAMPLINGMODE);\n this._grainTexture.wrapU = Texture.WRAP_ADDRESSMODE;\n this._grainTexture.wrapV = Texture.WRAP_ADDRESSMODE;\n const context = this._grainTexture.getContext();\n const rand = (min, max) => {\n return Math.random() * (max - min) + min;\n };\n let value;\n for (let x = 0; x < size; x++) {\n for (let y = 0; y < size; y++) {\n value = Math.floor(rand(0.42, 0.58) * 255);\n context.fillStyle = \"rgb(\" + value + \", \" + value + \", \" + value + \")\";\n context.fillRect(x, y, 1, 1);\n }\n }\n this._grainTexture.update(false);\n }\n}\n//# sourceMappingURL=lensRenderingPipeline.js.map","import { Scene } from \"../scene.js\";\nimport { DepthRenderer } from \"./depthRenderer.js\";\n\nimport { SceneComponentConstants } from \"../sceneComponent.js\";\nScene.prototype.enableDepthRenderer = function (camera, storeNonLinearDepth = false, force32bitsFloat = false) {\n camera = camera || this.activeCamera;\n if (!camera) {\n throw \"No camera available to enable depth renderer\";\n }\n if (!this._depthRenderer) {\n this._depthRenderer = {};\n }\n if (!this._depthRenderer[camera.id]) {\n const supportFullfloat = !!this.getEngine().getCaps().textureFloatRender;\n let textureType = 0;\n if (this.getEngine().getCaps().textureHalfFloatRender && (!force32bitsFloat || !supportFullfloat)) {\n textureType = 2;\n }\n else if (supportFullfloat) {\n textureType = 1;\n }\n else {\n textureType = 0;\n }\n this._depthRenderer[camera.id] = new DepthRenderer(this, textureType, camera, storeNonLinearDepth);\n }\n return this._depthRenderer[camera.id];\n};\nScene.prototype.disableDepthRenderer = function (camera) {\n camera = camera || this.activeCamera;\n if (!camera || !this._depthRenderer || !this._depthRenderer[camera.id]) {\n return;\n }\n this._depthRenderer[camera.id].dispose();\n};\n/**\n * Defines the Depth Renderer scene component responsible to manage a depth buffer useful\n * in several rendering techniques.\n */\nexport class DepthRendererSceneComponent {\n /**\n * Creates a new instance of the component for the given scene\n * @param scene Defines the scene to register the component in\n */\n constructor(scene) {\n /**\n * The component name helpful to identify the component in the list of scene components.\n */\n this.name = SceneComponentConstants.NAME_DEPTHRENDERER;\n this.scene = scene;\n }\n /**\n * Registers the component in a given scene\n */\n register() {\n this.scene._gatherRenderTargetsStage.registerStep(SceneComponentConstants.STEP_GATHERRENDERTARGETS_DEPTHRENDERER, this, this._gatherRenderTargets);\n this.scene._gatherActiveCameraRenderTargetsStage.registerStep(SceneComponentConstants.STEP_GATHERACTIVECAMERARENDERTARGETS_DEPTHRENDERER, this, this._gatherActiveCameraRenderTargets);\n }\n /**\n * Rebuilds the elements related to this component in case of\n * context lost for instance.\n */\n rebuild() {\n // Nothing to do for this component\n }\n /**\n * Disposes the component and the associated resources\n */\n dispose() {\n for (const key in this.scene._depthRenderer) {\n this.scene._depthRenderer[key].dispose();\n }\n }\n _gatherRenderTargets(renderTargets) {\n if (this.scene._depthRenderer) {\n for (const key in this.scene._depthRenderer) {\n const depthRenderer = this.scene._depthRenderer[key];\n if (depthRenderer.enabled && !depthRenderer.useOnlyInActiveCamera) {\n renderTargets.push(depthRenderer.getDepthMap());\n }\n }\n }\n }\n _gatherActiveCameraRenderTargets(renderTargets) {\n if (this.scene._depthRenderer) {\n for (const key in this.scene._depthRenderer) {\n const depthRenderer = this.scene._depthRenderer[key];\n if (depthRenderer.enabled && depthRenderer.useOnlyInActiveCamera && this.scene.activeCamera.id === key) {\n renderTargets.push(depthRenderer.getDepthMap());\n }\n }\n }\n }\n}\nDepthRenderer._SceneComponentInitialization = (scene) => {\n // Register the G Buffer component to the scene.\n let component = scene._getComponent(SceneComponentConstants.NAME_DEPTHRENDERER);\n if (!component) {\n component = new DepthRendererSceneComponent(scene);\n scene._addComponent(component);\n }\n};\n//# sourceMappingURL=depthRendererSceneComponent.js.map","/**\r\n * Group the required LensRendering dependencies into a single file to allow a single \"import\"\r\n *\r\n * @internal\r\n */\r\nimport { LensRenderingPipeline } from '@babylonjs/core/PostProcesses/RenderPipeline/Pipelines/lensRenderingPipeline';\r\nimport '@babylonjs/core/Rendering/depthRendererSceneComponent';\r\n\r\nexport { LensRenderingPipeline };\r\n"],"names":["shader","this"],"sourceRoot":""}
|