Browse Source

Merge pull request #2821 from bghgary/tangent-space-fix

InvertNormalMapX/Y now invert the tangent space instead of normal map
David Catuhe 8 years ago
parent
commit
45bdd70cee
25 changed files with 38 additions and 58 deletions
  1. 3 3
      loaders/src/glTF/2.0/babylon.glTFLoader.ts
  2. 0 1
      materialsLibrary/src/cell/babylon.cellMaterial.ts
  3. 5 6
      materialsLibrary/src/custom/babylon.customMaterial.ts
  4. 0 1
      materialsLibrary/src/fur/babylon.furMaterial.ts
  5. 0 1
      materialsLibrary/src/gradient/babylon.gradientMaterial.ts
  6. 0 1
      materialsLibrary/src/lava/babylon.lavaMaterial.ts
  7. 5 6
      materialsLibrary/src/legacyPBR/babylon.legacyPBRMaterial.ts
  8. 2 2
      materialsLibrary/src/legacyPBR/babylon.legacyPbrMaterial.js.include.fx
  9. 1 1
      materialsLibrary/src/legacyPBR/legacyPbrFragmentDeclaration.fx
  10. 1 1
      materialsLibrary/src/legacyPBR/legacyPbrUboDeclaration.fx
  11. 0 1
      materialsLibrary/src/normal/babylon.normalMaterial.ts
  12. 0 1
      materialsLibrary/src/shadowOnly/babylon.shadowOnlyMaterial.ts
  13. 0 1
      materialsLibrary/src/simple/babylon.simpleMaterial.ts
  14. 0 1
      materialsLibrary/src/sky/babylon.skyMaterial.ts
  15. 0 1
      materialsLibrary/src/terrain/babylon.terrainMaterial.ts
  16. 0 1
      materialsLibrary/src/triPlanar/babylon.triPlanarMaterial.ts
  17. 0 1
      materialsLibrary/src/water/babylon.waterMaterial.ts
  18. 5 8
      src/Materials/PBR/babylon.pbrBaseMaterial.ts
  19. 0 1
      src/Materials/babylon.materialHelper.ts
  20. 5 6
      src/Materials/babylon.standardMaterial.ts
  21. 7 9
      src/Shaders/ShadersInclude/bumpFragmentFunctions.fx
  22. 1 1
      src/Shaders/ShadersInclude/defaultFragmentDeclaration.fx
  23. 1 1
      src/Shaders/ShadersInclude/defaultUboDeclaration.fx
  24. 1 1
      src/Shaders/ShadersInclude/pbrFragmentDeclaration.fx
  25. 1 1
      src/Shaders/ShadersInclude/pbrUboDeclaration.fx

+ 3 - 3
loaders/src/glTF/2.0/babylon.glTFLoader.ts

@@ -1002,7 +1002,7 @@ module BABYLON.GLTF2 {
             if (this._blockPendingTracking) {
                 this.addLoaderNonBlockingPendingData(data);
                 return;
-            }            
+            }
             this._loaderPendingCount++;
         }
 
@@ -1100,8 +1100,8 @@ module BABYLON.GLTF2 {
 
             if (material.normalTexture) {
                 babylonMaterial.bumpTexture = this.loadTexture(material.normalTexture);
-                babylonMaterial.invertNormalMapX = true;
-                babylonMaterial.invertNormalMapY = false;
+                babylonMaterial.invertNormalMapX = !this._babylonScene.useRightHandedSystem;
+                babylonMaterial.invertNormalMapY = this._babylonScene.useRightHandedSystem;
                 if (material.normalTexture.scale !== undefined) {
                     babylonMaterial.bumpTexture.level = material.normalTexture.scale;
                 }

+ 0 - 1
materialsLibrary/src/cell/babylon.cellMaterial.ts

@@ -19,7 +19,6 @@ module BABYLON {
         public CUSTOMUSERLIGHTING = true;
         public CELLBASIC = true;
         public DEPTHPREPASS = false;
-        public USERIGHTHANDEDSYSTEM = false;
 
         constructor() {
             super();

+ 5 - 6
materialsLibrary/src/custom/babylon.customMaterial.ts

@@ -63,7 +63,6 @@ module BABYLON {
         public MORPHTARGETS_NORMAL = false;
         public MORPHTARGETS_TANGENT = false;
         public NUM_MORPH_INFLUENCERS = 0;
-        public USERIGHTHANDEDSYSTEM = false;
 
         public IMAGEPROCESSING = false;
         public VIGNETTE = false;
@@ -823,7 +822,7 @@ module BABYLON {
                     "mBones",
                     "vClipPlane", "diffuseMatrix", "ambientMatrix", "opacityMatrix", "reflectionMatrix", "emissiveMatrix", "specularMatrix", "bumpMatrix", "lightmapMatrix", "refractionMatrix",
                     "diffuseLeftColor", "diffuseRightColor", "opacityParts", "reflectionLeftColor", "reflectionRightColor", "emissiveLeftColor", "emissiveRightColor", "refractionLeftColor", "refractionRightColor",
-                    "logarithmicDepthConstant", "vNormalReorderParams"
+                    "logarithmicDepthConstant", "vTangentSpaceParams"
                 ];
 
                 var samplers = ["diffuseSampler", "ambientSampler", "opacitySampler", "reflectionCubeSampler", "reflection2DSampler", "emissiveSampler", "specularSampler", "bumpSampler", "lightmapSampler", "refractionCubeSampler", "refraction2DSampler"]
@@ -900,7 +899,7 @@ module BABYLON {
             this._uniformBuffer.addUniform("lightmapMatrix", 16);
             this._uniformBuffer.addUniform("specularMatrix", 16);
             this._uniformBuffer.addUniform("bumpMatrix", 16);
-            this._uniformBuffer.addUniform("vNormalReorderParams", 4);            
+            this._uniformBuffer.addUniform("vTangentSpaceParams", 2);
             this._uniformBuffer.addUniform("refractionMatrix", 16);
             this._uniformBuffer.addUniform("vRefractionInfos", 4);
             this._uniformBuffer.addUniform("vSpecularColor", 4);
@@ -1016,10 +1015,10 @@ module BABYLON {
                             this._uniformBuffer.updateMatrix("bumpMatrix", this._bumpTexture.getTextureMatrix());
 
                             if (scene._mirroredCameraPosition) {
-                                this._uniformBuffer.updateFloat4("vNormalReorderParams", this.invertNormalMapX ? 0 : 1.0, this.invertNormalMapX ? 1.0 : -1.0, this.invertNormalMapY ? 0 : 1.0, this.invertNormalMapY ? 1.0 : -1.0);
+                                this._uniformBuffer.updateFloat2("vTangentSpaceParams", this.invertNormalMapX ? 1.0 : -1.0, this.invertNormalMapY ? 1.0 : -1.0);
                             } else {
-                                this._uniformBuffer.updateFloat4("vNormalReorderParams", this.invertNormalMapX ? 1.0 : 0, this.invertNormalMapX ? -1.0 : 1.0, this.invertNormalMapY ? 1.0 : 0, this.invertNormalMapY ? -1.0 : 1.0);
-                            }                                                          
+                                this._uniformBuffer.updateFloat2("vTangentSpaceParams", this.invertNormalMapX ? -1.0 : 1.0, this.invertNormalMapY ? -1.0 : 1.0);
+                            }
                         }
 
                         if (this._refractionTexture && StandardMaterial_OldVer.RefractionTextureEnabled) {

+ 0 - 1
materialsLibrary/src/fur/babylon.furMaterial.ts

@@ -18,7 +18,6 @@ module BABYLON {
         public BonesPerMesh = 0;
         public INSTANCES = false;
         public HIGHLEVEL = false;
-        public USERIGHTHANDEDSYSTEM = false;
 
         constructor() {
             super();

+ 0 - 1
materialsLibrary/src/gradient/babylon.gradientMaterial.ts

@@ -49,7 +49,6 @@ module BABYLON {
         public NUM_BONE_INFLUENCERS = 0;
         public BonesPerMesh = 0;
         public INSTANCES = false;
-        public USERIGHTHANDEDSYSTEM = false;
 
         constructor() {
             super();

+ 0 - 1
materialsLibrary/src/lava/babylon.lavaMaterial.ts

@@ -49,7 +49,6 @@ module BABYLON {
         public NUM_BONE_INFLUENCERS = 0;
         public BonesPerMesh = 0;
         public INSTANCES = false;
-        public USERIGHTHANDEDSYSTEM = false;
 
         constructor() {
             super();

+ 5 - 6
materialsLibrary/src/legacyPBR/babylon.legacyPBRMaterial.ts

@@ -1139,7 +1139,7 @@ module BABYLON {
                         "vSphericalXX", "vSphericalYY", "vSphericalZZ",
                         "vSphericalXY", "vSphericalYZ", "vSphericalZX",
                         "vMicrosurfaceTextureLods",
-                        "vCameraInfos", "vNormalReorderParams"
+                        "vCameraInfos", "vTangentSpaceParams"
                 ];
 
                 var samplers = ["albedoSampler", "ambientSampler", "opacitySampler", "reflectionCubeSampler", "reflection2DSampler", "emissiveSampler", "reflectivitySampler", "microSurfaceSampler", "bumpSampler", "lightmapSampler", "refractionCubeSampler", "refraction2DSampler"];
@@ -1218,7 +1218,7 @@ module BABYLON {
             this._uniformBuffer.addUniform("reflectivityMatrix", 16);
             this._uniformBuffer.addUniform("microSurfaceSamplerMatrix", 16);
             this._uniformBuffer.addUniform("bumpMatrix", 16);
-            this._uniformBuffer.addUniform("vNormalReorderParams", 4);
+            this._uniformBuffer.addUniform("vTangentSpaceParams", 2);
             this._uniformBuffer.addUniform("refractionMatrix", 16);
             this._uniformBuffer.addUniform("reflectionMatrix", 16);
 
@@ -1364,12 +1364,11 @@ module BABYLON {
                             this._uniformBuffer.updateFloat3("vBumpInfos", this.bumpTexture.coordinatesIndex, 1.0 / this.bumpTexture.level, this.parallaxScaleBias);
                             this._uniformBuffer.updateMatrix("bumpMatrix", this.bumpTexture.getTextureMatrix());
 
-
                             if (this._myScene._mirroredCameraPosition) {
-                                this._uniformBuffer.updateFloat4("vNormalReorderParams", this.invertNormalMapX ? 0 : 1.0, this.invertNormalMapX ? 1.0 : -1.0, this.invertNormalMapY ? 0 : 1.0, this.invertNormalMapY ? 1.0 : -1.0);
+                                this._uniformBuffer.updateFloat2("vTangentSpaceParams", this.invertNormalMapX ? 1.0 : -1.0, this.invertNormalMapY ? 1.0 : -1.0);
                             } else {
-                                this._uniformBuffer.updateFloat4("vNormalReorderParams", this.invertNormalMapX ? 1.0 : 0, this.invertNormalMapX ? -1.0 : 1.0, this.invertNormalMapY ? 1.0 : 0, this.invertNormalMapY ? -1.0 : 1.0);
-                            }                              
+                                this._uniformBuffer.updateFloat2("vTangentSpaceParams", this.invertNormalMapX ? -1.0 : 1.0, this.invertNormalMapY ? -1.0 : 1.0);
+                            }
                         }
 
                         if (this.refractionTexture && StandardMaterial.RefractionTextureEnabled) {

File diff suppressed because it is too large
+ 2 - 2
materialsLibrary/src/legacyPBR/babylon.legacyPbrMaterial.js.include.fx


+ 1 - 1
materialsLibrary/src/legacyPBR/legacyPbrFragmentDeclaration.fx

@@ -36,7 +36,7 @@ uniform vec3 vAmbientInfos;
 
 #ifdef BUMP
 uniform vec3 vBumpInfos;
-uniform vec4 vNormalReorderParams;
+uniform vec2 vTangentSpaceParams;
 #endif
 
 #ifdef OPACITY	

+ 1 - 1
materialsLibrary/src/legacyPBR/legacyPbrUboDeclaration.fx

@@ -20,7 +20,7 @@ uniform Material
 	uniform mat4 reflectivityMatrix;
 	uniform mat4 microSurfaceSamplerMatrix;
 	uniform mat4 bumpMatrix;
-	uniform vec4 vNormalReorderParams;
+	uniform vec2 vTangentSpaceParams;
 	uniform mat4 refractionMatrix;
 	uniform mat4 reflectionMatrix;
 

+ 0 - 1
materialsLibrary/src/normal/babylon.normalMaterial.ts

@@ -49,7 +49,6 @@ module BABYLON {
         public NUM_BONE_INFLUENCERS = 0;
         public BonesPerMesh = 0;
         public INSTANCES = false;
-        public USERIGHTHANDEDSYSTEM = false;
 
         constructor() {
             super();

+ 0 - 1
materialsLibrary/src/shadowOnly/babylon.shadowOnlyMaterial.ts

@@ -9,7 +9,6 @@ module BABYLON {
         public NUM_BONE_INFLUENCERS = 0;
         public BonesPerMesh = 0;
         public INSTANCES = false;
-        public USERIGHTHANDEDSYSTEM = false;
 
         constructor() {
             super();

+ 0 - 1
materialsLibrary/src/simple/babylon.simpleMaterial.ts

@@ -16,7 +16,6 @@ module BABYLON {
         public NUM_BONE_INFLUENCERS = 0;
         public BonesPerMesh = 0;
         public INSTANCES = false;
-        public USERIGHTHANDEDSYSTEM = false;
 
         constructor() {
             super();

+ 0 - 1
materialsLibrary/src/sky/babylon.skyMaterial.ts

@@ -7,7 +7,6 @@ module BABYLON {
         public FOG = false;
         public VERTEXCOLOR = false;
         public VERTEXALPHA = false;
-        public USERIGHTHANDEDSYSTEM = false;
 
         constructor() {
             super();

+ 0 - 1
materialsLibrary/src/terrain/babylon.terrainMaterial.ts

@@ -19,7 +19,6 @@ module BABYLON {
         public NUM_BONE_INFLUENCERS = 0;
         public BonesPerMesh = 0;
         public INSTANCES = false;
-        public USERIGHTHANDEDSYSTEM = false;
 
         constructor() {
             super();

+ 0 - 1
materialsLibrary/src/triPlanar/babylon.triPlanarMaterial.ts

@@ -22,7 +22,6 @@ module BABYLON {
         public NUM_BONE_INFLUENCERS = 0;
         public BonesPerMesh = 0;
         public INSTANCES = false;
-        public USERIGHTHANDEDSYSTEM = false;
 
         constructor() {
             super();

+ 0 - 1
materialsLibrary/src/water/babylon.waterMaterial.ts

@@ -22,7 +22,6 @@ module BABYLON {
         public FRESNELSEPARATE = false;
         public BUMPSUPERIMPOSE = false;
         public BUMPAFFECTSREFLECTION = false;
-        public USERIGHTHANDEDSYSTEM = false;
 
         constructor() {
             super();

+ 5 - 8
src/Materials/PBR/babylon.pbrBaseMaterial.ts

@@ -112,7 +112,6 @@
         public USEPHYSICALLIGHTFALLOFF = false;
         public TWOSIDEDLIGHTING = false;
         public SHADOWFLOAT = false;
-        public USERIGHTHANDEDSYSTEM = false;
         public CLIPPLANE = false;
         public POINTSIZE = false;
         public FOG = false;
@@ -740,8 +739,6 @@
                         else {
                             defines.PARALLAX = false;
                         }
-
-                        defines.USERIGHTHANDEDSYSTEM = scene.useRightHandedSystem;
                     } else {
                         defines.BUMP = false;
                     }
@@ -929,7 +926,7 @@
                         "vSphericalXX", "vSphericalYY", "vSphericalZZ",
                         "vSphericalXY", "vSphericalYZ", "vSphericalZX",
                         "vReflectionMicrosurfaceInfos", "vRefractionMicrosurfaceInfos",
-                        "vNormalReorderParams"
+                        "vTangentSpaceParams"
                 ];
 
                 var samplers = ["albedoSampler", "reflectivitySampler", "ambientSampler", "emissiveSampler", 
@@ -1005,7 +1002,7 @@
             this._uniformBuffer.addUniform("reflectivityMatrix", 16);
             this._uniformBuffer.addUniform("microSurfaceSamplerMatrix", 16);
             this._uniformBuffer.addUniform("bumpMatrix", 16);
-            this._uniformBuffer.addUniform("vNormalReorderParams", 4);
+            this._uniformBuffer.addUniform("vTangentSpaceParams", 2);
             this._uniformBuffer.addUniform("refractionMatrix", 16);
             this._uniformBuffer.addUniform("reflectionMatrix", 16);
 
@@ -1142,10 +1139,10 @@
                             MaterialHelper.BindTextureMatrix(this._bumpTexture, this._uniformBuffer, "bump");
 
                             if (scene._mirroredCameraPosition) {
-                                this._uniformBuffer.updateFloat4("vNormalReorderParams", this._invertNormalMapX ? 0 : 1.0, this._invertNormalMapX ? 1.0 : -1.0, this._invertNormalMapY ? 0 : 1.0, this._invertNormalMapY ? 1.0 : -1.0);
+                                this._uniformBuffer.updateFloat2("vTangentSpaceParams", this._invertNormalMapX ? 1.0 : -1.0, this._invertNormalMapY ? 1.0 : -1.0);
                             } else {
-                                this._uniformBuffer.updateFloat4("vNormalReorderParams", this._invertNormalMapX ? 1.0 : 0, this._invertNormalMapX ? -1.0 : 1.0, this._invertNormalMapY ? 1.0 : 0, this._invertNormalMapY ? -1.0 : 1.0);
-                            }                                                         
+                                this._uniformBuffer.updateFloat2("vTangentSpaceParams", this._invertNormalMapX ? -1.0 : 1.0, this._invertNormalMapY ? -1.0 : 1.0);
+                            }
                         }
 
                         if (refractionTexture && StandardMaterial.RefractionTextureEnabled) {

+ 0 - 1
src/Materials/babylon.materialHelper.ts

@@ -29,7 +29,6 @@
                 defines["LOGARITHMICDEPTH"] = useLogarithmicDepth;
                 defines["POINTSIZE"] = (pointsCloud || scene.forcePointsCloud);
                 defines["FOG"] = (scene.fogEnabled && mesh.applyFog && scene.fogMode !== Scene.FOGMODE_NONE && fogEnabled);
-                defines["USERIGHTHANDEDSYSTEM"] = scene.useRightHandedSystem;
             }
         }
 

+ 5 - 6
src/Materials/babylon.standardMaterial.ts

@@ -69,7 +69,6 @@ module BABYLON {
         public MORPHTARGETS_NORMAL = false;
         public MORPHTARGETS_TANGENT = false;
         public NUM_MORPH_INFLUENCERS = 0;
-        public USERIGHTHANDEDSYSTEM = false;
 
         public IMAGEPROCESSING = false;
         public VIGNETTE = false;
@@ -843,7 +842,7 @@ module BABYLON {
                     "mBones",
                     "vClipPlane", "diffuseMatrix", "ambientMatrix", "opacityMatrix", "reflectionMatrix", "emissiveMatrix", "specularMatrix", "bumpMatrix", "lightmapMatrix", "refractionMatrix",
                     "diffuseLeftColor", "diffuseRightColor", "opacityParts", "reflectionLeftColor", "reflectionRightColor", "emissiveLeftColor", "emissiveRightColor", "refractionLeftColor", "refractionRightColor",
-                    "logarithmicDepthConstant", "vNormalReorderParams"
+                    "logarithmicDepthConstant", "vTangentSpaceParams"
                 ];
 
                 var samplers = ["diffuseSampler", "ambientSampler", "opacitySampler", "reflectionCubeSampler", "reflection2DSampler", "emissiveSampler", "specularSampler", "bumpSampler", "lightmapSampler", "refractionCubeSampler", "refraction2DSampler"]
@@ -920,7 +919,7 @@ module BABYLON {
             this._uniformBuffer.addUniform("lightmapMatrix", 16);
             this._uniformBuffer.addUniform("specularMatrix", 16);
             this._uniformBuffer.addUniform("bumpMatrix", 16);
-            this._uniformBuffer.addUniform("vNormalReorderParams", 4);
+            this._uniformBuffer.addUniform("vTangentSpaceParams", 2);
             this._uniformBuffer.addUniform("refractionMatrix", 16);
             this._uniformBuffer.addUniform("vRefractionInfos", 4);
             this._uniformBuffer.addUniform("vSpecularColor", 4);
@@ -1039,10 +1038,10 @@ module BABYLON {
                             MaterialHelper.BindTextureMatrix(this._bumpTexture, this._uniformBuffer, "bump");
 
                             if (scene._mirroredCameraPosition) {
-                                this._uniformBuffer.updateFloat4("vNormalReorderParams", this.invertNormalMapX ? 0 : 1.0, this.invertNormalMapX ? 1.0 : -1.0, this.invertNormalMapY ? 0 : 1.0, this.invertNormalMapY ? 1.0 : -1.0);
+                                this._uniformBuffer.updateFloat2("vTangentSpaceParams", this.invertNormalMapX ? 1.0 : -1.0, this.invertNormalMapY ? 1.0 : -1.0);
                             } else {
-                                this._uniformBuffer.updateFloat4("vNormalReorderParams", this.invertNormalMapX ? 1.0 : 0, this.invertNormalMapX ? -1.0 : 1.0, this.invertNormalMapY ? 1.0 : 0, this.invertNormalMapY ? -1.0 : 1.0);
-                            }                           
+                                this._uniformBuffer.updateFloat2("vTangentSpaceParams", this.invertNormalMapX ? -1.0 : 1.0, this.invertNormalMapY ? -1.0 : 1.0);
+                            }
                         }
 
                         if (this._refractionTexture && StandardMaterial.RefractionTextureEnabled) {

+ 7 - 9
src/Shaders/ShadersInclude/bumpFragmentFunctions.fx

@@ -27,22 +27,20 @@
 		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;
+		vec3 bitangent = dp2perp * duv1.y + dp1perp * duv2.y;
 
-	#ifdef USERIGHTHANDEDSYSTEM
-		binormal = -binormal;
-	#endif
+		// invert the tangent/bitangent if requested
+		tangent *= vTangentSpaceParams.x;
+		bitangent *= vTangentSpaceParams.y;
 
-		// construct a scale-invariant frame 
-		float invmax = inversesqrt(max(dot(tangent, tangent), dot(binormal, binormal)));
-		return mat3(tangent * invmax, binormal * invmax, normal);
+		// construct a scale-invariant frame
+		float invmax = inversesqrt(max(dot(tangent, tangent), dot(bitangent, bitangent)));
+		return mat3(tangent * invmax, bitangent * invmax, normal);
 	}
 
 	vec3 perturbNormal(mat3 cotangentFrame, vec2 uv)
 	{
 		vec3 map = texture2D(bumpSampler, uv).xyz;
-		map.x = vNormalReorderParams.x + vNormalReorderParams.y * map.x;
-		map.y = vNormalReorderParams.z + vNormalReorderParams.w * map.y;
 
 		map = map * 255. / 127. - 128. / 127.;
 

+ 1 - 1
src/Shaders/ShadersInclude/defaultFragmentDeclaration.fx

@@ -27,7 +27,7 @@ uniform vec2 vLightmapInfos;
 
 #ifdef BUMP
 uniform vec3 vBumpInfos;
-uniform vec4 vNormalReorderParams;
+uniform vec2 vTangentSpaceParams;
 #endif
 
 #if defined(REFLECTIONMAP_SPHERICAL) || defined(REFLECTIONMAP_PROJECTION) || defined(REFRACTION)

+ 1 - 1
src/Shaders/ShadersInclude/defaultUboDeclaration.fx

@@ -27,7 +27,7 @@ uniform Material
 	mat4 lightmapMatrix;
 	mat4 specularMatrix;
 	mat4 bumpMatrix; 
-	vec4 vNormalReorderParams;
+	vec4 vTangentSpaceParams;
 	mat4 refractionMatrix;
 	vec4 vRefractionInfos;
 	vec4 vSpecularColor;

+ 1 - 1
src/Shaders/ShadersInclude/pbrFragmentDeclaration.fx

@@ -18,7 +18,7 @@ uniform vec3 vAmbientInfos;
 
 #ifdef BUMP
 uniform vec3 vBumpInfos;
-uniform vec4 vNormalReorderParams;
+uniform vec2 vTangentSpaceParams;
 #endif
 
 #ifdef OPACITY	

+ 1 - 1
src/Shaders/ShadersInclude/pbrUboDeclaration.fx

@@ -20,7 +20,7 @@ uniform Material
 	uniform mat4 reflectivityMatrix;
 	uniform mat4 microSurfaceSamplerMatrix;
 	uniform mat4 bumpMatrix;
-	uniform vec4 vNormalReorderParams;
+	uniform vec2 vTangentSpaceParams;
 	uniform mat4 refractionMatrix;
 	uniform mat4 reflectionMatrix;