Rendering support for missing/new vertex type used by some vehicles

This commit is contained in:
dexyfex 2018-03-17 01:03:37 +11:00
parent f5d384601e
commit a85eb257be
5 changed files with 55 additions and 0 deletions

View File

@ -48,6 +48,7 @@ namespace CodeWalker.GameFiles
PCCNCTTT = 479,
PNCTT = 217,
PNCTTT = 473,
PCCNCTTTX = 16863,
}

View File

@ -1207,6 +1207,9 @@ namespace CodeWalker.Rendering
case 3631243954://{vehicle_blurredrotor.sps}
case 457610770://{vehicle_nosplash.sps}
case 3621563260://{vehicle_nowater.sps}
case 430888562://{vehicle_paint8.sps}
case 4118002252://{vehicle_paint9.sps}
case 158342452://{vehicle_detail.sps}
b = BasicBatches;
break;
case 1041778472://{vehicle_decal.sps}

View File

@ -238,6 +238,7 @@ namespace CodeWalker.Rendering
layouts.Add(VertexType.PNCTTTX_3, new InputLayout(device, vspnctttxbytes, VertexTypePNCTTTX_3.GetLayout()));
layouts.Add(VertexType.PNCTTTTX, new InputLayout(device, vspnctttxbytes, VertexTypePNCTTTTX.GetLayout()));
layouts.Add(VertexType.PNCCTTTX, new InputLayout(device, vspncctttxbytes, VertexTypePNCCTTTX.GetLayout()));
layouts.Add(VertexType.PCCNCTTTX, new InputLayout(device, vspncctttxbytes, VertexTypePCCNCTTTX.GetLayout()));
layouts.Add(VertexType.PCCNCTT, new InputLayout(device, vspnccttbytes, VertexTypePCCNCTT.GetLayout()));
@ -401,6 +402,7 @@ namespace CodeWalker.Rendering
break;
case VertexType.PNCCTTTX://not used?
case VertexType.PCCNCTTTX:
vs = basicvspncctttx;
break;

View File

@ -115,6 +115,7 @@ namespace CodeWalker.Rendering
layouts.Add(VertexType.PCCNCTTT, new InputLayout(device, vsbytes, VertexTypePCCNCTTT.GetLayout()));
layouts.Add(VertexType.PNCTT, new InputLayout(device, vsbytes, VertexTypePNCTT.GetLayout()));
layouts.Add(VertexType.PNCTTT, new InputLayout(device, vsbytes, VertexTypePNCTTT.GetLayout()));
layouts.Add(VertexType.PCCNCTTTX, new InputLayout(device, vsbytes, VertexTypePCCNCTTTX.GetLayout()));

View File

@ -866,6 +866,34 @@ namespace CodeWalker.Rendering
public struct VertexTypePCCNCTTTX //id: 1510566300, stride: 76, flags: 16863, types: 8598872888530528662, refs: 38
{
public Vector3 Component1;
public uint Component2;
public uint Component3;
public Vector3 Component4;
public uint Component5;
public Vector2 Component6;
public Vector2 Component7;
public Vector2 Component8;
public Vector4 Component9;
public static InputElement[] GetLayout()
{
return new[]
{
new InputElement("POSITION", 0, Format.R32G32B32_Float, 0, 0),
new InputElement("COLOR", 0, Format.R8G8B8A8_UNorm, 12, 0),
new InputElement("COLOR", 1, Format.R8G8B8A8_UNorm, 16, 0),
new InputElement("NORMAL", 0, Format.R32G32B32_Float, 20, 0),
new InputElement("COLOR", 2, Format.R8G8B8A8_UNorm, 32, 0),
new InputElement("TEXCOORD", 0, Format.R32G32_Float, 36, 0),
new InputElement("TEXCOORD", 1, Format.R32G32_Float, 44, 0),
new InputElement("TEXCOORD", 2, Format.R32G32_Float, 52, 0),
new InputElement("TANGENT", 0, Format.R32G32B32A32_Float, 60, 0),
};
}
}
@ -1410,6 +1438,26 @@ namespace CodeWalker.Rendering
}
//new (xmas 2017?)
public struct VertexType16863 //id: 1510566300, stride: 76, flags: 16863, types: 8598872888530528662, refs: 38
{
public Vector3 Component1;
public uint Component2;
public uint Component3;
public Vector3 Component4;
public uint Component5;
public Vector2 Component6;
public Vector2 Component7;
public Vector2 Component8;
public Vector4 Component9;
}
*/