mirror of https://github.com/axmolengine/axmol.git
shader optimize
This commit is contained in:
parent
72057cc30a
commit
30733cf35e
|
@ -100,28 +100,25 @@ void getPositionAndNormal(out vec4 position, out vec3 normal)
|
||||||
matrixPalette1 += u_matrixPalette[matrixIndex] * blendWeight;
|
matrixPalette1 += u_matrixPalette[matrixIndex] * blendWeight;
|
||||||
matrixPalette2 += u_matrixPalette[matrixIndex + 1] * blendWeight;
|
matrixPalette2 += u_matrixPalette[matrixIndex + 1] * blendWeight;
|
||||||
matrixPalette3 += u_matrixPalette[matrixIndex + 2] * blendWeight;
|
matrixPalette3 += u_matrixPalette[matrixIndex + 2] * blendWeight;
|
||||||
|
|
||||||
|
blendWeight = a_blendWeight[2];
|
||||||
|
if (blendWeight > 0.0)
|
||||||
|
{
|
||||||
|
matrixIndex = int(a_blendIndex[2]) * 3;
|
||||||
|
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)
|
||||||
|
{
|
||||||
|
matrixIndex = int(a_blendIndex[3]) * 3;
|
||||||
|
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)
|
|
||||||
{
|
|
||||||
matrixIndex = int(a_blendIndex[2]) * 3;
|
|
||||||
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)
|
|
||||||
{
|
|
||||||
matrixIndex = int(a_blendIndex[3]) * 3;
|
|
||||||
matrixPalette1 += u_matrixPalette[matrixIndex] * blendWeight;
|
|
||||||
matrixPalette2 += u_matrixPalette[matrixIndex + 1] * blendWeight;
|
|
||||||
matrixPalette3 += u_matrixPalette[matrixIndex + 2] * blendWeight;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
vec4 p = vec4(a_position, 1.0);
|
vec4 p = vec4(a_position, 1.0);
|
||||||
position.x = dot(p, matrixPalette1);
|
position.x = dot(p, matrixPalette1);
|
||||||
|
|
|
@ -46,28 +46,25 @@ vec4 getPosition()
|
||||||
matrixPalette1 += u_matrixPalette[matrixIndex] * blendWeight;
|
matrixPalette1 += u_matrixPalette[matrixIndex] * blendWeight;
|
||||||
matrixPalette2 += u_matrixPalette[matrixIndex + 1] * blendWeight;
|
matrixPalette2 += u_matrixPalette[matrixIndex + 1] * blendWeight;
|
||||||
matrixPalette3 += u_matrixPalette[matrixIndex + 2] * blendWeight;
|
matrixPalette3 += u_matrixPalette[matrixIndex + 2] * blendWeight;
|
||||||
|
|
||||||
|
blendWeight = a_blendWeight[2];
|
||||||
|
if (blendWeight > 0.0)
|
||||||
|
{
|
||||||
|
matrixIndex = int(a_blendIndex[2]) * 3;
|
||||||
|
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)
|
||||||
|
{
|
||||||
|
matrixIndex = int(a_blendIndex[3]) * 3;
|
||||||
|
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)
|
|
||||||
{
|
|
||||||
matrixIndex = int(a_blendIndex[2]) * 3;
|
|
||||||
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)
|
|
||||||
{
|
|
||||||
matrixIndex = int(a_blendIndex[3]) * 3;
|
|
||||||
matrixPalette1 += u_matrixPalette[matrixIndex] * blendWeight;
|
|
||||||
matrixPalette2 += u_matrixPalette[matrixIndex + 1] * blendWeight;
|
|
||||||
matrixPalette3 += u_matrixPalette[matrixIndex + 2] * blendWeight;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
vec4 _skinnedPosition;
|
vec4 _skinnedPosition;
|
||||||
vec4 postion = vec4(a_position, 1.0);
|
vec4 postion = vec4(a_position, 1.0);
|
||||||
|
|
Loading…
Reference in New Issue