sample/assets/js/babylon.max.js
function HighlightLayer(name, scene, options) {
            this.name = name;
            this._vertexBuffers = {};
            this._mainTextureDesiredSize = { width: 0, height: 0 };
            this._meshes = {};
            this._maxSize = 0;
            this._shouldRender = false;
            this._instanceGlowingMeshStencilReference = HighlightLayer.glowingMeshStencilReference++;
            this._excludedMeshes = {};
            /**
             * Specifies whether or not the inner glow is ACTIVE in the layer.
             */
            this.innerGlow = true;
            /**
             * Specifies whether or not the outer glow is ACTIVE in the layer.
             */
            this.outerGlow = true;
            /**
             * Specifies wether the highlight layer is enabled or not.
             */
            this.isEnabled = true;
            /**
             * An event triggered when the highlight layer has been disposed.
             * @type {BABYLON.Observable}
             */
            this.onDisposeObservable = new BABYLON.Observable();
            /**
             * An event triggered when the highlight layer is about rendering the main texture with the glowy parts.
             * @type {BABYLON.Observable}
             */
            this.onBeforeRenderMainTextureObservable = new BABYLON.Observable();
            /**
             * An event triggered when the highlight layer is being blurred.
             * @type {BABYLON.Observable}
             */
            this.onBeforeBlurObservable = new BABYLON.Observable();
            /**
             * An event triggered when the highlight layer has been blurred.
             * @type {BABYLON.Observable}
             */
            this.onAfterBlurObservable = new BABYLON.Observable();
            /**
             * An event triggered when the glowing blurred texture is being merged in the scene.
             * @type {BABYLON.Observable}
             */
            this.onBeforeComposeObservable = new BABYLON.Observable();
            /**
             * An event triggered when the glowing blurred texture has been merged in the scene.
             * @type {BABYLON.Observable}
             */
            this.onAfterComposeObservable = new BABYLON.Observable();
            /**
             * An event triggered when the highlight layer changes its size.
             * @type {BABYLON.Observable}
             */
            this.onSizeChangedObservable = new BABYLON.Observable();
            this._scene = scene || BABYLON.Engine.LastCreatedScene;
            var engine = scene.getEngine();
            this._engine = engine;
            this._maxSize = this._engine.getCaps().maxTextureSize;
            this._scene.highlightLayers.push(this);
            // Warn on stencil.
            if (!this._engine.isStencilEnable) {
                BABYLON.Tools.Warn("Rendering the Highlight Layer requires the stencil to be active on the canvas. var engine = new BABYLON.Engine(canvas, antialias, { stencil: true }");
            }
            // Adapt options
            this._options = options || {
                mainTextureRatio: 0.5,
                blurTextureSizeRatio: 0.5,
                blurHorizontalSize: 1.0,
                blurVerticalSize: 1.0,
                alphaBlendingMode: BABYLON.Engine.ALPHA_COMBINE
            };
            this._options.mainTextureRatio = this._options.mainTextureRatio || 0.5;
            this._options.blurTextureSizeRatio = this._options.blurTextureSizeRatio || 1.0;
            this._options.blurHorizontalSize = this._options.blurHorizontalSize || 1;
            this._options.blurVerticalSize = this._options.blurVerticalSize || 1;
            this._options.alphaBlendingMode = this._options.alphaBlendingMode || BABYLON.Engine.ALPHA_COMBINE;
            // VBO
            var vertices = [];
            vertices.push(1, 1);
            vertices.push(-1, 1);
            vertices.push(-1, -1);
            vertices.push(1, -1);
            var vertexBuffer = new BABYLON.VertexBuffer(engine, vertices, BABYLON.VertexBuffer.PositionKind, false, false, 2);
            this._vertexBuffers[BABYLON.VertexBuffer.PositionKind] = vertexBuffer;
            this._createIndexBuffer();
            // Effect
            this._glowMapMergeEffect = engine.createEffect("glowMapMerge", [BABYLON.VertexBuffer.PositionKind], ["offset"], ["textureSampler"], "");
            // Render target
            this.setMainTextureSize();
            // Create Textures and post processes
            this.createTextureAndPostProcesses();
        }
function HighlightLayer(name, scene, options) {
            this.name = name;
            this._vertexBuffers = {};
            this._mainTextureDesiredSize = { width: 0, height: 0 };
            this._meshes = {};
            this._maxSize = 0;
            this._shouldRender = false;
            this._instanceGlowingMeshStencilReference = HighlightLayer.glowingMeshStencilReference++;
            this._excludedMeshes = {};
            /**
             * Specifies whether or not the inner glow is ACTIVE in the layer.
             */
            this.innerGlow = true;
            /**
             * Specifies whether or not the outer glow is ACTIVE in the layer.
             */
            this.outerGlow = true;
            /**
             * Specifies wether the highlight layer is enabled or not.
             */
            this.isEnabled = true;
            /**
             * An event triggered when the highlight layer has been disposed.
             * @type {BABYLON.Observable}
             */
            this.onDisposeObservable = new BABYLON.Observable();
            /**
             * An event triggered when the highlight layer is about rendering the main texture with the glowy parts.
             * @type {BABYLON.Observable}
             */
            this.onBeforeRenderMainTextureObservable = new BABYLON.Observable();
            /**
             * An event triggered when the highlight layer is being blurred.
             * @type {BABYLON.Observable}
             */
            this.onBeforeBlurObservable = new BABYLON.Observable();
            /**
             * An event triggered when the highlight layer has been blurred.
             * @type {BABYLON.Observable}
             */
            this.onAfterBlurObservable = new BABYLON.Observable();
            /**
             * An event triggered when the glowing blurred texture is being merged in the scene.
             * @type {BABYLON.Observable}
             */
            this.onBeforeComposeObservable = new BABYLON.Observable();
            /**
             * An event triggered when the glowing blurred texture has been merged in the scene.
             * @type {BABYLON.Observable}
             */
            this.onAfterComposeObservable = new BABYLON.Observable();
            /**
             * An event triggered when the highlight layer changes its size.
             * @type {BABYLON.Observable}
             */
            this.onSizeChangedObservable = new BABYLON.Observable();
            this._scene = scene || BABYLON.Engine.LastCreatedScene;
            var engine = scene.getEngine();
            this._engine = engine;
            this._maxSize = this._engine.getCaps().maxTextureSize;
            this._scene.highlightLayers.push(this);
            // Warn on stencil.
            if (!this._engine.isStencilEnable) {
                BABYLON.Tools.Warn("Rendering the Highlight Layer requires the stencil to be active on the canvas. var engine = new BABYLON.Engine(canvas, antialias, { stencil: true }");
            }
            // Adapt options
            this._options = options || {
                mainTextureRatio: 0.5,
                blurTextureSizeRatio: 0.5,
                blurHorizontalSize: 1.0,
                blurVerticalSize: 1.0,
                alphaBlendingMode: BABYLON.Engine.ALPHA_COMBINE
            };
            this._options.mainTextureRatio = this._options.mainTextureRatio || 0.5;
            this._options.blurTextureSizeRatio = this._options.blurTextureSizeRatio || 1.0;
            this._options.blurHorizontalSize = this._options.blurHorizontalSize || 1;
            this._options.blurVerticalSize = this._options.blurVerticalSize || 1;
            this._options.alphaBlendingMode = this._options.alphaBlendingMode || BABYLON.Engine.ALPHA_COMBINE;
            // VBO
            var vertices = [];
            vertices.push(1, 1);
            vertices.push(-1, 1);
            vertices.push(-1, -1);
            vertices.push(1, -1);
            var vertexBuffer = new BABYLON.VertexBuffer(engine, vertices, BABYLON.VertexBuffer.PositionKind, false, false, 2);
            this._vertexBuffers[BABYLON.VertexBuffer.PositionKind] = vertexBuffer;
            this._createIndexBuffer();
            // Effect
            this._glowMapMergeEffect = engine.createEffect("glowMapMerge", [BABYLON.VertexBuffer.PositionKind], ["offset"], ["textureSampler"], "");
            // Render target
            this.setMainTextureSize();
            // Create Textures and post processes
            this.createTextureAndPostProcesses();
        }
function HighlightLayer ( name , scene , options ) { this . name = name ; this . _vertexBuffers = { } ; this . _mainTextureDesiredSize = { width : 0 , height : 0 } ; this . _meshes = { } ; this . _maxSize = 0 ; this . _shouldRender = false ; this . _instanceGlowingMeshStencilReference = HighlightLayer . glowingMeshStencilReference ++ ; this . _excludedMeshes = { } ; /**
             * Specifies whether or not the inner glow is ACTIVE in the layer.
             */ this . innerGlow = true ; /**
             * Specifies whether or not the outer glow is ACTIVE in the layer.
             */ this . outerGlow = true ; /**
             * Specifies wether the highlight layer is enabled or not.
             */ this . isEnabled = true ; /**
             * An event triggered when the highlight layer has been disposed.
             * @type {BABYLON.Observable}
             */ this . onDisposeObservable = new BABYLON . Observable ( ) ; /**
             * An event triggered when the highlight layer is about rendering the main texture with the glowy parts.
             * @type {BABYLON.Observable}
             */ this . onBeforeRenderMainTextureObservable = new BABYLON . Observable ( ) ; /**
             * An event triggered when the highlight layer is being blurred.
             * @type {BABYLON.Observable}
             */ this . onBeforeBlurObservable = new BABYLON . Observable ( ) ; /**
             * An event triggered when the highlight layer has been blurred.
             * @type {BABYLON.Observable}
             */ this . onAfterBlurObservable = new BABYLON . Observable ( ) ; /**
             * An event triggered when the glowing blurred texture is being merged in the scene.
             * @type {BABYLON.Observable}
             */ this . onBeforeComposeObservable = new BABYLON . Observable ( ) ; /**
             * An event triggered when the glowing blurred texture has been merged in the scene.
             * @type {BABYLON.Observable}
             */ this . onAfterComposeObservable = new BABYLON . Observable ( ) ; /**
             * An event triggered when the highlight layer changes its size.
             * @type {BABYLON.Observable}
             */ this . onSizeChangedObservable = new BABYLON . Observable ( ) ; this . _scene = scene || BABYLON . Engine . LastCreatedScene ; var engine = scene . getEngine ( ) ; this . _engine = engine ; this . _maxSize = this . _engine . getCaps ( ) . maxTextureSize ; this . _scene . highlightLayers . push ( this ) ; // Warn on stencil. if ( ! this . _engine . isStencilEnable ) { BABYLON . Tools . Warn ( "Rendering the Highlight Layer requires the stencil to be active on the canvas. var engine = new BABYLON.Engine(canvas, antialias, { stencil: true }" ) ; } // Adapt options this . _options = options || { mainTextureRatio : 0.5 , blurTextureSizeRatio : 0.5 , blurHorizontalSize : 1.0 , blurVerticalSize : 1.0 , alphaBlendingMode : BABYLON . Engine . ALPHA_COMBINE } ; this . _options . mainTextureRatio = this . _options . mainTextureRatio || 0.5 ; this . _options . blurTextureSizeRatio = this . _options . blurTextureSizeRatio || 1.0 ; this . _options . blurHorizontalSize = this . _options . blurHorizontalSize || 1 ; this . _options . blurVerticalSize = this . _options . blurVerticalSize || 1 ; this . _options . alphaBlendingMode = this . _options . alphaBlendingMode || BABYLON . Engine . ALPHA_COMBINE ; // VBO var vertices = [ ] ; vertices . push ( 1 , 1 ) ; vertices . push ( - 1 , 1 ) ; vertices . push ( - 1 , - 1 ) ; vertices . push ( 1 , - 1 ) ; var vertexBuffer = new BABYLON . VertexBuffer ( engine , vertices , BABYLON . VertexBuffer . PositionKind , false , false , 2 ) ; this . _vertexBuffers [ BABYLON . VertexBuffer . PositionKind ] = vertexBuffer ; this . _createIndexBuffer ( ) ; // Effect this . _glowMapMergeEffect = engine . createEffect ( "glowMapMerge" , [ BABYLON . VertexBuffer . PositionKind ] , [ "offset" ] , [ "textureSampler" ] , "" ) ; // Render target this . setMainTextureSize ( ) ; // Create Textures and post processes this . createTextureAndPostProcesses ( ) ; }
Instantiates a new highlight Layer and references it to the scene..
@param name The name of the layer
@param scene The scene to use the layer in
@param options Sets of none mandatory options to use with the layer (see IHighlightLayerOptions for more information)
Instantiates a new highlight Layer and references it to the scene ..