mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2026-05-17 02:42:42 +08:00
Ped clothes not exploding
This commit is contained in:
@@ -154,6 +154,7 @@ namespace CodeWalker.Rendering
|
||||
GpuVarsBuffer<BasicShaderInstGlobals> InstGlobalVars;
|
||||
GpuVarsBuffer<BasicShaderInstLocals> InstLocalVars;
|
||||
GpuABuffer<Matrix3_s> BoneMatrices;
|
||||
GpuABuffer<Vector4> ClothVertices;
|
||||
SamplerState texsampler;
|
||||
SamplerState texsampleranis;
|
||||
SamplerState texsamplertnt;
|
||||
@@ -244,6 +245,7 @@ namespace CodeWalker.Rendering
|
||||
InstGlobalVars = new GpuVarsBuffer<BasicShaderInstGlobals>(device);
|
||||
InstLocalVars = new GpuVarsBuffer<BasicShaderInstLocals>(device);
|
||||
BoneMatrices = new GpuABuffer<Matrix3_s>(device, 255);
|
||||
ClothVertices = new GpuABuffer<Vector4>(device, 254);
|
||||
|
||||
InitInstGlobalVars();
|
||||
|
||||
@@ -584,6 +586,10 @@ namespace CodeWalker.Rendering
|
||||
SetBoneMatrices(context, defaultBoneMatrices);
|
||||
defaultBoneMatricesBound = true;
|
||||
}
|
||||
if (model.Owner.Cloth?.Vertices != null)
|
||||
{
|
||||
SetClothVertices(context, model.Owner.Cloth.Vertices);
|
||||
}
|
||||
|
||||
if (!model.UseTransform) return;
|
||||
VSModelVars.Vars.Transform = Matrix.Transpose(model.Transform);
|
||||
@@ -829,6 +835,12 @@ namespace CodeWalker.Rendering
|
||||
BoneMatrices.SetVSCBuffer(context, 7);
|
||||
}
|
||||
|
||||
public void SetClothVertices(DeviceContext context, Vector4[] vertices)
|
||||
{
|
||||
ClothVertices.Update(context, vertices);
|
||||
ClothVertices.SetVSCBuffer(context, 8);
|
||||
}
|
||||
|
||||
|
||||
public void SetInstanceVars(DeviceContext context, RenderableInstanceBatch batch)
|
||||
{
|
||||
@@ -1020,6 +1032,7 @@ namespace CodeWalker.Rendering
|
||||
InstGlobalVars.Dispose();
|
||||
InstLocalVars.Dispose();
|
||||
BoneMatrices.Dispose();
|
||||
ClothVertices.Dispose();
|
||||
|
||||
basicps.Dispose();
|
||||
basicvspnct.Dispose();
|
||||
|
||||
@@ -65,6 +65,7 @@ namespace CodeWalker.Rendering
|
||||
GpuVarsBuffer<ShadowShaderVSModelVars> VSModelVars;
|
||||
GpuVarsBuffer<ShadowShaderGeomVars> GeomVars;
|
||||
GpuABuffer<Matrix3_s> BoneMatrices;
|
||||
GpuABuffer<Vector4> ClothVertices;
|
||||
|
||||
SamplerState texsampler;
|
||||
SamplerState texsamplerc;
|
||||
@@ -94,6 +95,7 @@ namespace CodeWalker.Rendering
|
||||
VSModelVars = new GpuVarsBuffer<ShadowShaderVSModelVars>(device);
|
||||
GeomVars = new GpuVarsBuffer<ShadowShaderGeomVars>(device);
|
||||
BoneMatrices = new GpuABuffer<Matrix3_s>(device, 255);
|
||||
ClothVertices = new GpuABuffer<Vector4>(device, 254);
|
||||
|
||||
|
||||
//supported layouts - requires Position, Normal, Colour, Texcoord
|
||||
@@ -243,6 +245,10 @@ namespace CodeWalker.Rendering
|
||||
SetBoneMatrices(context, defaultBoneMatrices);
|
||||
defaultBoneMatricesBound = true;
|
||||
}
|
||||
if (model.Owner.Cloth?.Vertices != null)
|
||||
{
|
||||
SetClothVertices(context, model.Owner.Cloth.Vertices);
|
||||
}
|
||||
|
||||
if (!model.UseTransform) return;
|
||||
VSModelVars.Vars.Transform = Matrix.Transpose(model.Transform);
|
||||
@@ -378,6 +384,12 @@ namespace CodeWalker.Rendering
|
||||
BoneMatrices.SetVSCBuffer(context, 7);
|
||||
}
|
||||
|
||||
public void SetClothVertices(DeviceContext context, Vector4[] vertices)
|
||||
{
|
||||
ClothVertices.Update(context, vertices);
|
||||
ClothVertices.SetVSCBuffer(context, 8);
|
||||
}
|
||||
|
||||
|
||||
public override void UnbindResources(DeviceContext context)
|
||||
{
|
||||
@@ -415,6 +427,7 @@ namespace CodeWalker.Rendering
|
||||
VSModelVars.Dispose();
|
||||
GeomVars.Dispose();
|
||||
BoneMatrices.Dispose();
|
||||
ClothVertices.Dispose();
|
||||
|
||||
|
||||
shadowps.Dispose();
|
||||
|
||||
Reference in New Issue
Block a user