shader optimize

This commit is contained in:
yangxiao 2014-10-20 13:41:26 +08:00
parent 72057cc30a
commit 30733cf35e
2 changed files with 36 additions and 42 deletions

View File

@ -100,8 +100,6 @@ void getPositionAndNormal(out vec4 position, out vec3 normal)
matrixPalette1 += u_matrixPalette[matrixIndex] * blendWeight;
matrixPalette2 += u_matrixPalette[matrixIndex + 1] * blendWeight;
matrixPalette3 += u_matrixPalette[matrixIndex + 2] * blendWeight;
}
blendWeight = a_blendWeight[2];
if (blendWeight > 0.0)
@ -110,8 +108,6 @@ void getPositionAndNormal(out vec4 position, out vec3 normal)
matrixPalette1 += u_matrixPalette[matrixIndex] * blendWeight;
matrixPalette2 += u_matrixPalette[matrixIndex + 1] * blendWeight;
matrixPalette3 += u_matrixPalette[matrixIndex + 2] * blendWeight;
}
blendWeight = a_blendWeight[3];
if (blendWeight > 0.0)
@ -121,7 +117,8 @@ void getPositionAndNormal(out vec4 position, out vec3 normal)
matrixPalette2 += u_matrixPalette[matrixIndex + 1] * blendWeight;
matrixPalette3 += u_matrixPalette[matrixIndex + 2] * blendWeight;
}
}
}
vec4 p = vec4(a_position, 1.0);
position.x = dot(p, matrixPalette1);

View File

@ -46,8 +46,6 @@ vec4 getPosition()
matrixPalette1 += u_matrixPalette[matrixIndex] * blendWeight;
matrixPalette2 += u_matrixPalette[matrixIndex + 1] * blendWeight;
matrixPalette3 += u_matrixPalette[matrixIndex + 2] * blendWeight;
}
blendWeight = a_blendWeight[2];
if (blendWeight > 0.0)
@ -56,8 +54,6 @@ vec4 getPosition()
matrixPalette1 += u_matrixPalette[matrixIndex] * blendWeight;
matrixPalette2 += u_matrixPalette[matrixIndex + 1] * blendWeight;
matrixPalette3 += u_matrixPalette[matrixIndex + 2] * blendWeight;
}
blendWeight = a_blendWeight[3];
if (blendWeight > 0.0)
@ -67,7 +63,8 @@ vec4 getPosition()
matrixPalette2 += u_matrixPalette[matrixIndex + 1] * blendWeight;
matrixPalette3 += u_matrixPalette[matrixIndex + 2] * blendWeight;
}
}
}
vec4 _skinnedPosition;
vec4 postion = vec4(a_position, 1.0);