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

Merge pull request #8565 from BabylonJS/master

Nightly
mergify[bot] 5 лет назад
Родитель
Сommit
7c06933529

+ 1 - 0
Playground/src/scss/waitRing.scss

@@ -17,6 +17,7 @@
     display: grid;    
     display: grid;    
     align-content: center;
     align-content: center;
     justify-content: center;
     justify-content: center;
+    background: #201936;    
 }
 }
 
 
 #waitLogo {
 #waitLogo {

+ 41 - 0
dist/preview release/babylon.d.ts

@@ -69096,6 +69096,7 @@ declare module BABYLON {
         /** Gets or sets a boolean indicating if transparent meshes should be rendered */
         /** Gets or sets a boolean indicating if transparent meshes should be rendered */
         renderTransparentMeshes: boolean;
         renderTransparentMeshes: boolean;
         private _scene;
         private _scene;
+        private _resizeObserver;
         private _multiRenderTarget;
         private _multiRenderTarget;
         private _ratio;
         private _ratio;
         private _enablePosition;
         private _enablePosition;
@@ -70983,6 +70984,46 @@ declare module BABYLON {
     }
     }
 }
 }
 declare module BABYLON {
 declare module BABYLON {
+    /** @hidden */
+    export var screenSpaceCurvaturePixelShader: {
+        name: string;
+        shader: string;
+    };
+}
+declare module BABYLON {
+    /**
+     * The Screen Space curvature effect can help highlighting ridge and valley of a model.
+     */
+    export class ScreenSpaceCurvaturePostProcess extends PostProcess {
+        /**
+         * Defines how much ridge the curvature effect displays.
+         */
+        ridge: number;
+        /**
+         * Defines how much valley the curvature effect displays.
+         */
+        valley: number;
+        private _geometryBufferRenderer;
+        /**
+         * Creates a new instance ScreenSpaceCurvaturePostProcess
+         * @param name The name of the effect.
+         * @param scene The scene containing the objects to blur according to their velocity.
+         * @param options The required width/height ratio to downsize to before computing the render pass.
+         * @param camera The camera to apply the render pass to.
+         * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
+         * @param engine The engine which the post process will be applied. (default: current engine)
+         * @param reusable If the post process can be reused on the same frame. (default: false)
+         * @param textureType Type of textures used when performing the post process. (default: 0)
+         * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)
+         */
+        constructor(name: string, scene: Scene, options: number | PostProcessOptions, camera: Nullable<Camera>, samplingMode?: number, engine?: Engine, reusable?: boolean, textureType?: number, blockCompilation?: boolean);
+        /**
+         * Support test.
+         */
+        static get IsSupported(): boolean;
+    }
+}
+declare module BABYLON {
         interface Scene {
         interface Scene {
             /** @hidden (Backing field) */
             /** @hidden (Backing field) */
             _boundingBoxRenderer: BoundingBoxRenderer;
             _boundingBoxRenderer: BoundingBoxRenderer;

Разница между файлами не показана из-за своего большого размера
+ 1 - 1
dist/preview release/babylon.js


Разница между файлами не показана из-за своего большого размера
+ 136 - 8
dist/preview release/babylon.max.js


Разница между файлами не показана из-за своего большого размера
+ 1 - 1
dist/preview release/babylon.max.js.map


+ 90 - 0
dist/preview release/babylon.module.d.ts

@@ -72824,6 +72824,7 @@ declare module "babylonjs/Rendering/geometryBufferRenderer" {
         /** Gets or sets a boolean indicating if transparent meshes should be rendered */
         /** Gets or sets a boolean indicating if transparent meshes should be rendered */
         renderTransparentMeshes: boolean;
         renderTransparentMeshes: boolean;
         private _scene;
         private _scene;
+        private _resizeObserver;
         private _multiRenderTarget;
         private _multiRenderTarget;
         private _ratio;
         private _ratio;
         private _enablePosition;
         private _enablePosition;
@@ -74849,6 +74850,53 @@ declare module "babylonjs/PostProcesses/volumetricLightScatteringPostProcess" {
         static CreateDefaultMesh(name: string, scene: Scene): Mesh;
         static CreateDefaultMesh(name: string, scene: Scene): Mesh;
     }
     }
 }
 }
+declare module "babylonjs/Shaders/screenSpaceCurvature.fragment" {
+    /** @hidden */
+    export var screenSpaceCurvaturePixelShader: {
+        name: string;
+        shader: string;
+    };
+}
+declare module "babylonjs/PostProcesses/screenSpaceCurvaturePostProcess" {
+    import { Nullable } from "babylonjs/types";
+    import { Camera } from "babylonjs/Cameras/camera";
+    import { PostProcess, PostProcessOptions } from "babylonjs/PostProcesses/postProcess";
+    import { Scene } from "babylonjs/scene";
+    import "babylonjs/Rendering/geometryBufferRendererSceneComponent";
+    import "babylonjs/Shaders/screenSpaceCurvature.fragment";
+    import { Engine } from "babylonjs/Engines/engine";
+    /**
+     * The Screen Space curvature effect can help highlighting ridge and valley of a model.
+     */
+    export class ScreenSpaceCurvaturePostProcess extends PostProcess {
+        /**
+         * Defines how much ridge the curvature effect displays.
+         */
+        ridge: number;
+        /**
+         * Defines how much valley the curvature effect displays.
+         */
+        valley: number;
+        private _geometryBufferRenderer;
+        /**
+         * Creates a new instance ScreenSpaceCurvaturePostProcess
+         * @param name The name of the effect.
+         * @param scene The scene containing the objects to blur according to their velocity.
+         * @param options The required width/height ratio to downsize to before computing the render pass.
+         * @param camera The camera to apply the render pass to.
+         * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
+         * @param engine The engine which the post process will be applied. (default: current engine)
+         * @param reusable If the post process can be reused on the same frame. (default: false)
+         * @param textureType Type of textures used when performing the post process. (default: 0)
+         * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)
+         */
+        constructor(name: string, scene: Scene, options: number | PostProcessOptions, camera: Nullable<Camera>, samplingMode?: number, engine?: Engine, reusable?: boolean, textureType?: number, blockCompilation?: boolean);
+        /**
+         * Support test.
+         */
+        static get IsSupported(): boolean;
+    }
+}
 declare module "babylonjs/PostProcesses/index" {
 declare module "babylonjs/PostProcesses/index" {
     export * from "babylonjs/PostProcesses/anaglyphPostProcess";
     export * from "babylonjs/PostProcesses/anaglyphPostProcess";
     export * from "babylonjs/PostProcesses/blackAndWhitePostProcess";
     export * from "babylonjs/PostProcesses/blackAndWhitePostProcess";
@@ -74882,6 +74930,7 @@ declare module "babylonjs/PostProcesses/index" {
     export * from "babylonjs/PostProcesses/vrDistortionCorrectionPostProcess";
     export * from "babylonjs/PostProcesses/vrDistortionCorrectionPostProcess";
     export * from "babylonjs/PostProcesses/vrMultiviewToSingleviewPostProcess";
     export * from "babylonjs/PostProcesses/vrMultiviewToSingleviewPostProcess";
     export * from "babylonjs/PostProcesses/screenSpaceReflectionPostProcess";
     export * from "babylonjs/PostProcesses/screenSpaceReflectionPostProcess";
+    export * from "babylonjs/PostProcesses/screenSpaceCurvaturePostProcess";
 }
 }
 declare module "babylonjs/Probes/index" {
 declare module "babylonjs/Probes/index" {
     export * from "babylonjs/Probes/reflectionProbe";
     export * from "babylonjs/Probes/reflectionProbe";
@@ -147572,6 +147621,7 @@ declare module BABYLON {
         /** Gets or sets a boolean indicating if transparent meshes should be rendered */
         /** Gets or sets a boolean indicating if transparent meshes should be rendered */
         renderTransparentMeshes: boolean;
         renderTransparentMeshes: boolean;
         private _scene;
         private _scene;
+        private _resizeObserver;
         private _multiRenderTarget;
         private _multiRenderTarget;
         private _ratio;
         private _ratio;
         private _enablePosition;
         private _enablePosition;
@@ -149459,6 +149509,46 @@ declare module BABYLON {
     }
     }
 }
 }
 declare module BABYLON {
 declare module BABYLON {
+    /** @hidden */
+    export var screenSpaceCurvaturePixelShader: {
+        name: string;
+        shader: string;
+    };
+}
+declare module BABYLON {
+    /**
+     * The Screen Space curvature effect can help highlighting ridge and valley of a model.
+     */
+    export class ScreenSpaceCurvaturePostProcess extends PostProcess {
+        /**
+         * Defines how much ridge the curvature effect displays.
+         */
+        ridge: number;
+        /**
+         * Defines how much valley the curvature effect displays.
+         */
+        valley: number;
+        private _geometryBufferRenderer;
+        /**
+         * Creates a new instance ScreenSpaceCurvaturePostProcess
+         * @param name The name of the effect.
+         * @param scene The scene containing the objects to blur according to their velocity.
+         * @param options The required width/height ratio to downsize to before computing the render pass.
+         * @param camera The camera to apply the render pass to.
+         * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
+         * @param engine The engine which the post process will be applied. (default: current engine)
+         * @param reusable If the post process can be reused on the same frame. (default: false)
+         * @param textureType Type of textures used when performing the post process. (default: 0)
+         * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)
+         */
+        constructor(name: string, scene: Scene, options: number | PostProcessOptions, camera: Nullable<Camera>, samplingMode?: number, engine?: Engine, reusable?: boolean, textureType?: number, blockCompilation?: boolean);
+        /**
+         * Support test.
+         */
+        static get IsSupported(): boolean;
+    }
+}
+declare module BABYLON {
         interface Scene {
         interface Scene {
             /** @hidden (Backing field) */
             /** @hidden (Backing field) */
             _boundingBoxRenderer: BoundingBoxRenderer;
             _boundingBoxRenderer: BoundingBoxRenderer;

+ 41 - 0
dist/preview release/documentation.d.ts

@@ -69096,6 +69096,7 @@ declare module BABYLON {
         /** Gets or sets a boolean indicating if transparent meshes should be rendered */
         /** Gets or sets a boolean indicating if transparent meshes should be rendered */
         renderTransparentMeshes: boolean;
         renderTransparentMeshes: boolean;
         private _scene;
         private _scene;
+        private _resizeObserver;
         private _multiRenderTarget;
         private _multiRenderTarget;
         private _ratio;
         private _ratio;
         private _enablePosition;
         private _enablePosition;
@@ -70983,6 +70984,46 @@ declare module BABYLON {
     }
     }
 }
 }
 declare module BABYLON {
 declare module BABYLON {
+    /** @hidden */
+    export var screenSpaceCurvaturePixelShader: {
+        name: string;
+        shader: string;
+    };
+}
+declare module BABYLON {
+    /**
+     * The Screen Space curvature effect can help highlighting ridge and valley of a model.
+     */
+    export class ScreenSpaceCurvaturePostProcess extends PostProcess {
+        /**
+         * Defines how much ridge the curvature effect displays.
+         */
+        ridge: number;
+        /**
+         * Defines how much valley the curvature effect displays.
+         */
+        valley: number;
+        private _geometryBufferRenderer;
+        /**
+         * Creates a new instance ScreenSpaceCurvaturePostProcess
+         * @param name The name of the effect.
+         * @param scene The scene containing the objects to blur according to their velocity.
+         * @param options The required width/height ratio to downsize to before computing the render pass.
+         * @param camera The camera to apply the render pass to.
+         * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
+         * @param engine The engine which the post process will be applied. (default: current engine)
+         * @param reusable If the post process can be reused on the same frame. (default: false)
+         * @param textureType Type of textures used when performing the post process. (default: 0)
+         * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)
+         */
+        constructor(name: string, scene: Scene, options: number | PostProcessOptions, camera: Nullable<Camera>, samplingMode?: number, engine?: Engine, reusable?: boolean, textureType?: number, blockCompilation?: boolean);
+        /**
+         * Support test.
+         */
+        static get IsSupported(): boolean;
+    }
+}
+declare module BABYLON {
         interface Scene {
         interface Scene {
             /** @hidden (Backing field) */
             /** @hidden (Backing field) */
             _boundingBoxRenderer: BoundingBoxRenderer;
             _boundingBoxRenderer: BoundingBoxRenderer;

+ 7 - 7
dist/preview release/inspector/babylon.inspector.bundle.max.js

@@ -7,7 +7,7 @@
 		exports["babylonjs-inspector"] = factory(require("babylonjs-gui"), require("babylonjs-loaders"), require("babylonjs-materials"), require("babylonjs-serializers"), require("babylonjs"));
 		exports["babylonjs-inspector"] = factory(require("babylonjs-gui"), require("babylonjs-loaders"), require("babylonjs-materials"), require("babylonjs-serializers"), require("babylonjs"));
 	else
 	else
 		root["INSPECTOR"] = factory(root["BABYLON"]["GUI"], root["BABYLON"], root["BABYLON"], root["BABYLON"], root["BABYLON"]);
 		root["INSPECTOR"] = factory(root["BABYLON"]["GUI"], root["BABYLON"], root["BABYLON"], root["BABYLON"], root["BABYLON"]);
-})((typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : this), function(__WEBPACK_EXTERNAL_MODULE_babylonjs_gui_2D_controls_control__, __WEBPACK_EXTERNAL_MODULE_babylonjs_loaders_glTF_index__, __WEBPACK_EXTERNAL_MODULE_babylonjs_materials_grid_gridMaterial__, __WEBPACK_EXTERNAL_MODULE_babylonjs_serializers_glTF_2_0_index__, __WEBPACK_EXTERNAL_MODULE_babylonjs_Misc_observable__) {
+})((typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : this), function(__WEBPACK_EXTERNAL_MODULE_babylonjs_gui_2D_adtInstrumentation__, __WEBPACK_EXTERNAL_MODULE_babylonjs_loaders_glTF_index__, __WEBPACK_EXTERNAL_MODULE_babylonjs_materials_grid_gridMaterial__, __WEBPACK_EXTERNAL_MODULE_babylonjs_serializers_glTF_2_0_index__, __WEBPACK_EXTERNAL_MODULE_babylonjs_Misc_observable__) {
 return /******/ (function(modules) { // webpackBootstrap
 return /******/ (function(modules) { // webpackBootstrap
 /******/ 	// The module cache
 /******/ 	// The module cache
 /******/ 	var installedModules = {};
 /******/ 	var installedModules = {};
@@ -67581,7 +67581,7 @@ __webpack_require__.r(__webpack_exports__);
 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../lineContainerComponent */ "./components/actionTabs/lineContainerComponent.tsx");
 /* harmony import */ var _lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../lineContainerComponent */ "./components/actionTabs/lineContainerComponent.tsx");
 /* harmony import */ var _lines_textLineComponent__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../lines/textLineComponent */ "./components/actionTabs/lines/textLineComponent.tsx");
 /* harmony import */ var _lines_textLineComponent__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../lines/textLineComponent */ "./components/actionTabs/lines/textLineComponent.tsx");
-/* harmony import */ var babylonjs_gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! babylonjs-gui/2D/controls/control */ "babylonjs-gui/2D/controls/control");
+/* harmony import */ var babylonjs_gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! babylonjs-gui/2D/controls/control */ "babylonjs-gui/2D/adtInstrumentation");
 /* harmony import */ var babylonjs_gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(babylonjs_gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_4__);
 /* harmony import */ var babylonjs_gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(babylonjs_gui_2D_controls_control__WEBPACK_IMPORTED_MODULE_4__);
 /* harmony import */ var _lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../lines/sliderLineComponent */ "./components/actionTabs/lines/sliderLineComponent.tsx");
 /* harmony import */ var _lines_sliderLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../lines/sliderLineComponent */ "./components/actionTabs/lines/sliderLineComponent.tsx");
 /* harmony import */ var _lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../lines/floatLineComponent */ "./components/actionTabs/lines/floatLineComponent.tsx");
 /* harmony import */ var _lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../lines/floatLineComponent */ "./components/actionTabs/lines/floatLineComponent.tsx");
@@ -67887,7 +67887,7 @@ __webpack_require__.r(__webpack_exports__);
 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./commonControlPropertyGridComponent */ "./components/actionTabs/tabs/propertyGrids/gui/commonControlPropertyGridComponent.tsx");
 /* harmony import */ var _commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./commonControlPropertyGridComponent */ "./components/actionTabs/tabs/propertyGrids/gui/commonControlPropertyGridComponent.tsx");
 /* harmony import */ var _lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../lineContainerComponent */ "./components/actionTabs/lineContainerComponent.tsx");
 /* harmony import */ var _lineContainerComponent__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../lineContainerComponent */ "./components/actionTabs/lineContainerComponent.tsx");
-/* harmony import */ var babylonjs_gui_2D_controls_image__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! babylonjs-gui/2D/controls/image */ "babylonjs-gui/2D/controls/control");
+/* harmony import */ var babylonjs_gui_2D_controls_image__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! babylonjs-gui/2D/controls/image */ "babylonjs-gui/2D/adtInstrumentation");
 /* harmony import */ var babylonjs_gui_2D_controls_image__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(babylonjs_gui_2D_controls_image__WEBPACK_IMPORTED_MODULE_4__);
 /* harmony import */ var babylonjs_gui_2D_controls_image__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(babylonjs_gui_2D_controls_image__WEBPACK_IMPORTED_MODULE_4__);
 /* harmony import */ var _lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../lines/floatLineComponent */ "./components/actionTabs/lines/floatLineComponent.tsx");
 /* harmony import */ var _lines_floatLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../lines/floatLineComponent */ "./components/actionTabs/lines/floatLineComponent.tsx");
 /* harmony import */ var _lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../lines/checkBoxLineComponent */ "./components/actionTabs/lines/checkBoxLineComponent.tsx");
 /* harmony import */ var _lines_checkBoxLineComponent__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../lines/checkBoxLineComponent */ "./components/actionTabs/lines/checkBoxLineComponent.tsx");
@@ -68301,7 +68301,7 @@ __webpack_require__.r(__webpack_exports__);
 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "../../node_modules/react/index.js");
 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "../../node_modules/react/index.js");
 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./commonControlPropertyGridComponent */ "./components/actionTabs/tabs/propertyGrids/gui/commonControlPropertyGridComponent.tsx");
 /* harmony import */ var _commonControlPropertyGridComponent__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./commonControlPropertyGridComponent */ "./components/actionTabs/tabs/propertyGrids/gui/commonControlPropertyGridComponent.tsx");
-/* harmony import */ var babylonjs_gui_2D_controls_textBlock__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! babylonjs-gui/2D/controls/textBlock */ "babylonjs-gui/2D/controls/control");
+/* harmony import */ var babylonjs_gui_2D_controls_textBlock__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! babylonjs-gui/2D/controls/textBlock */ "babylonjs-gui/2D/adtInstrumentation");
 /* harmony import */ var babylonjs_gui_2D_controls_textBlock__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(babylonjs_gui_2D_controls_textBlock__WEBPACK_IMPORTED_MODULE_3__);
 /* harmony import */ var babylonjs_gui_2D_controls_textBlock__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(babylonjs_gui_2D_controls_textBlock__WEBPACK_IMPORTED_MODULE_3__);
 /* harmony import */ var _lineContainerComponent__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../lineContainerComponent */ "./components/actionTabs/lineContainerComponent.tsx");
 /* harmony import */ var _lineContainerComponent__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../lineContainerComponent */ "./components/actionTabs/lineContainerComponent.tsx");
 /* harmony import */ var _lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../lines/textInputLineComponent */ "./components/actionTabs/lines/textInputLineComponent.tsx");
 /* harmony import */ var _lines_textInputLineComponent__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../lines/textInputLineComponent */ "./components/actionTabs/lines/textInputLineComponent.tsx");
@@ -69783,7 +69783,7 @@ __webpack_require__.r(__webpack_exports__);
 /* harmony import */ var _lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../lines/optionsLineComponent */ "./components/actionTabs/lines/optionsLineComponent.tsx");
 /* harmony import */ var _lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../lines/optionsLineComponent */ "./components/actionTabs/lines/optionsLineComponent.tsx");
 /* harmony import */ var _lines_fileButtonLineComponent__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../lines/fileButtonLineComponent */ "./components/actionTabs/lines/fileButtonLineComponent.tsx");
 /* harmony import */ var _lines_fileButtonLineComponent__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../lines/fileButtonLineComponent */ "./components/actionTabs/lines/fileButtonLineComponent.tsx");
 /* harmony import */ var _lines_valueLineComponent__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../lines/valueLineComponent */ "./components/actionTabs/lines/valueLineComponent.tsx");
 /* harmony import */ var _lines_valueLineComponent__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../lines/valueLineComponent */ "./components/actionTabs/lines/valueLineComponent.tsx");
-/* harmony import */ var babylonjs_gui_2D_adtInstrumentation__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! babylonjs-gui/2D/adtInstrumentation */ "babylonjs-gui/2D/controls/control");
+/* harmony import */ var babylonjs_gui_2D_adtInstrumentation__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! babylonjs-gui/2D/adtInstrumentation */ "babylonjs-gui/2D/adtInstrumentation");
 /* harmony import */ var babylonjs_gui_2D_adtInstrumentation__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(babylonjs_gui_2D_adtInstrumentation__WEBPACK_IMPORTED_MODULE_12__);
 /* harmony import */ var babylonjs_gui_2D_adtInstrumentation__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(babylonjs_gui_2D_adtInstrumentation__WEBPACK_IMPORTED_MODULE_12__);
 /* harmony import */ var _customPropertyGridComponent__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../customPropertyGridComponent */ "./components/actionTabs/tabs/propertyGrids/customPropertyGridComponent.tsx");
 /* harmony import */ var _customPropertyGridComponent__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../customPropertyGridComponent */ "./components/actionTabs/tabs/propertyGrids/customPropertyGridComponent.tsx");
 /* harmony import */ var _lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../lines/buttonLineComponent */ "./components/actionTabs/lines/buttonLineComponent.tsx");
 /* harmony import */ var _lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../lines/buttonLineComponent */ "./components/actionTabs/lines/buttonLineComponent.tsx");
@@ -77407,14 +77407,14 @@ var Tools = /** @class */ (function () {
 
 
 /***/ }),
 /***/ }),
 
 
-/***/ "babylonjs-gui/2D/controls/control":
+/***/ "babylonjs-gui/2D/adtInstrumentation":
 /*!************************************************************************************************************************!*\
 /*!************************************************************************************************************************!*\
   !*** external {"root":["BABYLON","GUI"],"commonjs":"babylonjs-gui","commonjs2":"babylonjs-gui","amd":"babylonjs-gui"} ***!
   !*** external {"root":["BABYLON","GUI"],"commonjs":"babylonjs-gui","commonjs2":"babylonjs-gui","amd":"babylonjs-gui"} ***!
   \************************************************************************************************************************/
   \************************************************************************************************************************/
 /*! no static exports found */
 /*! no static exports found */
 /***/ (function(module, exports) {
 /***/ (function(module, exports) {
 
 
-module.exports = __WEBPACK_EXTERNAL_MODULE_babylonjs_gui_2D_controls_control__;
+module.exports = __WEBPACK_EXTERNAL_MODULE_babylonjs_gui_2D_adtInstrumentation__;
 
 
 /***/ }),
 /***/ }),
 
 

Разница между файлами не показана из-за своего большого размера
+ 1 - 1
dist/preview release/inspector/babylon.inspector.bundle.max.js.map


+ 90 - 0
dist/preview release/viewer/babylon.module.d.ts

@@ -72824,6 +72824,7 @@ declare module "babylonjs/Rendering/geometryBufferRenderer" {
         /** Gets or sets a boolean indicating if transparent meshes should be rendered */
         /** Gets or sets a boolean indicating if transparent meshes should be rendered */
         renderTransparentMeshes: boolean;
         renderTransparentMeshes: boolean;
         private _scene;
         private _scene;
+        private _resizeObserver;
         private _multiRenderTarget;
         private _multiRenderTarget;
         private _ratio;
         private _ratio;
         private _enablePosition;
         private _enablePosition;
@@ -74849,6 +74850,53 @@ declare module "babylonjs/PostProcesses/volumetricLightScatteringPostProcess" {
         static CreateDefaultMesh(name: string, scene: Scene): Mesh;
         static CreateDefaultMesh(name: string, scene: Scene): Mesh;
     }
     }
 }
 }
+declare module "babylonjs/Shaders/screenSpaceCurvature.fragment" {
+    /** @hidden */
+    export var screenSpaceCurvaturePixelShader: {
+        name: string;
+        shader: string;
+    };
+}
+declare module "babylonjs/PostProcesses/screenSpaceCurvaturePostProcess" {
+    import { Nullable } from "babylonjs/types";
+    import { Camera } from "babylonjs/Cameras/camera";
+    import { PostProcess, PostProcessOptions } from "babylonjs/PostProcesses/postProcess";
+    import { Scene } from "babylonjs/scene";
+    import "babylonjs/Rendering/geometryBufferRendererSceneComponent";
+    import "babylonjs/Shaders/screenSpaceCurvature.fragment";
+    import { Engine } from "babylonjs/Engines/engine";
+    /**
+     * The Screen Space curvature effect can help highlighting ridge and valley of a model.
+     */
+    export class ScreenSpaceCurvaturePostProcess extends PostProcess {
+        /**
+         * Defines how much ridge the curvature effect displays.
+         */
+        ridge: number;
+        /**
+         * Defines how much valley the curvature effect displays.
+         */
+        valley: number;
+        private _geometryBufferRenderer;
+        /**
+         * Creates a new instance ScreenSpaceCurvaturePostProcess
+         * @param name The name of the effect.
+         * @param scene The scene containing the objects to blur according to their velocity.
+         * @param options The required width/height ratio to downsize to before computing the render pass.
+         * @param camera The camera to apply the render pass to.
+         * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
+         * @param engine The engine which the post process will be applied. (default: current engine)
+         * @param reusable If the post process can be reused on the same frame. (default: false)
+         * @param textureType Type of textures used when performing the post process. (default: 0)
+         * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)
+         */
+        constructor(name: string, scene: Scene, options: number | PostProcessOptions, camera: Nullable<Camera>, samplingMode?: number, engine?: Engine, reusable?: boolean, textureType?: number, blockCompilation?: boolean);
+        /**
+         * Support test.
+         */
+        static get IsSupported(): boolean;
+    }
+}
 declare module "babylonjs/PostProcesses/index" {
 declare module "babylonjs/PostProcesses/index" {
     export * from "babylonjs/PostProcesses/anaglyphPostProcess";
     export * from "babylonjs/PostProcesses/anaglyphPostProcess";
     export * from "babylonjs/PostProcesses/blackAndWhitePostProcess";
     export * from "babylonjs/PostProcesses/blackAndWhitePostProcess";
@@ -74882,6 +74930,7 @@ declare module "babylonjs/PostProcesses/index" {
     export * from "babylonjs/PostProcesses/vrDistortionCorrectionPostProcess";
     export * from "babylonjs/PostProcesses/vrDistortionCorrectionPostProcess";
     export * from "babylonjs/PostProcesses/vrMultiviewToSingleviewPostProcess";
     export * from "babylonjs/PostProcesses/vrMultiviewToSingleviewPostProcess";
     export * from "babylonjs/PostProcesses/screenSpaceReflectionPostProcess";
     export * from "babylonjs/PostProcesses/screenSpaceReflectionPostProcess";
+    export * from "babylonjs/PostProcesses/screenSpaceCurvaturePostProcess";
 }
 }
 declare module "babylonjs/Probes/index" {
 declare module "babylonjs/Probes/index" {
     export * from "babylonjs/Probes/reflectionProbe";
     export * from "babylonjs/Probes/reflectionProbe";
@@ -147572,6 +147621,7 @@ declare module BABYLON {
         /** Gets or sets a boolean indicating if transparent meshes should be rendered */
         /** Gets or sets a boolean indicating if transparent meshes should be rendered */
         renderTransparentMeshes: boolean;
         renderTransparentMeshes: boolean;
         private _scene;
         private _scene;
+        private _resizeObserver;
         private _multiRenderTarget;
         private _multiRenderTarget;
         private _ratio;
         private _ratio;
         private _enablePosition;
         private _enablePosition;
@@ -149459,6 +149509,46 @@ declare module BABYLON {
     }
     }
 }
 }
 declare module BABYLON {
 declare module BABYLON {
+    /** @hidden */
+    export var screenSpaceCurvaturePixelShader: {
+        name: string;
+        shader: string;
+    };
+}
+declare module BABYLON {
+    /**
+     * The Screen Space curvature effect can help highlighting ridge and valley of a model.
+     */
+    export class ScreenSpaceCurvaturePostProcess extends PostProcess {
+        /**
+         * Defines how much ridge the curvature effect displays.
+         */
+        ridge: number;
+        /**
+         * Defines how much valley the curvature effect displays.
+         */
+        valley: number;
+        private _geometryBufferRenderer;
+        /**
+         * Creates a new instance ScreenSpaceCurvaturePostProcess
+         * @param name The name of the effect.
+         * @param scene The scene containing the objects to blur according to their velocity.
+         * @param options The required width/height ratio to downsize to before computing the render pass.
+         * @param camera The camera to apply the render pass to.
+         * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
+         * @param engine The engine which the post process will be applied. (default: current engine)
+         * @param reusable If the post process can be reused on the same frame. (default: false)
+         * @param textureType Type of textures used when performing the post process. (default: 0)
+         * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)
+         */
+        constructor(name: string, scene: Scene, options: number | PostProcessOptions, camera: Nullable<Camera>, samplingMode?: number, engine?: Engine, reusable?: boolean, textureType?: number, blockCompilation?: boolean);
+        /**
+         * Support test.
+         */
+        static get IsSupported(): boolean;
+    }
+}
+declare module BABYLON {
         interface Scene {
         interface Scene {
             /** @hidden (Backing field) */
             /** @hidden (Backing field) */
             _boundingBoxRenderer: BoundingBoxRenderer;
             _boundingBoxRenderer: BoundingBoxRenderer;

Разница между файлами не показана из-за своего большого размера
+ 13 - 5
dist/preview release/viewer/babylon.viewer.js


Разница между файлами не показана из-за своего большого размера
+ 1 - 1
dist/preview release/viewer/babylon.viewer.max.js


+ 1 - 0
dist/preview release/what's new.md

@@ -199,6 +199,7 @@
 ### Post Processes
 ### Post Processes
 
 
 - SSAO 2 is now using the brand new `PrePassRenderer` to avoid rendering the scene twice ([CraigFeldpsar](https://github.com/craigfeldspar)
 - SSAO 2 is now using the brand new `PrePassRenderer` to avoid rendering the scene twice ([CraigFeldpsar](https://github.com/craigfeldspar)
+- Added Screen Space Curvature post process ([Popov72](https://github.com/Popov72) and [Sebavan](https://github.com/sebavan/))
 
 
 ## Bugs
 ## Bugs
 
 

+ 2 - 1
src/PostProcesses/index.ts

@@ -29,4 +29,5 @@ export * from "./tonemapPostProcess";
 export * from "./volumetricLightScatteringPostProcess";
 export * from "./volumetricLightScatteringPostProcess";
 export * from "./vrDistortionCorrectionPostProcess";
 export * from "./vrDistortionCorrectionPostProcess";
 export * from "./vrMultiviewToSingleviewPostProcess";
 export * from "./vrMultiviewToSingleviewPostProcess";
-export * from "./screenSpaceReflectionPostProcess";
+export * from "./screenSpaceReflectionPostProcess";
+export * from "./screenSpaceCurvaturePostProcess";

+ 75 - 0
src/PostProcesses/screenSpaceCurvaturePostProcess.ts

@@ -0,0 +1,75 @@
+import { Nullable } from "../types";
+import { Logger } from "../Misc/logger";
+import { Camera } from "../Cameras/camera";
+import { Effect } from "../Materials/effect";
+import { PostProcess, PostProcessOptions } from "./postProcess";
+import { Constants } from "../Engines/constants";
+import { GeometryBufferRenderer } from "../Rendering/geometryBufferRenderer";
+import { Scene } from "../scene";
+
+import '../Rendering/geometryBufferRendererSceneComponent';
+import "../Shaders/screenSpaceCurvature.fragment";
+import { EngineStore } from '../Engines/engineStore';
+
+declare type Engine = import("../Engines/engine").Engine;
+
+/**
+ * The Screen Space curvature effect can help highlighting ridge and valley of a model.
+ */
+export class ScreenSpaceCurvaturePostProcess extends PostProcess {
+    /**
+     * Defines how much ridge the curvature effect displays.
+     */
+    public ridge: number = 1;
+
+    /**
+     * Defines how much valley the curvature effect displays.
+     */
+    public valley: number = 1;
+
+    private _geometryBufferRenderer: Nullable<GeometryBufferRenderer>;
+
+    /**
+     * Creates a new instance ScreenSpaceCurvaturePostProcess
+     * @param name The name of the effect.
+     * @param scene The scene containing the objects to blur according to their velocity.
+     * @param options The required width/height ratio to downsize to before computing the render pass.
+     * @param camera The camera to apply the render pass to.
+     * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
+     * @param engine The engine which the post process will be applied. (default: current engine)
+     * @param reusable If the post process can be reused on the same frame. (default: false)
+     * @param textureType Type of textures used when performing the post process. (default: 0)
+     * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)
+     */
+    constructor(name: string, scene: Scene, options: number | PostProcessOptions, camera: Nullable<Camera>, samplingMode?: number, engine?: Engine, reusable?: boolean, textureType: number = Constants.TEXTURETYPE_UNSIGNED_INT, blockCompilation = false) {
+        super(name, "screenSpaceCurvature", ["curvature_ridge", "curvature_valley"], ["textureSampler", "normalSampler"], options, camera, samplingMode, engine, reusable, undefined, textureType, undefined, null, blockCompilation);
+
+        this._geometryBufferRenderer = scene.enableGeometryBufferRenderer();
+
+        if (!this._geometryBufferRenderer) {
+            // Geometry buffer renderer is not supported. So, work as a passthrough.
+            Logger.Error("Multiple Render Target support needed for screen space curvature post process. Please use IsSupported test first.");
+        } else {
+            // Geometry buffer renderer is supported.
+            this.onApply = (effect: Effect) => {
+                effect.setFloat("curvature_ridge", 0.5 / Math.max(this.ridge * this.ridge, 1e-4));
+                effect.setFloat("curvature_valley", 0.7 / Math.max(this.valley * this.valley, 1e-4));
+
+                const normalTexture = this._geometryBufferRenderer!.getGBuffer().textures[1];
+                effect.setTexture("normalSampler", normalTexture);
+            };
+        }
+    }
+
+    /**
+     * Support test.
+     */
+    public static get IsSupported(): boolean {
+        var engine = EngineStore.LastCreatedEngine;
+        if (!engine) {
+            return false;
+        }
+
+        return engine.webGLVersion > 1 || engine.getCaps().drawBuffersExtension;
+    }
+}

+ 16 - 1
src/Rendering/geometryBufferRenderer.ts

@@ -13,10 +13,13 @@ import { AbstractMesh } from "../Meshes/abstractMesh";
 import { Color4 } from '../Maths/math.color';
 import { Color4 } from '../Maths/math.color';
 import { StandardMaterial } from '../Materials/standardMaterial';
 import { StandardMaterial } from '../Materials/standardMaterial';
 import { PBRMaterial } from '../Materials/PBR/pbrMaterial';
 import { PBRMaterial } from '../Materials/PBR/pbrMaterial';
+import { _DevTools } from '../Misc/devTools';
+import { Observer } from '../Misc/observable';
+import { Engine } from '../Engines/engine';
+import { Nullable } from '../types';
 
 
 import "../Shaders/geometry.fragment";
 import "../Shaders/geometry.fragment";
 import "../Shaders/geometry.vertex";
 import "../Shaders/geometry.vertex";
-import { _DevTools } from '../Misc/devTools';
 
 
 /** @hidden */
 /** @hidden */
 interface ISavedTransformationMatrix {
 interface ISavedTransformationMatrix {
@@ -66,6 +69,7 @@ export class GeometryBufferRenderer {
     public renderTransparentMeshes = true;
     public renderTransparentMeshes = true;
 
 
     private _scene: Scene;
     private _scene: Scene;
+    private _resizeObserver: Nullable<Observer<Engine>> = null;
     private _multiRenderTarget: MultiRenderTarget;
     private _multiRenderTarget: MultiRenderTarget;
     private _ratio: number;
     private _ratio: number;
     private _enablePosition: boolean = false;
     private _enablePosition: boolean = false;
@@ -353,6 +357,11 @@ export class GeometryBufferRenderer {
      * Disposes the renderer and frees up associated resources.
      * Disposes the renderer and frees up associated resources.
      */
      */
     public dispose(): void {
     public dispose(): void {
+        if (this._resizeObserver) {
+            const engine = this._scene.getEngine();
+            engine.onResizeObservable.remove(this._resizeObserver);
+            this._resizeObserver = null;
+        }
         this.getGBuffer().dispose();
         this.getGBuffer().dispose();
     }
     }
 
 
@@ -392,6 +401,12 @@ export class GeometryBufferRenderer {
             engine.clear(new Color4(0.0, 0.0, 0.0, 1.0), true, true, true);
             engine.clear(new Color4(0.0, 0.0, 0.0, 1.0), true, true, true);
         });
         });
 
 
+        this._resizeObserver = engine.onResizeObservable.add(() => {
+            if (this._multiRenderTarget) {
+                this._multiRenderTarget.resize({ width: engine.getRenderWidth() * this._ratio, height: engine.getRenderHeight() * this._ratio });
+            }
+        });
+
         // Custom render function
         // Custom render function
         var renderSubMesh = (subMesh: SubMesh): void => {
         var renderSubMesh = (subMesh: SubMesh): void => {
             var renderingMesh = subMesh.getRenderingMesh();
             var renderingMesh = subMesh.getRenderingMesh();

+ 49 - 0
src/Shaders/screenSpaceCurvature.fragment.fx

@@ -0,0 +1,49 @@
+// From Blender sources: https://developer.blender.org/D3617#change-jG1fqR1RpokL
+// Forum request: https://forum.babylonjs.com/t/cavity-shader-effect-like-blender-2-8-viewport-for-babylon-js/11789
+precision highp float;
+
+// Samplers
+varying vec2 vUV;
+uniform sampler2D textureSampler;
+uniform sampler2D normalSampler;
+
+uniform float curvature_ridge;
+uniform float curvature_valley;
+
+#ifndef CURVATURE_OFFSET
+    #define CURVATURE_OFFSET 1
+#endif
+
+float curvature_soft_clamp(float curvature, float control)
+{
+    if (curvature < 0.5 / control)
+        return curvature * (1.0 - curvature * control);
+    return 0.25 / control;
+}
+
+float calculate_curvature(ivec2 texel, float ridge, float valley)
+{
+    vec2 normal_up    = texelFetchOffset(normalSampler, texel, 0, ivec2(0,  CURVATURE_OFFSET)).rb;
+    vec2 normal_down  = texelFetchOffset(normalSampler, texel, 0, ivec2(0, -CURVATURE_OFFSET)).rb;
+    vec2 normal_left  = texelFetchOffset(normalSampler, texel, 0, ivec2(-CURVATURE_OFFSET, 0)).rb;
+    vec2 normal_right = texelFetchOffset(normalSampler, texel, 0, ivec2( CURVATURE_OFFSET, 0)).rb;
+
+    float normal_diff = ((normal_up.g - normal_down.g) + (normal_right.r - normal_left.r));
+
+    if (normal_diff < 0.0)
+        return -2.0 * curvature_soft_clamp(-normal_diff, valley);
+
+    return 2.0 * curvature_soft_clamp(normal_diff, ridge);
+}
+
+void main(void) 
+{
+    ivec2 texel = ivec2(gl_FragCoord.xy);
+
+    vec4 baseColor = texture2D(textureSampler, vUV);
+
+    float curvature = calculate_curvature(texel, curvature_ridge, curvature_valley);
+    baseColor.rgb *= curvature + 1.0;
+
+    gl_FragColor = baseColor;
+}