Browse Source

Revert "waterMaterial to support .useLogarithmicDepth"

This reverts commit 1a3177f934c73c12fa434cd26539f83e2e80dbea.
László Matuska 9 years ago
parent
commit
89a94ce252

+ 4 - 30
materialsLibrary/materials/water/babylon.waterMaterial.ts

@@ -18,8 +18,6 @@ module BABYLON {
         public BonesPerMesh = 0;
         public INSTANCES = false;
         public SPECULARTERM = false;
-        public LOGARITHMICDEPTH = false;
-
 
         constructor() {
             super();
@@ -108,10 +106,8 @@ module BABYLON {
 
         private _defines = new WaterMaterialDefines();
         private _cachedDefines = new WaterMaterialDefines();
-
-        private _useLogarithmicDepth: boolean;
-
-        /**
+		
+		/**
 		* Constructor
 		*/
 		constructor(name: string, scene: Scene, public renderTargetSize: Vector2 = new Vector2(512, 512)) {
@@ -120,16 +116,7 @@ module BABYLON {
 			// Create render targets
 			this._createRenderTargets(scene, renderTargetSize);
         }
-
-        @serialize()
-        public get useLogarithmicDepth(): boolean {
-            return this._useLogarithmicDepth;
-        }
-
-        public set useLogarithmicDepth(value: boolean) {
-            this._useLogarithmicDepth = value && this.getScene().getEngine().getCaps().fragmentDepthSupported;
-        }
-
+		
         // Get / Set
         public get refractionTexture(): RenderTargetTexture {
             return this._refractionRTT;
@@ -241,10 +228,6 @@ module BABYLON {
                 this._defines.POINTSIZE = true;
             }
 
-            if (this.useLogarithmicDepth) {
-                this._defines.LOGARITHMICDEPTH = true;
-            }
-
             // Fog
             if (scene.fogEnabled && mesh && mesh.applyFog && scene.fogMode !== Scene.FOGMODE_NONE && this.fogEnabled) {
                 this._defines.FOG = true;
@@ -301,10 +284,6 @@ module BABYLON {
                     fallbacks.addFallback(1, "FOG");
                 }
 
-                if (this._defines.LOGARITHMICDEPTH) {
-                    fallbacks.addFallback(0, "LOGARITHMICDEPTH");
-                }
-
                 MaterialHelper.HandleFallbacksForShadows(this._defines, fallbacks, this.maxSimultaneousLights);
              
                 if (this._defines.NUM_BONE_INFLUENCERS > 0) {
@@ -341,8 +320,6 @@ module BABYLON {
                     "vNormalInfos", 
                     "mBones",
                     "vClipPlane", "normalMatrix",
-                    "logarithmicDepthConstant",
-
                     // Water
                     "worldReflectionViewProjection", "windDirection", "waveLength", "time", "windForce",
                     "cameraPosition", "bumpHeight", "waveHeight", "waterColor", "colorBlendFactor", "waveSpeed"
@@ -426,10 +403,7 @@ module BABYLON {
 
             // Fog
             MaterialHelper.BindFogParameters(scene, mesh, this._effect);
-
-            // Log. depth
-            MaterialHelper.BindLogDepth(this._defines, this._effect, scene);
-
+            
             // Water
             if (StandardMaterial.ReflectionTextureEnabled) {
                 this._effect.setTexture("refractionSampler", this._refractionRTT);

+ 0 - 6
materialsLibrary/materials/water/water.fragment.fx

@@ -1,7 +1,3 @@
-#ifdef LOGARITHMICDEPTH
-#extension GL_EXT_frag_depth : enable
-#endif
-
 precision highp float;
 
 // Constants
@@ -55,7 +51,6 @@ varying vec3 vReflectionMapTexCoord;
 varying vec3 vPosition;
 
 #include<clipPlaneFragmentDeclaration>
-#include<logDepthDeclaration>
 
 // Fog
 #include<fogFragmentDeclaration>
@@ -156,7 +151,6 @@ void main(void) {
 	// Composition
 	vec4 color = vec4(finalDiffuse + finalSpecular, alpha);
 
-#include<logDepthFragment>
 #include<fogFragment>
 	
 	gl_FragColor = color;

+ 0 - 7
materialsLibrary/materials/water/water.vertex.fx

@@ -48,8 +48,6 @@ varying vec4 vColor;
 #include<fogVertexDeclaration>
 #include<shadowsVertexDeclaration>[0..maxSimultaneousLights]
 
-#include<logDepthDeclaration>
-
 // Water uniforms
 uniform mat4 worldReflectionViewProjection;
 uniform vec2 windDirection;
@@ -64,8 +62,6 @@ varying vec3 vPosition;
 varying vec3 vRefractionMapTexCoord;
 varying vec3 vReflectionMapTexCoord;
 
-
-
 void main(void) {
 
     #include<instancesVertex>
@@ -138,7 +134,4 @@ void main(void) {
 	vReflectionMapTexCoord.y = 0.5 * (worldPos.w + worldPos.y);
 	vReflectionMapTexCoord.z = worldPos.w;
 #endif
-
-#include<logDepthVertex>
-
 }