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

Fix normals on mario's hands in costume selector

This commit is contained in:
KillzXGaming 2019-05-16 19:25:41 -04:00
parent 576da8c6e4
commit a0dd1b4f22
4 changed files with 16 additions and 10 deletions

Binary file not shown.

View File

@ -709,6 +709,10 @@ namespace Switch_Toolbox.Library
pixelInternalFormat = PixelInternalFormat.Rgba32f;
pixelType = PixelType.Float;
break;
case TEX_FORMAT.R8G8B8A8_UNORM:
case TEX_FORMAT.R8G8B8A8_UNORM_SRGB:
pixelInternalFormat = PixelInternalFormat.Rgba;
break;
default:
throw new Exception("Unsupported format! " + dds.Format);
}

View File

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