-uniform int uNumberOfBlendShapes; ///< Total number of blend shapes loaded.
-uniform float uBlendShapeWeight[MAX_BLEND_SHAPE_NUMBER]; ///< The weight of each blend shape.
+uniform float uNumberOfBlendShapes; ///< Total number of blend shapes loaded.
+uniform highp float uBlendShapeWeight[MAX_BLEND_SHAPE_NUMBER]; ///< The weight of each blend shape.
#ifdef MORPH_VERSION_2_0
uniform float uBlendShapeUnnormalizeFactor; ///< Factor used to unnormalize the geometry of the blend shape.
#else
uniform float uBlendShapeUnnormalizeFactor[MAX_BLEND_SHAPE_NUMBER]; ///< Factor used to unnormalize the geometry of the blend shape.
#endif
#ifdef MORPH_VERSION_2_0
uniform float uBlendShapeUnnormalizeFactor; ///< Factor used to unnormalize the geometry of the blend shape.
#else
uniform float uBlendShapeUnnormalizeFactor[MAX_BLEND_SHAPE_NUMBER]; ///< Factor used to unnormalize the geometry of the blend shape.
#endif
-uniform int uBlendShapeComponentSize; ///< The size in the texture of either the vertices, normals or tangents. Used to calculate the offset to address them.
+uniform float uBlendShapeComponentSize; ///< The size in the texture of either the vertices, normals or tangents. Used to calculate the offset to address them.
#endif
void main()
{
#endif
void main()
{
- vec4 position = vec4(aPosition, 1.0);
- vec3 normal = aNormal;
- vec3 tangent = aTangent;
+ highp vec4 position = vec4(aPosition, 1.0);
+ highp vec3 normal = aNormal;
+ highp vec3 tangent = aTangent.xyz;
#ifdef MORPH
int width = textureSize( sBlendShapeGeometry, 0 ).x;
int blendShapeBufferOffset = 0;
#ifdef MORPH
int width = textureSize( sBlendShapeGeometry, 0 ).x;
int blendShapeBufferOffset = 0;
- for( int index = 0; index < uNumberOfBlendShapes; ++index )
+ int blendShapeComponentSize = int(uBlendShapeComponentSize);
+ int numberOfBlendShapes = int(uNumberOfBlendShapes);
+
+ for( int index = 0; index < numberOfBlendShapes; ++index )
{
{
+ highp vec3 diff = vec3(0.0);
+
#ifdef MORPH_POSITION
// Calculate the index to retrieve the geometry from the texture.
int vertexId = gl_VertexID + blendShapeBufferOffset;
int x = vertexId % width;
int y = vertexId / width;
#ifdef MORPH_POSITION
// Calculate the index to retrieve the geometry from the texture.
int vertexId = gl_VertexID + blendShapeBufferOffset;
int x = vertexId % width;
int y = vertexId / width;
- vec3 diff = vec3(0.0);
// Retrieves the blend shape geometry from the texture, unnormalizes it and multiply by the weight.
if( 0.0 != uBlendShapeWeight[index] )
{
// Retrieves the blend shape geometry from the texture, unnormalizes it and multiply by the weight.