luaacro преди 9 години
родител
ревизия
936d1fb104

Файловите разлики са ограничени, защото са твърде много
+ 1 - 1
materialsLibrary/dist/babylon.triPlanarMaterial.js


Файловите разлики са ограничени, защото са твърде много
+ 1 - 1
materialsLibrary/dist/babylon.triPlanarMaterial.min.js


+ 0 - 39
materialsLibrary/materials/triPlanar/triplanar.fragment.fx

@@ -327,45 +327,6 @@ float CalcFogFactor()
 }
 }
 #endif
 #endif
 
 
-// Bump
-#ifdef BUMP
-#extension GL_OES_standard_derivatives : enable
-// Thanks to http://www.thetenthplanet.de/archives/1180
-mat3 cotangent_frame(vec3 normal, vec3 p, vec2 uv)
-{
-	// get edge vectors of the pixel triangle
-	vec3 dp1 = dFdx(p);
-	vec3 dp2 = dFdy(p);
-	vec2 duv1 = dFdx(uv);
-	vec2 duv2 = dFdy(uv);
-
-	// solve the linear system
-	vec3 dp2perp = cross(dp2, normal);
-	vec3 dp1perp = cross(normal, dp1);
-	vec3 tangent = dp2perp * duv1.x + dp1perp * duv2.x;
-	vec3 binormal = dp2perp * duv1.y + dp1perp * duv2.y;
-
-	// construct a scale-invariant frame 
-	float invmax = inversesqrt(max(dot(tangent, tangent), dot(binormal, binormal)));
-	return mat3(tangent * invmax, binormal * invmax, normal);
-}
-
-vec3 perturbNormal(vec3 viewDir, vec3 mixColor)
-{	
-	vec3 bump1Color = texture2D(bump1Sampler, vTextureUV * diffuse1Infos).xyz;
-	vec3 bump2Color = texture2D(bump2Sampler, vTextureUV * diffuse2Infos).xyz;
-	vec3 bump3Color = texture2D(bump3Sampler, vTextureUV * diffuse3Infos).xyz;
-	
-	bump1Color.rgb *= mixColor.r;
-   	bump2Color.rgb = mix(bump1Color.rgb, bump2Color.rgb, mixColor.g);
-   	vec3 map = mix(bump2Color.rgb, bump3Color.rgb, mixColor.b);
-	
-	map = map * 255. / 127. - 128. / 127.;
-	mat3 TBN = cotangent_frame(vNormalW * vTextureInfos.y, -viewDir, vTextureUV);
-	return normalize(TBN * map);
-}
-#endif
-
 // Light Computing
 // Light Computing
 struct lightingInfo
 struct lightingInfo
 {
 {

+ 1 - 1
materialsLibrary/test/add/addtriplanar.js

@@ -7,7 +7,7 @@ window.prepareTriPlanar = function() {
     triPlanar.normalTextureY = new BABYLON.Texture("textures/grassn.png", scene);
     triPlanar.normalTextureY = new BABYLON.Texture("textures/grassn.png", scene);
     triPlanar.normalTextureZ = triPlanar.normalTextureX;
     triPlanar.normalTextureZ = triPlanar.normalTextureX;
     triPlanar.specularPower = 64;
     triPlanar.specularPower = 64;
-    triPlanar.tileSize = 2.5;
+    triPlanar.tileSize = 1.5;
     
     
     registerRangeUI("triPlanar", "tileSize", 0, 20, function(value) {
     registerRangeUI("triPlanar", "tileSize", 0, 20, function(value) {
 		triPlanar.tileSize = value;
 		triPlanar.tileSize = value;