text: var BABYLON;!(function(e){var n=(function(e){function n(){var n=e.call(this)||this;return n.CLIPPLANE=!1,n.POINTSIZE=!1,n.FOG=!1,n.NORMAL=!1,n.NUM_BONE_INFLUENCERS=0,n.BonesPerMesh=0,n.INSTANCES=!1,n.rebuild(),n}return __extends(n,e),n})(e.MaterialDefines),i=(function(i){function t(n,t){var r=i.call(this,n,t)||this;return r._worldViewProjectionMatrix=e.Matrix.Zero(),r._scaledDiffuse=new e.Color3,r}return __extends(t,i),t.prototype.needAlphaBlending=function(){return!0},t.prototype.needAlphaTesting=function(){return!1},t.prototype.getAlphaTestTexture=function(){return null},t.prototype.isReadyForSubMesh=function(i,t,r){if(this.isFrozen&&this._wasPreviouslyReady&&t.effect)return!0;t._materialDefines||(t._materialDefines=new n);var a=t._materialDefines,o=this.getScene();if(!this.checkReadyOnEveryCall&&t.effect&&this._renderId===o.getRenderId())return!0;var l=o.getEngine();if(e.MaterialHelper.PrepareDefinesForFrameBoundValues(o,l,a,r),e.MaterialHelper.PrepareDefinesForMisc(i,o,!1,this.pointsCloud,this.fogEnabled,a),a._needNormals=e.MaterialHelper.PrepareDefinesForLights(o,i,a,!1,1),e.MaterialHelper.PrepareDefinesForAttributes(i,a,!1,!0),a.isDirty){a.markAsProcessed(),o.resetCachedMaterial();var s=new e.EffectFallbacks;a.FOG&&s.addFallback(1,"FOG"),e.MaterialHelper.HandleFallbacksForShadows(a,s,1),a.NUM_BONE_INFLUENCERS>0&&s.addCPUSkinningFallback(0,i);var c=[e.VertexBuffer.PositionKind];a.NORMAL&&c.push(e.VertexBuffer.NormalKind),e.MaterialHelper.PrepareAttributesForBones(c,i,a,s),e.MaterialHelper.PrepareAttributesForInstances(c,a);var f=a.toString(),d=["world","view","viewProjection","vEyePosition","vLightsType","vFogInfos","vFogColor","pointSize","mBones","vClipPlane","depthValues"],u=[],v=[];e.MaterialHelper.PrepareUniformsAndSamplersList({uniformsNames:d,uniformBuffersNames:v,samplers:u,defines:a,maxSimultaneousLights:1}),t.setEffect(o.getEngine().createEffect("shadowOnly",{attributes:c,uniformsNames:d,uniformBuffersNames:v,samplers:u,defines:f,fallbacks:s,onCompiled:this.onCompiled,onError:this.onError,indexParameters:{maxSimultaneousLights:1}},l),a)}return!!t.effect.isReady()&&(this._renderId=o.getRenderId(),this._wasPreviouslyReady=!0,!0)},t.prototype.bindForSubMesh=function(n,i,t){var r=this.getScene(),a=t._materialDefines;if(a){var o=t.effect;this._activeEffect=o,this.bindOnlyWorldMatrix(n),this._activeEffect.setMatrix("viewProjection",r.getTransformMatrix()),e.MaterialHelper.BindBonesParameters(i,this._activeEffect),this._mustRebind(r,o)&&(e.MaterialHelper.BindClipPlane(this._activeEffect,r),this.pointsCloud&&this._activeEffect.setFloat("pointSize",this.pointSize),this._activeEffect.setVector3("vEyePosition",r._mirroredCameraPosition?r._mirroredCameraPosition:r.activeCamera.position)),r.lightsEnabled&&e.MaterialHelper.BindLights(r,i,this._activeEffect,a,1),r.fogEnabled&&i.applyFog&&r.fogMode!==e.Scene.FOGMODE_NONE&&this._activeEffect.setMatrix("view",r.getViewMatrix()),e.MaterialHelper.BindFogParameters(r,i,this._activeEffect),this._afterBind(i,this._activeEffect)}},t.prototype.clone=function(n){var i=this;return e.SerializationHelper.Clone((function(){return new t(n,i.getScene())}),this)},t.prototype.serialize=function(){var n=e.SerializationHelper.Serialize(this);return n.customType="BABYLON.ShadowOnlyMaterial",n},t.Parse=function(n,i,r){return e.SerializationHelper.Parse((function(){return new t(n.name,i)}),n,i,r)},t})(e.PushMaterial);__decorate([e.serialize()],i.prototype,"_worldViewProjectionMatrix",void 0),e.ShadowOnlyMaterial=i})(BABYLON||(BABYLON={})),BABYLON.Effect.ShadersStore.shadowOnlyVertexShader="precision highp float;\n\nattribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#include<bonesDeclaration>\n\n#include<instancesDeclaration>\nuniform mat4 view;\nuniform mat4 viewProjection;\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\n\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<shadowsVertexDeclaration>[0..maxSimultaneousLights]\nvoid main(void) {\n#include<instancesVertex>\n#include<bonesVertex>\ngl_Position=viewProjection*finalWorld*vec4(position,1.0);\nvec4 worldPos=finalWorld*vec4(position,1.0);\nvPositionW=vec3(worldPos);\n#ifdef NORMAL\nvNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));\n#endif\n\n#include<clipPlaneVertex>\n\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n\n#ifdef POINTSIZE\ngl_PointSize=pointSize;\n#endif\n}\n",BABYLON.Effect.ShadersStore.shadowOnlyPixelShader="precision highp float;\n\nuniform vec3 vEyePosition;\n\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#include<clipPlaneFragmentDeclaration>\n\n#include<fogFragmentDeclaration>\nvoid main(void) {\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition-vPositionW);\n\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);\n#endif\n\nvec3 diffuseBase=vec3(0.,0.,0.);\nlightingInfo info;\nfloat shadow=1.;\nfloat glossiness=0.;\n#include<lightFragment>[0..1]\n\nvec4 color=vec4(0.,0.,0.,1.0-clamp(shadow,0.,1.));\n#include<fogFragment>\ngl_FragColor=color;\n}";