Unreal 4引擎修改记录

1.Deferred Decal类
Renderer\Private\CompositionLighting\PostProcessDeferredDecals.h: Deferred Decals implementation.

class FRCPassPostProcessDeferredDecals : public TRenderingCompositePassBase<1, 1>
{
virtual void Process(FRenderingCompositePassContext& Context) override;
}

2、Deferred Decal渲染
CLASS FRCPassPostProcessDeferredDecals 在
void FCompositionLighting::ProcessBeforeBasePass(FRHICommandListImmediate& RHICmdList, FViewInfo& View)

:ProcessBeforeBasePass(
void FCompositionLighting::ProcessAfterBasePass(FRHICommandListImmediate& RHICmdList, FViewInfo& View)
中生成。并调用FRCPassPostProcessDeferredDecals::Process(FRenderingCompositePassContext& Context)。FRCPassPostProcessDeferredDecals::Process()函数调用RenderMeshDecals(),(RenderMeshDecals()函数在Renderer\Private\CompositionLighting\PostProcessMeshDecals.cpp中定义)。

3、FCompositionLighting::ProcessBeforeBasePass(FRHICommandListImmediate& RHICmdList, FViewInfo& View)中渲染DBuffer Decal(DBuffer为Decal Buffer,格式为PF_R8G8),避免在静态光的阴影中Decal无法显示。
FCompositionLighting::ProcessAfterBasePass(FRHICommandListImmediate& RHICmdList, FViewInfo& View)渲染普通Decal。

4、Decal的Depth Test无法设置(在程序中为固定代码):

FDecalDrawingPolicyFactory::SetState(const FMaterial* Material){
RHICmdList.SetDepthStencilState(TStaticDepthStencilState <false,CF_DepthNearOrEqual>::GetRHI());
}

5、Deferred Decal的WorldDisplacement为Disable(在程序中为固定代码):
Material.cpp中返回Material Domain为Deferred Decal的WorldDisplacement Enable属性为False。

你可能感兴趣的:(编程札记)