mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2026-05-14 18:49:45 +08:00
Fix for leg jankyness. Added PBBNCCTTX shader
This commit is contained in:
+47
-6
@@ -537,27 +537,68 @@ namespace CodeWalker.Rendering
|
||||
bone.AnimRotation = q;
|
||||
break;
|
||||
case 2: //scale?
|
||||
v0 = aseq.EvaluateVector(f0);
|
||||
v1 = aseq.EvaluateVector(f1);
|
||||
v = interpolate ? (v0 * ialpha) + (v1 * falpha) : v0;
|
||||
bone.AnimScale = v.XYZ();
|
||||
break;
|
||||
case 5://vector3...
|
||||
//v0 = aseq.EvaluateVector(f0);
|
||||
//v1 = aseq.EvaluateVector(f1);
|
||||
//v = interpolate ? (v0 * ialpha) + (v1 * falpha) : v0;
|
||||
//bone.AnimScale = v.XYZ();
|
||||
case 5://root motion vector
|
||||
if (bone.Tag != 0)
|
||||
{ }
|
||||
//v0 = aseq.EvaluateVector(f0);
|
||||
//v1 = aseq.EvaluateVector(f1);
|
||||
//v = interpolate ? (v0 * ialpha) + (v1 * falpha) : v0;
|
||||
//bone.AnimTranslation += v.XYZ();
|
||||
break;
|
||||
case 6://quaternion...
|
||||
case 6://quaternion... root rotation?
|
||||
if (bone.Tag != 0)
|
||||
{ }
|
||||
//q0 = new Quaternion(aseq.EvaluateVector(f0));
|
||||
//q1 = new Quaternion(aseq.EvaluateVector(f1));
|
||||
//q = interpolate ? Quaternion.Slerp(q0, q1, falpha) : q0;
|
||||
//bone.AnimRotation *= q;
|
||||
break;
|
||||
case 7://vector3... (camera position?)
|
||||
break;
|
||||
case 8://quaternion... (camera rotation?)
|
||||
break;
|
||||
case 27:
|
||||
case 50:
|
||||
case 134://single float?
|
||||
case 136:
|
||||
case 137:
|
||||
case 138:
|
||||
case 139:
|
||||
case 140:
|
||||
if (bone.Tag != 0)
|
||||
{ }
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < bones.Count; i++)
|
||||
{
|
||||
var bone = bones[i];
|
||||
var tag = bone.Tag;
|
||||
switch (bone.Tag)
|
||||
{
|
||||
case 23639: tag = 58271; break; //RB_L_ThighRoll: SKEL_L_Thigh
|
||||
case 6442: tag = 51826; break; //RB_R_ThighRoll: SKEL_R_Thigh
|
||||
//case 61007: tag = 61163; break; //RB_L_ForeArmRoll: SKEL_L_Forearm //NOT GOOD
|
||||
//case 5232: tag = 45509; break; //RB_L_ArmRoll: SKEL_L_UpperArm
|
||||
}
|
||||
if (tag != bone.Tag)
|
||||
{
|
||||
var obone = bone;
|
||||
if (skel.BonesMap.TryGetValue(tag, out obone))
|
||||
{
|
||||
bone.AnimRotation = obone.AnimRotation;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < bones.Count; i++)
|
||||
{
|
||||
var bone = bones[i];
|
||||
|
||||
@@ -138,6 +138,7 @@ namespace CodeWalker.Rendering
|
||||
VertexShader basicvspbbncttt;
|
||||
VertexShader basicvspbbncct;
|
||||
VertexShader basicvspbbncctx;
|
||||
VertexShader basicvspbbnccttx;
|
||||
VertexShader basicvspbbncttx;
|
||||
VertexShader basicvsbox;
|
||||
VertexShader basicvssphere;
|
||||
@@ -199,6 +200,7 @@ namespace CodeWalker.Rendering
|
||||
byte[] vspbbnctttbytes = File.ReadAllBytes("Shaders\\BasicVS_PBBNCTTT.cso");
|
||||
byte[] vspbbncctbytes = File.ReadAllBytes("Shaders\\BasicVS_PBBNCCT.cso");
|
||||
byte[] vspbbncctxbytes = File.ReadAllBytes("Shaders\\BasicVS_PBBNCCTX.cso");
|
||||
byte[] vspbbnccttxbytes = File.ReadAllBytes("Shaders\\BasicVS_PBBNCCTTX.cso");
|
||||
byte[] vspbbncttxbytes = File.ReadAllBytes("Shaders\\BasicVS_PBBNCTTX.cso");
|
||||
|
||||
byte[] vsboxbytes = File.ReadAllBytes("Shaders\\BasicVS_Box.cso");
|
||||
@@ -225,6 +227,7 @@ namespace CodeWalker.Rendering
|
||||
basicvspbbncttt = new VertexShader(device, vspbbnctttbytes);
|
||||
basicvspbbncct = new VertexShader(device, vspbbncctbytes);
|
||||
basicvspbbncctx = new VertexShader(device, vspbbncctxbytes);
|
||||
basicvspbbnccttx = new VertexShader(device, vspbbnccttxbytes);
|
||||
basicvspbbncttx = new VertexShader(device, vspbbncttxbytes);
|
||||
basicvsbox = new VertexShader(device, vsboxbytes);
|
||||
basicvssphere = new VertexShader(device, vsspherebytes);
|
||||
@@ -281,7 +284,7 @@ namespace CodeWalker.Rendering
|
||||
layouts.Add(VertexType.PBBNCCTX, new InputLayout(device, vspbbncctxbytes, VertexTypePBBNCCTX.GetLayout()));
|
||||
layouts.Add(VertexType.PBBNCTTX, new InputLayout(device, vspbbncttxbytes, VertexTypePBBNCTTX.GetLayout()));
|
||||
layouts.Add(VertexType.PBBNCTTTX, new InputLayout(device, vspbbncttxbytes, VertexTypePBBNCTTTX.GetLayout()));//TODO
|
||||
layouts.Add(VertexType.PBBNCCTTX, new InputLayout(device, vspbbncctxbytes, VertexTypePBBNCCTTX.GetLayout()));//TODO
|
||||
layouts.Add(VertexType.PBBNCCTTX, new InputLayout(device, vspbbnccttxbytes, VertexTypePBBNCCTTX.GetLayout()));
|
||||
//PBBCCT todo
|
||||
//PBBNC todo
|
||||
|
||||
@@ -469,8 +472,8 @@ namespace CodeWalker.Rendering
|
||||
case VertexType.PBBNCTTX:
|
||||
vs = basicvspbbncttx;
|
||||
break;
|
||||
case VertexType.PBBNCCTTX://not used?
|
||||
vs = basicvspbbncctx;//TODO
|
||||
case VertexType.PBBNCCTTX:
|
||||
vs = basicvspbbnccttx;
|
||||
break;
|
||||
case VertexType.PBBNCTTTX:
|
||||
vs = basicvspbbncttx;//TODO
|
||||
@@ -1023,6 +1026,7 @@ namespace CodeWalker.Rendering
|
||||
basicvspbbncttt.Dispose();
|
||||
basicvspbbncct.Dispose();
|
||||
basicvspbbncctx.Dispose();
|
||||
basicvspbbnccttx.Dispose();
|
||||
basicvspbbncttx.Dispose();
|
||||
basicvsbox.Dispose();
|
||||
basicvssphere.Dispose();
|
||||
|
||||
Reference in New Issue
Block a user