|
@@ -624,6 +624,7 @@ function WebGLRenderer( parameters ) {
|
|
|
|
|
|
if ( ! material.isMeshPhongMaterial &&
|
|
if ( ! material.isMeshPhongMaterial &&
|
|
! material.isMeshStandardMaterial &&
|
|
! material.isMeshStandardMaterial &&
|
|
|
|
+ ! material.isMeshNormalMaterial &&
|
|
material.shading === FlatShading ) {
|
|
material.shading === FlatShading ) {
|
|
|
|
|
|
for ( var i = 0, l = object.count * 3; i < l; i += 9 ) {
|
|
for ( var i = 0, l = object.count * 3; i < l; i += 9 ) {
|
|
@@ -1863,6 +1864,7 @@ function WebGLRenderer( parameters ) {
|
|
material.isMeshLambertMaterial ||
|
|
material.isMeshLambertMaterial ||
|
|
material.isMeshPhongMaterial ||
|
|
material.isMeshPhongMaterial ||
|
|
material.isMeshStandardMaterial ||
|
|
material.isMeshStandardMaterial ||
|
|
|
|
+ material.isMeshNormalMaterial ||
|
|
material.isMeshDepthMaterial ) {
|
|
material.isMeshDepthMaterial ) {
|
|
|
|
|
|
refreshUniformsCommon( m_uniforms, material );
|
|
refreshUniformsCommon( m_uniforms, material );
|
|
@@ -1916,7 +1918,7 @@ function WebGLRenderer( parameters ) {
|
|
|
|
|
|
} else if ( material.isMeshNormalMaterial ) {
|
|
} else if ( material.isMeshNormalMaterial ) {
|
|
|
|
|
|
- m_uniforms.opacity.value = material.opacity;
|
|
|
|
|
|
+ refreshUniformsNormal( m_uniforms, material );
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2217,6 +2219,32 @@ function WebGLRenderer( parameters ) {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ function refreshUniformsNormal( uniforms, material ) {
|
|
|
|
+
|
|
|
|
+ if ( material.bumpMap ) {
|
|
|
|
+
|
|
|
|
+ uniforms.bumpMap.value = material.bumpMap;
|
|
|
|
+ uniforms.bumpScale.value = material.bumpScale;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if ( material.normalMap ) {
|
|
|
|
+
|
|
|
|
+ uniforms.normalMap.value = material.normalMap;
|
|
|
|
+ uniforms.normalScale.value.copy( material.normalScale );
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if ( material.displacementMap ) {
|
|
|
|
+
|
|
|
|
+ uniforms.displacementMap.value = material.displacementMap;
|
|
|
|
+ uniforms.displacementScale.value = material.displacementScale;
|
|
|
|
+ uniforms.displacementBias.value = material.displacementBias;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
// If uniforms are marked as clean, they don't need to be loaded to the GPU.
|
|
// If uniforms are marked as clean, they don't need to be loaded to the GPU.
|
|
|
|
|
|
function markUniformsLightsNeedsUpdate( uniforms, value ) {
|
|
function markUniformsLightsNeedsUpdate( uniforms, value ) {
|