src/Layer/babylon.highlightlayer.js
/**
         * 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
@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
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
function HighlightLayer(name, scene, options) {
            this._vertexBuffers = {};
            this._mainTextureDesiredSize = { width: 0, height: 0 };
            this._meshes = {};
            this._maxSize = 0;
            this._shouldRender = false;
            this._instanceGlowingMeshStencilReference = HighlightLayer.glowingMeshStencilReference++;
            this.innerGlow = true;
            this.outerGlow = true;
            this.onDisposeObservable = new BABYLON.Observable();
            this.onBeforeRenderMainTextureObservable = new BABYLON.Observable();
            this.onBeforeBlurObservable = new BABYLON.Observable();
            this.onAfterBlurObservable = new BABYLON.Observable();
            this.onBeforeComposeObservable = new BABYLON.Observable();
            this.onAfterComposeObservable = new BABYLON.Observable();
            this.onSizeChangedObservable = new BABYLON.Observable();
            this._scene = scene;
            var engine = scene.getEngine();
            this._engine = engine;
            this._maxSize = this._engine.getCaps().maxTextureSize;
            this._scene.highlightLayers.push(this);
            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 }");
            }
            this._options = options || {
                mainTextureRatio: 0.25,
                blurTextureSizeRatio: 0.5,
                blurHorizontalSize: 1,
                blurVerticalSize: 1,
                alphaBlendingMode: BABYLON.Engine.ALPHA_COMBINE
            };
            this._options.mainTextureRatio = this._options.mainTextureRatio || 0.25;
            this._options.blurTextureSizeRatio = this._options.blurTextureSizeRatio || 0.5;
            this._options.blurHorizontalSize = this._options.blurHorizontalSize || 1;
            this._options.blurVerticalSize = this._options.blurVerticalSize || 1;
            this._options.alphaBlendingMode = this._options.alphaBlendingMode || BABYLON.Engine.ALPHA_COMBINE;
            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;
            var indices = [];
            indices.push(0);
            indices.push(1);
            indices.push(2);
            indices.push(0);
            indices.push(2);
            indices.push(3);
            this._indexBuffer = engine.createIndexBuffer(indices);
            this._glowMapMergeEffect = engine.createEffect("glowMapMerge", [BABYLON.VertexBuffer.PositionKind], ["offset"], ["textureSampler"], "");
            this.setMainTextureSize();
            this.createTextureAndPostProcesses();
        }
function HighlightLayer ( name , scene , options ) { this . _vertexBuffers = { } ; this . _mainTextureDesiredSize = { width : 0 , height : 0 } ; this . _meshes = { } ; this . _maxSize = 0 ; this . _shouldRender = false ; this . _instanceGlowingMeshStencilReference = HighlightLayer . glowingMeshStencilReference ++ ; this . innerGlow = true ; this . outerGlow = true ; this . onDisposeObservable = new BABYLON . Observable ( ) ; this . onBeforeRenderMainTextureObservable = new BABYLON . Observable ( ) ; this . onBeforeBlurObservable = new BABYLON . Observable ( ) ; this . onAfterBlurObservable = new BABYLON . Observable ( ) ; this . onBeforeComposeObservable = new BABYLON . Observable ( ) ; this . onAfterComposeObservable = new BABYLON . Observable ( ) ; this . onSizeChangedObservable = new BABYLON . Observable ( ) ; this . _scene = scene ; var engine = scene . getEngine ( ) ; this . _engine = engine ; this . _maxSize = this . _engine . getCaps ( ) . maxTextureSize ; this . _scene . highlightLayers . push ( this ) ; 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 }" ) ; } this . _options = options || { mainTextureRatio : 0.25 , blurTextureSizeRatio : 0.5 , blurHorizontalSize : 1 , blurVerticalSize : 1 , alphaBlendingMode : BABYLON . Engine . ALPHA_COMBINE } ; this . _options . mainTextureRatio = this . _options . mainTextureRatio || 0.25 ; this . _options . blurTextureSizeRatio = this . _options . blurTextureSizeRatio || 0.5 ; this . _options . blurHorizontalSize = this . _options . blurHorizontalSize || 1 ; this . _options . blurVerticalSize = this . _options . blurVerticalSize || 1 ; this . _options . alphaBlendingMode = this . _options . alphaBlendingMode || BABYLON . Engine . ALPHA_COMBINE ; 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 ; var indices = [ ] ; indices . push ( 0 ) ; indices . push ( 1 ) ; indices . push ( 2 ) ; indices . push ( 0 ) ; indices . push ( 2 ) ; indices . push ( 3 ) ; this . _indexBuffer = engine . createIndexBuffer ( indices ) ; this . _glowMapMergeEffect = engine . createEffect ( "glowMapMerge" , [ BABYLON . VertexBuffer . PositionKind ] , [ "offset" ] , [ "textureSampler" ] , "" ) ; this . setMainTextureSize ( ) ; 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 .. @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 )
/**
             * Specifies whether or not the inner glow is ACTIVE in the layer.
             */ /**
             * Specifies whether or not the outer glow is ACTIVE in the layer.
             */ /**
             * An event triggered when the highlight layer has been disposed.
             * @type {BABYLON.Observable}
             */ /**
             * An event triggered when the highlight layer is about rendering the main texture with the glowy parts.
             * @type {BABYLON.Observable}
             */ /**
             * An event triggered when the highlight layer is being blurred.
             * @type {BABYLON.Observable}
             */ /**
             * An event triggered when the highlight layer has been blurred.
             * @type {BABYLON.Observable}
             */ /**
             * An event triggered when the glowing blurred texture is being merged in the scene.
             * @type {BABYLON.Observable}
             */ /**
             * An event triggered when the glowing blurred texture has been merged in the scene.
             * @type {BABYLON.Observable}
             */ /**
             * An event triggered when the highlight layer changes its size.
             * @type {BABYLON.Observable}
             */ // Warn on stencil. // Adapt options // VBO // Indices // Effect // Render target // Create Textures and post processes