本文整理汇总了C++中FRHICommandList::Clear方法的典型用法代码示例。如果您正苦于以下问题:C++ FRHICommandList::Clear方法的具体用法?C++ FRHICommandList::Clear怎么用?C++ FRHICommandList::Clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FRHICommandList
的用法示例。
在下文中一共展示了FRHICommandList::Clear方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GammaCorrectToViewportRenderTarget
// TODO: REMOVE if no longer needed:
void FSceneRenderer::GammaCorrectToViewportRenderTarget(FRHICommandList& RHICmdList, const FViewInfo* View, float OverrideGamma)
{
// Set the view family's render target/viewport.
SetRenderTarget(RHICmdList, ViewFamily.RenderTarget->GetRenderTargetTexture(), FTextureRHIRef());
// Deferred the clear until here so the garbage left in the non rendered regions by the post process effects do not show up
if( ViewFamily.bDeferClear )
{
RHICmdList.Clear(true, FLinearColor::Black, false, 0.0f, false, 0, FIntRect());
ViewFamily.bDeferClear = false;
}
SCOPED_DRAW_EVENT(RHICmdList, GammaCorrection);
// turn off culling and blending
RHICmdList.SetRasterizerState(TStaticRasterizerState<FM_Solid, CM_None>::GetRHI());
RHICmdList.SetBlendState(TStaticBlendState<>::GetRHI());
// turn off depth reads/writes
RHICmdList.SetDepthStencilState(TStaticDepthStencilState<false, CF_Always>::GetRHI());
TShaderMapRef<FGammaCorrectionVS> VertexShader(View->ShaderMap);
TShaderMapRef<FGammaCorrectionPS> PixelShader(View->ShaderMap);
static FGlobalBoundShaderState PostProcessBoundShaderState;
SetGlobalBoundShaderState(RHICmdList, View->GetFeatureLevel(), PostProcessBoundShaderState, GFilterVertexDeclaration.VertexDeclarationRHI, *VertexShader, *PixelShader);
float InvDisplayGamma = 1.0f / ViewFamily.RenderTarget->GetDisplayGamma();
if (OverrideGamma != 0)
{
InvDisplayGamma = 1 / OverrideGamma;
}
const FPixelShaderRHIParamRef ShaderRHI = PixelShader->GetPixelShader();
SetShaderValue(
RHICmdList,
ShaderRHI,
PixelShader->InverseGamma,
InvDisplayGamma
);
SetShaderValue(RHICmdList, ShaderRHI,PixelShader->ColorScale,View->ColorScale);
SetShaderValue(RHICmdList, ShaderRHI,PixelShader->OverlayColor,View->OverlayColor);
const FTextureRHIRef DesiredSceneColorTexture = GSceneRenderTargets.GetSceneColorTexture();
SetTextureParameter(
RHICmdList,
ShaderRHI,
PixelShader->SceneTexture,
PixelShader->SceneTextureSampler,
TStaticSamplerState<SF_Bilinear>::GetRHI(),
DesiredSceneColorTexture
);
// Draw a quad mapping scene color to the view's render target
DrawRectangle(
RHICmdList,
View->UnscaledViewRect.Min.X,View->UnscaledViewRect.Min.Y,
View->UnscaledViewRect.Width(),View->UnscaledViewRect.Height(),
View->ViewRect.Min.X,View->ViewRect.Min.Y,
View->ViewRect.Width(),View->ViewRect.Height(),
ViewFamily.RenderTarget->GetSizeXY(),
GSceneRenderTargets.GetBufferSizeXY(),
*VertexShader,
EDRF_UseTriangleOptimization);
}