Unreal 4引擎修改记录

本文介绍了DeferredDecal类实现及渲染流程,包括FCompositionLighting类中的Before和AfterBasePass处理,以及Decal渲染中固定的DepthTest和WorldDisplacement设置。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值