1
0
mirror of synced 2025-01-31 12:23:52 +01:00

A few more shader fixes

This commit is contained in:
KillzXGaming 2019-05-16 19:34:09 -04:00
parent a0dd1b4f22
commit d311562793
2 changed files with 5 additions and 4 deletions

Binary file not shown.

View File

@ -134,27 +134,28 @@ void main()
ivec4 index = ivec4(vBone);
vec4 objPos = vec4(vPosition.xyz, 1.0);
objPos = mtxMdl * vec4(objPos.xyz, 1.0);
if (vBone.x != -1.0)
objPos = skin(objPos.xyz, index);
objPos = mtxMdl * vec4(objPos.xyz, 1.0);
vec4 position = mtxCam * objPos;
normal = vNormal;
normal = mat3(mtxMdl) * normal.xyz;
if(vBone.x != -1.0)
normal = normalize((skinNRM(vNormal.xyz, index)).xyz);
normal = normalize((skinNRM(normal.xyz, index)).xyz);
if (RigidSkinning == 1)
{
position = mtxCam * (bones[index.x] * objPos);
position = mtxCam * (bones[index.x] * vec4(vPosition.xyz, 1.0));
normal = mat3(bones[index.x]) * vNormal.xyz * 1;
}
if (NoSkinning == 1)
{
position = mtxCam * (SingleBoneBindTransform * objPos);
position = mtxCam * (SingleBoneBindTransform * vec4(vPosition.xyz, 1.0));
normal = mat3(SingleBoneBindTransform) * vNormal.xyz * 1;
}