本文整理汇总了C++中TAutoConsoleVariable::GetValueOnRenderThread方法的典型用法代码示例。如果您正苦于以下问题:C++ TAutoConsoleVariable::GetValueOnRenderThread方法的具体用法?C++ TAutoConsoleVariable::GetValueOnRenderThread怎么用?C++ TAutoConsoleVariable::GetValueOnRenderThread使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TAutoConsoleVariable
的用法示例。
在下文中一共展示了TAutoConsoleVariable::GetValueOnRenderThread方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddToDrawLists
void FStaticMesh::AddToDrawLists(FRHICommandListImmediate& RHICmdList, FScene* Scene)
{
const auto FeatureLevel = Scene->GetFeatureLevel();
if (CastShadow)
{
FShadowDepthDrawingPolicyFactory::AddStaticMesh(Scene, this);
}
if (!PrimitiveSceneInfo->Proxy->ShouldRenderInMainPass())
{
return;
}
if (bUseForMaterial && Scene->RequiresHitProxies() && PrimitiveSceneInfo->Proxy->IsSelectable())
{
// Add the static mesh to the DPG's hit proxy draw list.
FHitProxyDrawingPolicyFactory::AddStaticMesh(Scene, this);
}
if (IsTranslucent(FeatureLevel))
{
return;
}
if (Scene->ShouldUseDeferredRenderer())
{
if (bUseAsOccluder)
{
// Render non-masked materials in the depth only pass
extern TAutoConsoleVariable<int32> CVarEarlyZPass;
int32 EarlyZPass = CVarEarlyZPass.GetValueOnRenderThread();
extern int32 GEarlyZPassMovable;
// WARNING : If you change this condition, also change the logic in FStaticMeshSceneProxy::DrawStaticElements.
if (PrimitiveSceneInfo->Proxy->ShouldUseAsOccluder()
&& (!IsMasked(FeatureLevel) || EarlyZPass == 2)
&& (!PrimitiveSceneInfo->Proxy->IsMovable() || GEarlyZPassMovable))
{
FDepthDrawingPolicyFactory::AddStaticMesh(Scene,this);
}
}
if (bUseForMaterial)
{
// Add the static mesh to the DPG's base pass draw list.
FBasePassOpaqueDrawingPolicyFactory::AddStaticMesh(RHICmdList, Scene, this);
FVelocityDrawingPolicyFactory::AddStaticMesh(Scene, this);
}
}
else
{
if (bUseForMaterial)
{
// Add the static mesh to the DPG's base pass draw list.
FBasePassForwardOpaqueDrawingPolicyFactory::AddStaticMesh(RHICmdList, Scene, this);
}
}
}
示例2: UpdateTemporalLODTransition
void FTemporalLODState::UpdateTemporalLODTransition(const FViewInfo& View, float LastRenderTime)
{
bool bOk = false;
if (!View.bDisableDistanceBasedFadeTransitions)
{
bOk = true;
TemporalLODLag = CVarLODTemporalLag.GetValueOnRenderThread();
if (TemporalLODTime[1] < LastRenderTime - TemporalLODLag)
{
if (TemporalLODTime[0] < TemporalLODTime[1])
{
TemporalLODViewOrigin[0] = TemporalLODViewOrigin[1];
TemporalDistanceFactor[0] = TemporalDistanceFactor[1];
TemporalLODTime[0] = TemporalLODTime[1];
}
TemporalLODViewOrigin[1] = View.ViewMatrices.ViewOrigin;
TemporalDistanceFactor[1] = View.GetLODDistanceFactor();
TemporalLODTime[1] = LastRenderTime;
if (TemporalLODTime[1] <= TemporalLODTime[0])
{
bOk = false; // we are paused or something or otherwise didn't get a good sample
}
}
}
if (!bOk)
{
TemporalLODViewOrigin[0] = View.ViewMatrices.ViewOrigin;
TemporalLODViewOrigin[1] = View.ViewMatrices.ViewOrigin;
TemporalDistanceFactor[0] = View.GetLODDistanceFactor();
TemporalDistanceFactor[1] = TemporalDistanceFactor[0];
TemporalLODTime[0] = LastRenderTime;
TemporalLODTime[1] = LastRenderTime;
TemporalLODLag = 0.0f;
}
}
示例3: DoScreenSpaceReflections
bool DoScreenSpaceReflections(const FViewInfo& View)
{
if(!View.Family->EngineShowFlags.ScreenSpaceReflections)
{
return false;
}
if(!View.State)
{
// not view state (e.g. thumbnail rendering?), no HZB (no screen space reflections or occlusion culling)
return false;
}
int SSRQuality = CVarSSRQuality.GetValueOnRenderThread();
if(SSRQuality <= 0)
{
return false;
}
if(View.FinalPostProcessSettings.ScreenSpaceReflectionIntensity < 1.0f)
{
return false;
}
return true;
}
示例4: ShouldRenderFog
bool ShouldRenderFog(const FSceneViewFamily& Family)
{
const FEngineShowFlags EngineShowFlags = Family.EngineShowFlags;
return EngineShowFlags.Fog
&& EngineShowFlags.Materials
&& !Family.UseDebugViewPS()
&& CVarFog.GetValueOnRenderThread() == 1
&& !EngineShowFlags.StationaryLightOverlap
&& !EngineShowFlags.LightMapDensity;
}
示例5: GetCVarForceLOD
// Can be optimized to avoid the virtual function call but it's compiled out for final release anyway
RENDERCORE_API int32 GetCVarForceLOD()
{
int32 Ret = -1;
#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
{
Ret = CVarForceLOD.GetValueOnRenderThread();
}
#endif // !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
return Ret;
}
示例6: RenderPreStencil
bool RenderPreStencil(FRenderingCompositePassContext& Context, const FMaterialShaderMap* MaterialShaderMap, const FMatrix& ComponentToWorldMatrix, const FMatrix& FrustumComponentToClip)
{
const FSceneView& View = Context.View;
float Distance = (View.ViewMatrices.ViewOrigin - ComponentToWorldMatrix.GetOrigin()).Size();
float Radius = ComponentToWorldMatrix.GetMaximumAxisScale();
// if not inside
if(Distance > Radius)
{
float EstimatedDecalSize = Radius / Distance;
float StencilSizeThreshold = CVarStencilSizeThreshold.GetValueOnRenderThread();
// Check if it's large enough on screen
if(EstimatedDecalSize < StencilSizeThreshold)
{
return false;
}
}
TShaderMapRef<FDeferredDecalVS> VertexShader(Context.GetShaderMap());
Context.RHICmdList.SetLocalBoundShaderState(Context.RHICmdList.BuildLocalBoundShaderState(GetVertexDeclarationFVector3(), VertexShader->GetVertexShader(), FHullShaderRHIRef(), FDomainShaderRHIRef(), NULL, FGeometryShaderRHIRef()));
VertexShader->SetParameters(Context.RHICmdList, View, FrustumComponentToClip);
// Set states, the state cache helps us avoiding redundant sets
Context.RHICmdList.SetRasterizerState(TStaticRasterizerState<FM_Solid, CM_None>::GetRHI());
// all the same to have DX10 working
Context.RHICmdList.SetBlendState(TStaticBlendState<
CW_NONE, BO_Add, BF_SourceAlpha, BF_InverseSourceAlpha, BO_Add, BF_Zero, BF_One, // Emissive
CW_NONE, BO_Add, BF_SourceAlpha, BF_InverseSourceAlpha, BO_Add, BF_Zero, BF_One, // Normal
CW_NONE, BO_Add, BF_SourceAlpha, BF_InverseSourceAlpha, BO_Add, BF_Zero, BF_One, // Metallic, Specular, Roughness
CW_NONE, BO_Add, BF_SourceAlpha, BF_InverseSourceAlpha, BO_Add, BF_Zero, BF_One // BaseColor
>::GetRHI() );
// Carmack's reverse on the bounds
//@todo-martinm
Context.RHICmdList.SetDepthStencilState(TStaticDepthStencilState<
false,CF_LessEqual,
true,CF_Equal,SO_Keep,SO_Keep,SO_Increment,
true,CF_Equal,SO_Keep,SO_Keep,SO_Decrement,
0x80,0x7f
>::GetRHI());
// Render decal mask
Context.RHICmdList.DrawIndexedPrimitive(GUnitCubeIndexBuffer.IndexBufferRHI, PT_TriangleList, 0, 0, 8, 0, GUnitCubeIndexBuffer.GetIndexCount() / 3, 1);
return true;
}
示例7: DoDrawRectangleFlagOverride
static void DoDrawRectangleFlagOverride(EDrawRectangleFlags& Flags)
{
#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
// Determine triangle draw mode
int Value = CVarDrawRectangleOptimization.GetValueOnRenderThread();
if(!Value)
{
// don't use triangle optimization
Flags = EDRF_Default;
}
#endif
}
示例8: AddToDrawLists
void FStaticMesh::AddToDrawLists(FScene* Scene)
{
if (GRHIFeatureLevel >= ERHIFeatureLevel::SM3)
{
if (CastShadow)
{
FShadowDepthDrawingPolicyFactory::AddStaticMesh(Scene,this);
}
if (!bShadowOnly && PrimitiveSceneInfo->Proxy->ShouldRenderInMainPass())
{
// not all platforms need this
const bool bRequiresHitProxies = Scene->RequiresHitProxies();
if ( bRequiresHitProxies && PrimitiveSceneInfo->Proxy->IsSelectable() )
{
// Add the static mesh to the DPG's hit proxy draw list.
FHitProxyDrawingPolicyFactory::AddStaticMesh(Scene,this);
}
if(!IsTranslucent())
{
extern TAutoConsoleVariable<int32> CVarEarlyZPass;
int32 EarlyZPass = CVarEarlyZPass.GetValueOnRenderThread();
extern int32 GEarlyZPassMovable;
// Render non-masked materials in the depth only pass
if (PrimitiveSceneInfo->Proxy->ShouldUseAsOccluder()
&& (!IsMasked() || EarlyZPass == 2)
&& (!PrimitiveSceneInfo->Proxy->IsMovable() || GEarlyZPassMovable))
{
FDepthDrawingPolicyFactory::AddStaticMesh(Scene,this);
}
// Add the static mesh to the DPG's base pass draw list.
FBasePassOpaqueDrawingPolicyFactory::AddStaticMesh(Scene,this);
FVelocityDrawingPolicyFactory::AddStaticMesh(Scene, this);
}
}
}
else
{
if (!bShadowOnly && !IsTranslucent())
{
// Add the static mesh to the DPG's base pass draw list.
FBasePassForwardOpaqueDrawingPolicyFactory::AddStaticMesh(Scene,this);
}
}
}
示例9: DoSpecularCorrection
static bool DoSpecularCorrection()
{
bool CVarState = CVarSubsurfaceQuality.GetValueOnRenderThread() > 0;
int SceneColorFormat;
{
static IConsoleVariable* CVar = IConsoleManager::Get().FindConsoleVariable(TEXT("r.SceneColorFormat"));
SceneColorFormat = CVar->GetInt();
}
// we need an alpha channel for this feature
return CVarState && (SceneColorFormat >= 4);
}
示例10: NormalDistributionUnscaled
/**
* Evaluates a normal distribution PDF (around 0) at given X.
* This function misses the math for scaling the result (faster, not needed if the resulting values are renormalized).
* @param X - The X to evaluate the PDF at.
* @param Scale - The normal distribution's variance.
* @return The value of the normal distribution at X. (unscaled)
*/
static float NormalDistributionUnscaled(float X,float Scale, EFilterShape FilterShape, float CrossCenterWeight)
{
float Ret;
if(FilterNewMethod.GetValueOnRenderThread())
{
float dxUnScaled = FMath::Abs(X);
float dxScaled = dxUnScaled * Scale;
// Constant is tweaked give a similar look to UE4 before we fix the scale bug (Some content tweaking might be needed).
// The value defines how much of the Gaussian clipped by the sample window.
// r.Filter.SizeScale allows to tweak that for performance/quality.
Ret = FMath::Exp(-16.7f * FMath::Square(dxScaled));
// tweak the gaussian shape e.g. "r.Bloom.Cross 3.5"
if (CrossCenterWeight > 1.0f)
{
Ret = FMath::Max(0.0f, 1.0f - dxUnScaled);
Ret = FMath::Pow(Ret, CrossCenterWeight);
}
else
{
Ret = FMath::Lerp(Ret, FMath::Max(0.0f, 1.0f - dxUnScaled), CrossCenterWeight);
}
}
else
{
// will be removed soon
float OldVariance = 1.0f / Scale;
float dx = FMath::Abs(X);
Ret = FMath::Exp(-FMath::Square(dx) / (2.0f * OldVariance));
// tweak the gaussian shape e.g. "r.Bloom.Cross 3.5"
if(CrossCenterWeight > 1.0f)
{
Ret = FMath::Max(0.0f, 1.0f - dx / OldVariance);
Ret = FMath::Pow(Ret, CrossCenterWeight);
}
else
{
Ret = FMath::Lerp(Ret, FMath::Max(0.0f, 1.0f - dx / OldVariance), CrossCenterWeight);
}
}
return Ret;
}
示例11: SetCS
void SetCS(FRHICommandList& RHICmdList, const FRenderingCompositePassContext& Context, const FSceneView& View, FIntPoint WriteMaskDimensions)
{
const FComputeShaderRHIParamRef ShaderRHI = GetComputeShader();
FGlobalShader::SetParameters(RHICmdList, ShaderRHI, Context.View);
//PostprocessParameter.SetCS(ShaderRHI, Context, Context.RHICmdList, TStaticSamplerState<SF_Point, AM_Clamp, AM_Clamp, AM_Clamp>::GetRHI());
FSceneRenderTargets& SceneContext = FSceneRenderTargets::Get(RHICmdList);
SetShaderValue(Context.RHICmdList, ShaderRHI, RTWriteMaskDimensions, WriteMaskDimensions);
SetSRVParameter(Context.RHICmdList, ShaderRHI, RTWriteMaskInput0, SceneContext.DBufferA->GetRenderTargetItem().RTWriteMaskBufferRHI_SRV);
SetSRVParameter(Context.RHICmdList, ShaderRHI, RTWriteMaskInput1, SceneContext.DBufferB->GetRenderTargetItem().RTWriteMaskBufferRHI_SRV);
SetSRVParameter(Context.RHICmdList, ShaderRHI, RTWriteMaskInput2, SceneContext.DBufferC->GetRenderTargetItem().RTWriteMaskBufferRHI_SRV);
int32 UseMask = CVarGenerateDecalRTWriteMaskTexture.GetValueOnRenderThread();
SetShaderValue(Context.RHICmdList, ShaderRHI, UtilizeMask, UseMask);
}
示例12: RenderPreStencil
bool RenderPreStencil(FRenderingCompositePassContext& Context, const FMatrix& ComponentToWorldMatrix, const FMatrix& FrustumComponentToClip)
{
const FViewInfo& View = Context.View;
float Distance = (View.ViewMatrices.ViewOrigin - ComponentToWorldMatrix.GetOrigin()).Size();
float Radius = ComponentToWorldMatrix.GetMaximumAxisScale();
// if not inside
if(Distance > Radius)
{
float EstimatedDecalSize = Radius / Distance;
float StencilSizeThreshold = CVarStencilSizeThreshold.GetValueOnRenderThread();
// Check if it's large enough on screen
if(EstimatedDecalSize < StencilSizeThreshold)
{
return false;
}
}
FDecalRendering::SetVertexShaderOnly(Context.RHICmdList, View, FrustumComponentToClip);
// Set states, the state cache helps us avoiding redundant sets
Context.RHICmdList.SetRasterizerState(TStaticRasterizerState<FM_Solid, CM_None>::GetRHI());
// all the same to have DX10 working
Context.RHICmdList.SetBlendState(TStaticBlendState<
CW_NONE, BO_Add, BF_SourceAlpha, BF_InverseSourceAlpha, BO_Add, BF_Zero, BF_One, // Emissive
CW_NONE, BO_Add, BF_SourceAlpha, BF_InverseSourceAlpha, BO_Add, BF_Zero, BF_One, // Normal
CW_NONE, BO_Add, BF_SourceAlpha, BF_InverseSourceAlpha, BO_Add, BF_Zero, BF_One, // Metallic, Specular, Roughness
CW_NONE, BO_Add, BF_SourceAlpha, BF_InverseSourceAlpha, BO_Add, BF_Zero, BF_One // BaseColor
>::GetRHI() );
// Carmack's reverse the sandbox stencil bit on the bounds
Context.RHICmdList.SetDepthStencilState(TStaticDepthStencilState<
false,CF_LessEqual,
true,CF_Always,SO_Keep,SO_Keep,SO_Invert,
true,CF_Always,SO_Keep,SO_Keep,SO_Invert,
STENCIL_SANDBOX_MASK,STENCIL_SANDBOX_MASK
>::GetRHI(), 0);
// Render decal mask
Context.RHICmdList.DrawIndexedPrimitive(GetUnitCubeIndexBuffer(), PT_TriangleList, 0, 0, 8, 0, ARRAY_COUNT(GCubeIndices) / 3, 1);
return true;
}
示例13: DoFastBlur
bool FRCPassPostProcessWeightedSampleSum::DoFastBlur() const
{
bool bRet = false;
// only do the fast blur only with bilinear filtering
if(CombineMethod == EFCM_Weighted)
{
const FPooledRenderTargetDesc* InputDesc = GetInputDesc(ePId_Input0);
// input is not hooked up correctly
check(InputDesc);
if(FilterShape == EFS_Horiz)
{
FIntPoint SrcSize = InputDesc->Extent;
int32 SrcSizeForThisAxis = SrcSize.X;
// in texel (input resolution), *2 as we use the diameter
// we scale by width because FOV is defined horizontally
float EffectiveBlurRadius = SizeScale * SrcSizeForThisAxis * 2 / 100.0f;
#if PLATFORM_HTML5
float FastBlurThreshold = CVarFastBlurThreshold.GetValueOnGameThread();
#else
float FastBlurThreshold = CVarFastBlurThreshold.GetValueOnRenderThread();
#endif
// small radius look too different with this optimization so we only to it for larger radius
bRet = EffectiveBlurRadius >= FastBlurThreshold;
}
else
{
FIntPoint SrcSize = InputDesc->Extent;
FIntPoint BufferSize = GSceneRenderTargets.GetBufferSizeXY();
float InputRatio = SrcSize.X / (float)SrcSize.Y;
float BufferRatio = BufferSize.X / (float)BufferSize.Y;
// Half res input detected
bRet = InputRatio < BufferRatio * 0.75f;
}
}
return bRet;
}
示例14: SetParameters
void SetParameters(const FRenderingCompositePassContext& Context)
{
const FPixelShaderRHIParamRef ShaderRHI = GetPixelShader();
FGlobalShader::SetParameters(Context.RHICmdList, ShaderRHI, Context.View);
DeferredParameters.Set(Context.RHICmdList, ShaderRHI, Context.View);
if(CVarSSSFilter.GetValueOnRenderThread())
{
PostprocessParameter.SetPS(ShaderRHI, Context, TStaticSamplerState<SF_Bilinear,AM_Border,AM_Border,AM_Border>::GetRHI());
}
else
{
PostprocessParameter.SetPS(ShaderRHI, Context, TStaticSamplerState<SF_Point,AM_Border,AM_Border,AM_Border>::GetRHI());
}
SubsurfaceParameters.SetParameters(Context.RHICmdList, ShaderRHI, Context);
}
示例15: Min
// @param Quality usually in 0..100 range, default is 50
// @return see CVarSSRQuality, never 0
static int32 ComputeSSRQuality(float Quality)
{
int32 Ret;
if(Quality >= 60.0f)
{
Ret = (Quality >= 80.0f) ? 4 : 3;
}
else
{
Ret = (Quality >= 40.0f) ? 2 : 1;
}
int SSRQualityCVar = FMath::Max(0, CVarSSRQuality.GetValueOnRenderThread());
return FMath::Min(Ret, SSRQualityCVar);
}