varying float height;
uniform mat4 Eng_ObjectWaterShadowMatrix, Eng_ObjectMatrix;
uniform mat4 Eng_Bones[16];

attribute float Bone1, Bone2, Bone1Weight;

void main()
{

	vec4 v1 = gl_Vertex;
	vec4 v2 = gl_Vertex;

/*	if (Bone1 > -0.1)
	{*/
		int b1 = int(Bone1);
        v1 = Eng_Bones[b1] * gl_Vertex;
/* 	}

	if (Bone2 > -0.1)
	{*/
		int b2 = int(Bone2);
        v2 = Eng_Bones[b2] * gl_Vertex;
 /*	}

	if (Bone1Weight >= 0.0)*/
		v1 = mix(v2, v1, Bone1Weight);

	vec4 wvert = Eng_ObjectMatrix * v1;
	height = wvert.z;
	
	gl_Position = Eng_ObjectWaterShadowMatrix * wvert;
}