2019-05-20 20:10:57 +00:00
|
|
|
|
#version 330
|
|
|
|
|
|
|
|
|
|
in vec4 point;
|
|
|
|
|
|
|
|
|
|
uniform mat4 mtxCam;
|
|
|
|
|
uniform mat4 mtxMdl;
|
|
|
|
|
|
|
|
|
|
uniform mat4 bone;
|
|
|
|
|
uniform mat4 parent;
|
|
|
|
|
uniform mat4 rotation;
|
|
|
|
|
uniform mat4 ModelMatrix;
|
|
|
|
|
uniform int hasParent;
|
|
|
|
|
uniform float scale;
|
|
|
|
|
|
|
|
|
|
void main()
|
|
|
|
|
{
|
|
|
|
|
vec4 position = bone * rotation * vec4(point.xyz * scale, 1);
|
|
|
|
|
if (hasParent == 1)
|
|
|
|
|
{
|
|
|
|
|
if (point.w == 0)
|
|
|
|
|
position = parent * rotation * vec4(point.xyz * scale, 1);
|
|
|
|
|
else
|
|
|
|
|
position = bone * rotation * vec4((point.xyz - vec3(0, 1, 0)) * scale, 1);
|
|
|
|
|
}
|
2019-10-19 21:49:20 +00:00
|
|
|
|
gl_Position = mtxCam * mtxMdl * ModelMatrix * vec4(position.xyz, 1);
|
2019-05-20 20:10:57 +00:00
|
|
|
|
}
|