|
|
@@ -27,10 +27,7 @@ export function cloneUniforms( src ) {
|
|
|
|
|
|
const property = src[ u ][ p ];
|
|
|
|
|
|
- if ( property && ( property.isColor ||
|
|
|
- property.isMatrix3 || property.isMatrix4 ||
|
|
|
- property.isVector2 || property.isVector3 || property.isVector4 ||
|
|
|
- property.isTexture || property.isQuaternion ) ) {
|
|
|
+ if ( isThreeObject( property ) ) {
|
|
|
|
|
|
if ( property.isRenderTargetTexture ) {
|
|
|
|
|
|
@@ -45,7 +42,23 @@ export function cloneUniforms( src ) {
|
|
|
|
|
|
} else if ( Array.isArray( property ) ) {
|
|
|
|
|
|
- dst[ u ][ p ] = property.slice();
|
|
|
+ if ( isThreeObject( property[ 0 ] ) ) {
|
|
|
+
|
|
|
+ const clonedProperty = [];
|
|
|
+
|
|
|
+ for ( let i = 0, l = property.length; i < l; i ++ ) {
|
|
|
+
|
|
|
+ clonedProperty[ i ] = property[ i ].clone();
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ dst[ u ][ p ] = clonedProperty;
|
|
|
+
|
|
|
+ } else {
|
|
|
+
|
|
|
+ dst[ u ][ p ] = property.slice();
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
} else {
|
|
|
|
|
|
@@ -89,6 +102,15 @@ export function mergeUniforms( uniforms ) {
|
|
|
|
|
|
}
|
|
|
|
|
|
+function isThreeObject( property ) {
|
|
|
+
|
|
|
+ return ( property && ( property.isColor ||
|
|
|
+ property.isMatrix3 || property.isMatrix4 ||
|
|
|
+ property.isVector2 || property.isVector3 || property.isVector4 ||
|
|
|
+ property.isTexture || property.isQuaternion ) );
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
export function cloneUniformsGroups( src ) {
|
|
|
|
|
|
const dst = [];
|