首页 > 代码库 > 16090202(剑灵GPA)
16090202(剑灵GPA)
【目标】
剑灵GPA
【思路】
1
2 绘制角色DrawCall
body 5526面片
2.1【第一个DrawCall】63
RT
这个DrawCall PS VS 参数列表
VS
//// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111//// Parameters://// float4x3 BoneMatrices[75];// float4 CameraPosition;// float4x4 LocalToWorld;// float4x4 ViewProjectionMatrix;// float3x3 WorldToLocal;////// Registers://// Name Reg Size// -------------------- ----- ----// ViewProjectionMatrix c0 4// CameraPosition c4 1// BoneMatrices c5 225// LocalToWorld c230 4// WorldToLocal c234 3//
应该是这个usf
\Engine\Shaders\GpuSkinVertexFactory.usf
PS
//// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111//// Parameters://// float4 AmbientColorAndSkyFactor;// float NormalShadingOnly;// sampler2D SceneColorTexture;// float4 ScreenPositionScaleBias;// sampler2D Texture2D_0;// sampler2D Texture2D_1;// sampler2D Texture2D_2;// sampler2D Texture2D_3;// sampler2D Texture2D_4;// sampler2D Texture2D_5;// sampler2D Texture2D_6;// sampler2D Texture2D_7;// samplerCUBE TextureCube_0;// float4 UniformVector_0;// float4 UniformVector_1;// float4 UniformVector_2;// float4 UniformVector_3;// float4 UniformVector_4;// float4 UniformVector_5;// float4 UniformVector_6;// float4 UniformVector_7;// float4 UniformVector_8;// float3 vecCustomAmbient;// float4 vecFadeFogColor;////// Registers://// Name Reg Size// ------------------------ ----- ----// vecCustomAmbient c0 1// ScreenPositionScaleBias c1 1// NormalShadingOnly c4 1// UniformVector_0 c5 1// UniformVector_1 c6 1// UniformVector_2 c7 1// UniformVector_3 c8 1// UniformVector_4 c9 1// UniformVector_5 c10 1// UniformVector_6 c11 1// UniformVector_7 c12 1// UniformVector_8 c13 1// vecFadeFogColor c14 1// AmbientColorAndSkyFactor c15 1// SceneColorTexture s0 1// Texture2D_0 s1 1// Texture2D_1 s2 1// Texture2D_2 s3 1// Texture2D_3 s4 1// Texture2D_4 s5 1// Texture2D_5 s6 1// Texture2D_6 s7 1// Texture2D_7 s8 1// TextureCube_0 s9 1//
\Engine\Shaders\BasePassPixelShader.usf
小结:基础DrawCall
2.2【第二个DrawCall】246
VS
// Parameters://// float4x3 BoneMatrices[75];// float4 CameraPosition;// float3 LightDirection;// float4x4 LocalToWorld;// float4x4 ViewProjectionMatrix;// float3x3 WorldToLocal;////// Registers://// Name Reg Size// -------------------- ----- ----// ViewProjectionMatrix c0 4// CameraPosition c4 1// BoneMatrices c5 225// LocalToWorld c230 4// WorldToLocal c234 3// LightDirection c237 1//
PS
// Parameters://// sampler2D LightAttenuationTexture;// float3 LightColor;// float NormalShadingOnly;// float NvStereoEnabled;// sampler2D NvStereoFixTexture;// float4 ScreenPositionScaleBias;// sampler2D Texture2D_0;// sampler2D Texture2D_2;// sampler2D Texture2D_5;// sampler2D Texture2D_6;// sampler2D Texture2D_7;// sampler2D Texture2D_8;// samplerCUBE TextureCube_0;// float TwoSidedSign;// float UniformScalar_10;// float UniformScalar_11;// float UniformScalar_5;// float UniformScalar_8;// float UniformScalar_9;// float4 UniformVector_0;// float4 UniformVector_10;// float4 UniformVector_2;// float4 UniformVector_6;// float4 UniformVector_7;// float4 UniformVector_8;// float4 UniformVector_9;////// Registers://// Name Reg Size// ----------------------- ----- ----// TwoSidedSign c0 1// ScreenPositionScaleBias c1 1// NvStereoEnabled c3 1// NormalShadingOnly c4 1// UniformVector_0 c5 1// UniformVector_2 c6 1// UniformVector_6 c7 1// UniformVector_7 c8 1// UniformVector_8 c9 1// UniformVector_9 c10 1// UniformVector_10 c11 1// UniformScalar_5 c12 1// UniformScalar_8 c13 1// UniformScalar_9 c14 1// UniformScalar_10 c15 1// UniformScalar_11 c16 1// LightColor c17 1// LightAttenuationTexture s0 1// NvStereoFixTexture s1 1// Texture2D_0 s2 1// Texture2D_2 s3 1// Texture2D_5 s4 1// Texture2D_6 s5 1// Texture2D_7 s6 1// Texture2D_8 s7 1// TextureCube_0 s8 1//
小结:和第二次Shader一样
2.3【第三个DrawCall】291
RT大小:1024*1024
VS
// Parameters://// float4x3 BoneMatrices[75];// float4x4 LocalToWorld;// float4x4 ProjectionMatrix;////// Registers://// Name Reg Size// ---------------- ----- ----// BoneMatrices c5 225// LocalToWorld c230 4// ProjectionMatrix c234 4//
PS
// Parameters://// float DepthBias;// float InvMaxSubjectDepth;// sampler2D Texture2D_2;// sampler2D Texture2D_6;// sampler2D Texture2D_7;// float4 UniformVector_2;////// Registers://// Name Reg Size// ------------------ ----- ----// UniformVector_2 c0 1// InvMaxSubjectDepth c4 1// DepthBias c5 1// Texture2D_2 s0 1// Texture2D_6 s1 1// Texture2D_7 s2 1//
\Engine\Shaders\ShadowDepthCommon.usf
小结:阴影深度绘制
2.4【第四个DrawCall】411
RT
//// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111//// Parameters://// float4x3 BoneMatrices[75];// float4 CameraPosition;// float3 LightDirection;// float4x4 LocalToWorld;// float4x4 ViewProjectionMatrix;// float3x3 WorldToLocal;////// Registers://// Name Reg Size// -------------------- ----- ----// ViewProjectionMatrix c0 4// CameraPosition c4 1// BoneMatrices c5 225// LocalToWorld c230 4// WorldToLocal c234 3// LightDirection c237 1//
PS
// Parameters:
//// sampler2D LightAttenuationTexture;// float3 LightColor;// float NormalShadingOnly;// float NvStereoEnabled;// sampler2D NvStereoFixTexture;// float4 ScreenPositionScaleBias;// sampler2D Texture2D_0;// sampler2D Texture2D_2;// sampler2D Texture2D_5;// sampler2D Texture2D_6;// sampler2D Texture2D_7;// sampler2D Texture2D_8;// samplerCUBE TextureCube_0;// float TwoSidedSign;// float UniformScalar_10;// float UniformScalar_11;// float UniformScalar_5;// float UniformScalar_8;// float UniformScalar_9;// float4 UniformVector_0;// float4 UniformVector_10;// float4 UniformVector_2;// float4 UniformVector_6;// float4 UniformVector_7;// float4 UniformVector_8;// float4 UniformVector_9;////// Registers://// Name Reg Size// ----------------------- ----- ----// TwoSidedSign c0 1// ScreenPositionScaleBias c1 1// NvStereoEnabled c3 1// NormalShadingOnly c4 1// UniformVector_0 c5 1// UniformVector_2 c6 1// UniformVector_6 c7 1// UniformVector_7 c8 1// UniformVector_8 c9 1// UniformVector_9 c10 1// UniformVector_10 c11 1// UniformScalar_5 c12 1// UniformScalar_8 c13 1// UniformScalar_9 c14 1// UniformScalar_10 c15 1// UniformScalar_11 c16 1// LightColor c17 1// LightAttenuationTexture s0 1// NvStereoFixTexture s1 1// Texture2D_0 s2 1// Texture2D_2 s3 1// Texture2D_5 s4 1// Texture2D_6 s5 1// Texture2D_7 s6 1// Texture2D_8 s7 1// TextureCube_0 s8 1//
小结:灯光相关的
RT
VS
// Parameters://// float4x3 BoneMatrices[75];// float4x4 LocalToWorld;// float4x4 ProjectionMatrix;////// Registers://// Name Reg Size// ---------------- ----- ----// BoneMatrices c5 225// LocalToWorld c230 4// ProjectionMatrix c234 4//
PS
// Parameters://// float DepthBias;// float InvMaxSubjectDepth;// sampler2D Texture2D_2;// sampler2D Texture2D_6;// sampler2D Texture2D_7;// float4 UniformVector_2;////// Registers://// Name Reg Size// ------------------ ----- ----// UniformVector_2 c0 1// InvMaxSubjectDepth c4 1// DepthBias c5 1// Texture2D_2 s0 1// Texture2D_6 s1 1// Texture2D_7 s2 1//
小结:和第五次一样
2.6【第六个DrawCall】442
RT 全屏大小
VS
// Parameters://// float4x3 BoneMatrices[75];// float4 CameraPosition;// float4 LightPositionAndInvRadius;// float4x4 LocalToWorld;// float4x4 ViewProjectionMatrix;// float3x3 WorldToLocal;////// Registers://// Name Reg Size// ------------------------- ----- ----// ViewProjectionMatrix c0 4// CameraPosition c4 1// BoneMatrices c5 225// LocalToWorld c230 4// WorldToLocal c234 3// LightPositionAndInvRadius c237 1//
PS
// Parameters://// sampler2D LightAttenuationTexture;// float4 LightColorAndFalloffExponent;// float NormalShadingOnly;// float NvStereoEnabled;// sampler2D NvStereoFixTexture;// float4 ScreenPositionScaleBias;// sampler2D Texture2D_0;// sampler2D Texture2D_2;// sampler2D Texture2D_5;// sampler2D Texture2D_6;// sampler2D Texture2D_7;// sampler2D Texture2D_8;// samplerCUBE TextureCube_0;// float TwoSidedSign;// float UniformScalar_10;// float UniformScalar_11;// float UniformScalar_5;// float UniformScalar_8;// float UniformScalar_9;// float4 UniformVector_0;// float4 UniformVector_10;// float4 UniformVector_2;// float4 UniformVector_6;// float4 UniformVector_7;// float4 UniformVector_8;// float4 UniformVector_9;////// Registers://// Name Reg Size// ---------------------------- ----- ----// TwoSidedSign c0 1// ScreenPositionScaleBias c1 1// NvStereoEnabled c3 1// NormalShadingOnly c4 1// UniformVector_0 c5 1// UniformVector_2 c6 1// UniformVector_6 c7 1// UniformVector_7 c8 1// UniformVector_8 c9 1// UniformVector_9 c10 1// UniformVector_10 c11 1// UniformScalar_5 c12 1// UniformScalar_8 c13 1// UniformScalar_9 c14 1// UniformScalar_10 c15 1// UniformScalar_11 c16 1// LightColorAndFalloffExponent c17 1// LightAttenuationTexture s0 1// NvStereoFixTexture s1 1// Texture2D_0 s2 1// Texture2D_2 s3 1// Texture2D_5 s4 1// Texture2D_6 s5 1// Texture2D_7 s6 1// Texture2D_8 s7 1// TextureCube_0 s8 1//
小结:有灯光位置参数
2.7【第七个DrawCall】481
RT
小结:上面一样
2.8【第八个DrawCall】490
RT 全屏大小 只绘制了一部分像素
VS
// Parameters://// float4x3 BoneMatrices[75];// float4 CameraPosition;// float4 LightPositionAndInvRadius;// float4x4 LocalToWorld;// float4x4 ViewProjectionMatrix;// float3x3 WorldToLocal;////// Registers://// Name Reg Size// ------------------------- ----- ----// ViewProjectionMatrix c0 4// CameraPosition c4 1// BoneMatrices c5 225// LocalToWorld c230 4// WorldToLocal c234 3// LightPositionAndInvRadius c237 1//
PS
// Parameters://// sampler2D LightAttenuationTexture;// float4 LightColorAndFalloffExponent;// float NormalShadingOnly;// float NvStereoEnabled;// sampler2D NvStereoFixTexture;// float4 ScreenPositionScaleBias;// sampler2D Texture2D_0;// sampler2D Texture2D_2;// sampler2D Texture2D_5;// sampler2D Texture2D_6;// sampler2D Texture2D_7;// sampler2D Texture2D_8;// samplerCUBE TextureCube_0;// float TwoSidedSign;// float UniformScalar_10;// float UniformScalar_11;// float UniformScalar_5;// float UniformScalar_8;// float UniformScalar_9;// float4 UniformVector_0;// float4 UniformVector_10;// float4 UniformVector_2;// float4 UniformVector_6;// float4 UniformVector_7;// float4 UniformVector_8;// float4 UniformVector_9;////// Registers://// Name Reg Size// ---------------------------- ----- ----// TwoSidedSign c0 1// ScreenPositionScaleBias c1 1// NvStereoEnabled c3 1// NormalShadingOnly c4 1// UniformVector_0 c5 1// UniformVector_2 c6 1// UniformVector_6 c7 1// UniformVector_7 c8 1// UniformVector_8 c9 1// UniformVector_9 c10 1// UniformVector_10 c11 1// UniformScalar_5 c12 1// UniformScalar_8 c13 1// UniformScalar_9 c14 1// UniformScalar_10 c15 1// UniformScalar_11 c16 1// LightColorAndFalloffExponent c17 1// LightAttenuationTexture s0 1// NvStereoFixTexture s1 1// Texture2D_0 s2 1// Texture2D_2 s3 1// Texture2D_5 s4 1// Texture2D_6 s5 1// Texture2D_7 s6 1// Texture2D_8 s7 1// TextureCube_0 s8 1//
\Engine\Shaders\DynamicLightingCommon.usf
小结:和第6个差不多 动态灯光计算相关
2.9【第九个DrawCall】501
RT
小结: 和上次DrawCall方式一样,只是相机位置不同
2.10【第十次DrawCall】531
RT
VS
// Parameters://// float4x3 BoneMatrices[75];// float4 CameraPosition;// float4 LightPositionAndInvRadius;// float4x4 LocalToWorld;// float4x4 ViewProjectionMatrix;// float3x3 WorldToLocal;////// Registers://// Name Reg Size// ------------------------- ----- ----// ViewProjectionMatrix c0 4// CameraPosition c4 1// BoneMatrices c5 225// LocalToWorld c230 4// WorldToLocal c234 3// LightPositionAndInvRadius c237 1//
PS
// Parameters://// sampler2D LightAttenuationTexture;// float4 LightColorAndFalloffExponent;// float NormalShadingOnly;// float NvStereoEnabled;// sampler2D NvStereoFixTexture;// float4 ScreenPositionScaleBias;// sampler2D Texture2D_0;// sampler2D Texture2D_2;// sampler2D Texture2D_5;// sampler2D Texture2D_6;// sampler2D Texture2D_7;// sampler2D Texture2D_8;// samplerCUBE TextureCube_0;// float TwoSidedSign;// float UniformScalar_10;// float UniformScalar_11;// float UniformScalar_5;// float UniformScalar_8;// float UniformScalar_9;// float4 UniformVector_0;// float4 UniformVector_10;// float4 UniformVector_2;// float4 UniformVector_6;// float4 UniformVector_7;// float4 UniformVector_8;// float4 UniformVector_9;////// Registers://// Name Reg Size// ---------------------------- ----- ----// TwoSidedSign c0 1// ScreenPositionScaleBias c1 1// NvStereoEnabled c3 1// NormalShadingOnly c4 1// UniformVector_0 c5 1// UniformVector_2 c6 1// UniformVector_6 c7 1// UniformVector_7 c8 1// UniformVector_8 c9 1// UniformVector_9 c10 1// UniformVector_10 c11 1// UniformScalar_5 c12 1// UniformScalar_8 c13 1// UniformScalar_9 c14 1// UniformScalar_10 c15 1// UniformScalar_11 c16 1// LightColorAndFalloffExponent c17 1// LightAttenuationTexture s0 1// NvStereoFixTexture s1 1// Texture2D_0 s2 1// Texture2D_2 s3 1// Texture2D_5 s4 1// Texture2D_6 s5 1// Texture2D_7 s6 1// Texture2D_8 s7 1// TextureCube_0 s8 1//
小结:和第七次 一样
2.11【第十一次DrawCall】537
RT
VS
// Parameters://// float4x3 BoneMatrices[75];// float4 CameraPosition;// float4 LightPositionAndInvRadius;// float4x4 LocalToWorld;// float4x4 ViewProjectionMatrix;// float3x3 WorldToLocal;////// Registers://// Name Reg Size// ------------------------- ----- ----// ViewProjectionMatrix c0 4// CameraPosition c4 1// BoneMatrices c5 225// LocalToWorld c230 4// WorldToLocal c234 3// LightPositionAndInvRadius c237 1//
PS
// Parameters://// sampler2D LightAttenuationTexture;// float4 LightColorAndFalloffExponent;// float NormalShadingOnly;// float NvStereoEnabled;// sampler2D NvStereoFixTexture;// float4 ScreenPositionScaleBias;// sampler2D Texture2D_0;// sampler2D Texture2D_2;// sampler2D Texture2D_5;// sampler2D Texture2D_6;// sampler2D Texture2D_7;// sampler2D Texture2D_8;// samplerCUBE TextureCube_0;// float TwoSidedSign;// float UniformScalar_10;// float UniformScalar_11;// float UniformScalar_5;// float UniformScalar_8;// float UniformScalar_9;// float4 UniformVector_0;// float4 UniformVector_10;// float4 UniformVector_2;// float4 UniformVector_6;// float4 UniformVector_7;// float4 UniformVector_8;// float4 UniformVector_9;////// Registers://// Name Reg Size// ---------------------------- ----- ----// TwoSidedSign c0 1// ScreenPositionScaleBias c1 1// NvStereoEnabled c3 1// NormalShadingOnly c4 1// UniformVector_0 c5 1// UniformVector_2 c6 1// UniformVector_6 c7 1// UniformVector_7 c8 1// UniformVector_8 c9 1// UniformVector_9 c10 1// UniformVector_10 c11 1// UniformScalar_5 c12 1// UniformScalar_8 c13 1// UniformScalar_9 c14 1// UniformScalar_10 c15 1// UniformScalar_11 c16 1// LightColorAndFalloffExponent c17 1// LightAttenuationTexture s0 1// NvStereoFixTexture s1 1// Texture2D_0 s2 1// Texture2D_2 s3 1// Texture2D_5 s4 1// Texture2D_6 s5 1// Texture2D_7 s6 1// Texture2D_8 s7 1// TextureCube_0 s8 1//
小结:
2.12【第十二次DrawCall】548
RT
小结:阴影绘制相关
2.13【第十三次DrawCall】555
RT
2.14【第十四个DrawCall】563
RT
VS
// Parameters://// float4x3 BoneMatrices[75];// float4 CameraPosition;// float4 LightPositionAndInvRadius;// float4x4 LocalToWorld;// float4x4 ViewProjectionMatrix;// float3x3 WorldToLocal;////// Registers://// Name Reg Size// ------------------------- ----- ----// ViewProjectionMatrix c0 4// CameraPosition c4 1// BoneMatrices c5 225// LocalToWorld c230 4// WorldToLocal c234 3// LightPositionAndInvRadius c237 1//
PS
// Parameters://// sampler2D LightAttenuationTexture;// float4 LightColorAndFalloffExponent;// float NormalShadingOnly;// float NvStereoEnabled;// sampler2D NvStereoFixTexture;// float4 ScreenPositionScaleBias;// sampler2D Texture2D_0;// sampler2D Texture2D_2;// sampler2D Texture2D_5;// sampler2D Texture2D_6;// sampler2D Texture2D_7;// sampler2D Texture2D_8;// samplerCUBE TextureCube_0;// float TwoSidedSign;// float UniformScalar_10;// float UniformScalar_11;// float UniformScalar_5;// float UniformScalar_8;// float UniformScalar_9;// float4 UniformVector_0;// float4 UniformVector_10;// float4 UniformVector_2;// float4 UniformVector_6;// float4 UniformVector_7;// float4 UniformVector_8;// float4 UniformVector_9;////// Registers://// Name Reg Size// ---------------------------- ----- ----// TwoSidedSign c0 1// ScreenPositionScaleBias c1 1// NvStereoEnabled c3 1// NormalShadingOnly c4 1// UniformVector_0 c5 1// UniformVector_2 c6 1// UniformVector_6 c7 1// UniformVector_7 c8 1// UniformVector_8 c9 1// UniformVector_9 c10 1// UniformVector_10 c11 1// UniformScalar_5 c12 1// UniformScalar_8 c13 1// UniformScalar_9 c14 1// UniformScalar_10 c15 1// UniformScalar_11 c16 1// LightColorAndFalloffExponent c17 1// LightAttenuationTexture s0 1// NvStereoFixTexture s1 1// Texture2D_0 s2 1// Texture2D_2 s3 1// Texture2D_5 s4 1// Texture2D_6 s5 1// Texture2D_7 s6 1// Texture2D_8 s7 1// TextureCube_0 s8 1//
小结:和第八次一样
2.15【第十五个DrawCall】586
// Parameters:
//// float4x3 BoneMatrices[75];// float4x4 LocalToWorld;// float4x4 ViewProjectionMatrix;////// Registers://// Name Reg Size// -------------------- ----- ----// ViewProjectionMatrix c0 4// BoneMatrices c5 225// LocalToWorld c230 4//
//// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111 ps_3_0 def c0, 1, 0, 0, 0 mov oC0, c0.xyyy// approximately 1 instruction slot used
3 RT变化集合
【步骤】
1 先编译【!BuildAll】
【注】先把SYSTEM文件夹该为非只读属性,编译生成的dll等文件要覆盖,
void USkelControlHitPlacement::CalculateNewBoneTransforms(INT BoneIndex, USkeletalMeshComponent* SkelComp, TArray<FBoneAtom>& OutBoneTransforms)
{
check(BoneIndex != 0);
....
}
2
3
4
16090202(剑灵GPA)