|
@@ -54,6 +54,7 @@
|
|
public TANGENT = false;
|
|
public TANGENT = false;
|
|
public BUMP = false;
|
|
public BUMP = false;
|
|
public BUMPDIRECTUV = 0;
|
|
public BUMPDIRECTUV = 0;
|
|
|
|
+ public OBJECTSPACE_NORMALMAP = false;
|
|
public PARALLAX = false;
|
|
public PARALLAX = false;
|
|
public PARALLAXOCCLUSION = false;
|
|
public PARALLAXOCCLUSION = false;
|
|
public NORMALXYSCALE = true;
|
|
public NORMALXYSCALE = true;
|
|
@@ -344,6 +345,11 @@
|
|
protected _useRadianceOverAlpha = true;
|
|
protected _useRadianceOverAlpha = true;
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
+ * Allows using an object space normal map (instead of tangent space).
|
|
|
|
+ */
|
|
|
|
+ protected _useObjectSpaceNormalMap = false;
|
|
|
|
+
|
|
|
|
+ /**
|
|
* Allows using the bump map in parallax mode.
|
|
* Allows using the bump map in parallax mode.
|
|
*/
|
|
*/
|
|
protected _useParallax = false;
|
|
protected _useParallax = false;
|
|
@@ -815,9 +821,11 @@
|
|
else {
|
|
else {
|
|
defines.PARALLAX = false;
|
|
defines.PARALLAX = false;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ defines.OBJECTSPACE_NORMALMAP = this._useObjectSpaceNormalMap;
|
|
} else {
|
|
} else {
|
|
defines.BUMP = false;
|
|
defines.BUMP = false;
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
|
|
|
var refractionTexture = this._getRefractionTexture();
|
|
var refractionTexture = this._getRefractionTexture();
|
|
if (refractionTexture && StandardMaterial.RefractionTextureEnabled) {
|
|
if (refractionTexture && StandardMaterial.RefractionTextureEnabled) {
|
|
@@ -1054,7 +1062,7 @@
|
|
"vFogInfos", "vFogColor", "pointSize",
|
|
"vFogInfos", "vFogColor", "pointSize",
|
|
"vAlbedoInfos", "vAmbientInfos", "vOpacityInfos", "vReflectionInfos", "vEmissiveInfos", "vReflectivityInfos", "vMicroSurfaceSamplerInfos", "vBumpInfos", "vLightmapInfos", "vRefractionInfos",
|
|
"vAlbedoInfos", "vAmbientInfos", "vOpacityInfos", "vReflectionInfos", "vEmissiveInfos", "vReflectivityInfos", "vMicroSurfaceSamplerInfos", "vBumpInfos", "vLightmapInfos", "vRefractionInfos",
|
|
"mBones",
|
|
"mBones",
|
|
- "vClipPlane", "albedoMatrix", "ambientMatrix", "opacityMatrix", "reflectionMatrix", "emissiveMatrix", "reflectivityMatrix", "microSurfaceSamplerMatrix", "bumpMatrix", "lightmapMatrix", "refractionMatrix",
|
|
|
|
|
|
+ "vClipPlane", "albedoMatrix", "ambientMatrix", "opacityMatrix", "reflectionMatrix", "emissiveMatrix", "reflectivityMatrix", "normalMatrix", "microSurfaceSamplerMatrix", "bumpMatrix", "lightmapMatrix", "refractionMatrix",
|
|
"vLightingIntensity",
|
|
"vLightingIntensity",
|
|
"logarithmicDepthConstant",
|
|
"logarithmicDepthConstant",
|
|
"vSphericalX", "vSphericalY", "vSphericalZ",
|
|
"vSphericalX", "vSphericalY", "vSphericalZ",
|
|
@@ -1165,11 +1173,7 @@
|
|
|
|
|
|
super.unbind();
|
|
super.unbind();
|
|
}
|
|
}
|
|
-
|
|
|
|
- public bindOnlyWorldMatrix(world: Matrix): void {
|
|
|
|
- this._activeEffect.setMatrix("world", world);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+
|
|
public bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void {
|
|
public bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void {
|
|
var scene = this.getScene();
|
|
var scene = this.getScene();
|
|
|
|
|
|
@@ -1189,6 +1193,13 @@
|
|
// Matrices
|
|
// Matrices
|
|
this.bindOnlyWorldMatrix(world);
|
|
this.bindOnlyWorldMatrix(world);
|
|
|
|
|
|
|
|
+ // Normal Matrix
|
|
|
|
+ if (defines.OBJECTSPACE_NORMALMAP)
|
|
|
|
+ {
|
|
|
|
+ var normalMatrix = world.toNormalMatrix();
|
|
|
|
+ this.bindOnlyNormalMatrix(normalMatrix);
|
|
|
|
+ }
|
|
|
|
+
|
|
let mustRebind = this._mustRebind(scene, effect, mesh.visibility);
|
|
let mustRebind = this._mustRebind(scene, effect, mesh.visibility);
|
|
|
|
|
|
// Bones
|
|
// Bones
|