소스 검색

Code cleanup

David Catuhe 9 년 전
부모
커밋
8ecdb13c2d

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 9 - 9
dist/preview release/babylon.core.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1886 - 1886
dist/preview release/babylon.d.ts


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 21 - 21
dist/preview release/babylon.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 4 - 4
dist/preview release/babylon.max.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 16 - 16
dist/preview release/babylon.noworker.js


+ 1 - 4
materialsLibrary/materials/normal/babylon.normalMaterial.ts

@@ -294,10 +294,7 @@ module BABYLON {
                     this._effect.setMatrix("diffuseMatrix", this.diffuseTexture.getTextureMatrix());
                 }
                 // Clip plane
-                if (scene.clipPlane) {
-                    var clipPlane = scene.clipPlane;
-                    this._effect.setFloat4("vClipPlane", clipPlane.normal.x, clipPlane.normal.y, clipPlane.normal.z, clipPlane.d);
-                }
+                MaterialHelper.BindClipPlane(this._effect, scene);
 
                 // Point size
                 if (this.pointsCloud) {

+ 2 - 4
materialsLibrary/materials/simple/babylon.simpleMaterial.ts

@@ -295,11 +295,9 @@ module BABYLON {
                     this._effect.setFloat2("vDiffuseInfos", this.diffuseTexture.coordinatesIndex, this.diffuseTexture.level);
                     this._effect.setMatrix("diffuseMatrix", this.diffuseTexture.getTextureMatrix());
                 }
+                
                 // Clip plane
-                if (scene.clipPlane) {
-                    var clipPlane = scene.clipPlane;
-                    this._effect.setFloat4("vClipPlane", clipPlane.normal.x, clipPlane.normal.y, clipPlane.normal.z, clipPlane.d);
-                }
+                MaterialHelper.BindClipPlane(this._effect, scene);
 
                 // Point size
                 if (this.pointsCloud) {

+ 3 - 3
src/Materials/babylon.standardMaterial.js

@@ -498,9 +498,9 @@ var BABYLON;
                 BABYLON.MaterialHelper.PrepareAttributesForInstances(attribs, this._defines);
                 // Legacy browser patch
                 var shaderName = "default";
-                if (!scene.getEngine().getCaps().standardDerivatives) {
-                    shaderName = "legacydefault";
-                }
+                // if (!scene.getEngine().getCaps().standardDerivatives) {
+                shaderName = "legacydefault";
+                //}
                 var join = this._defines.toString();
                 this._effect = scene.getEngine().createEffect(shaderName, attribs, ["world", "view", "viewProjection", "vEyePosition", "vLightsType", "vAmbientColor", "vDiffuseColor", "vSpecularColor", "vEmissiveColor",
                     "vLightData0", "vLightDiffuse0", "vLightSpecular0", "vLightDirection0", "vLightGround0", "lightMatrix0",

+ 2 - 2
src/Materials/babylon.standardMaterial.ts

@@ -588,9 +588,9 @@
                 
                 // Legacy browser patch
                 var shaderName = "default";
-                if (!scene.getEngine().getCaps().standardDerivatives) {
+               // if (!scene.getEngine().getCaps().standardDerivatives) {
                     shaderName = "legacydefault";
-                }
+                //}
                 var join = this._defines.toString();
                 this._effect = scene.getEngine().createEffect(shaderName,
                     attribs,

+ 2 - 12
src/Shaders/legacydefault.fragment.fx

@@ -97,21 +97,11 @@ uniform vec4 emissiveLeftColor;
 uniform vec4 emissiveRightColor;
 #endif
 
-// Shadows
-
-#ifdef CLIPPLANE
-varying float fClipDistance;
-#endif
-
-// Fog
+#include<clipPlaneFragmentDeclaration>
 #include<fogFragmentDeclaration>
 
 void main(void) {
-	// Clip plane
-#ifdef CLIPPLANE
-	if (fClipDistance > 0.0)
-		discard;
-#endif
+#include<clipPlaneFragment>
 
 	vec3 viewDirectionW = normalize(vEyePosition - vPositionW);
 

+ 2 - 10
src/Shaders/legacydefault.vertex.fx

@@ -63,11 +63,7 @@ varying vec3 vNormalW;
 varying vec4 vColor;
 #endif
 
-#ifdef CLIPPLANE
-uniform vec4 vClipPlane;
-varying float fClipDistance;
-#endif
-
+#include<clipPlaneVertexDeclaration>
 #include<fogVertexDeclaration>
 #include<shadowsVertexDeclaration>
 
@@ -203,11 +199,7 @@ void main(void) {
 	}
 #endif
 
-	// Clip plane
-#ifdef CLIPPLANE
-	fClipDistance = dot(worldPos, vClipPlane);
-#endif
-
+#include<clipPlaneVertex>
 #include<fogVertex>
 #include<shadowsVertex>