r.SeparateTranslucency
r.SeparateTranslucency
#Overview
name: r.SeparateTranslucency
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Allows to disable the separate translucency feature (all translucency is rendered in separate RT and composited\nafter DOF, if not specified otherwise in the material).\n 0: off (translucency is affected by depth of field)\n 1: on costs GPU performance and memory but keeps translucency unaffected by Depth of Field. (default)
It is referenced in 34
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.SeparateTranslucency is to control whether translucent objects are rendered to a separate render target and composited after depth of field (DOF) effects. This setting allows translucent objects to appear unaffected by depth of field blur.
Key points about r.SeparateTranslucency:
-
Purpose: It’s primarily used for the rendering system to handle translucency in relation to depth of field effects.
-
Subsystems: This variable is mainly used by the rendering subsystem, particularly in areas dealing with translucency and post-processing effects.
-
Value Setting: The value is set via a console variable, allowing it to be changed at runtime. It’s also exposed in the renderer settings, allowing it to be configured in the engine’s project settings.
-
Interactions: It interacts closely with depth of field effects and other translucency-related settings. It’s also associated with the bSeparateTranslucency variable in various scene proxies and view relevance structures.
-
Developer Awareness: Developers should be aware that enabling this feature can have performance and memory implications, as it requires an additional render target.
-
Best Practices:
- Use this setting when you want translucent objects to appear sharp even when behind out-of-focus areas.
- Consider the performance impact, especially on lower-end hardware.
- Be aware that this setting may not be supported on all platforms (e.g., some mobile configurations).
Regarding the associated variable bSeparateTranslucency:
-
Purpose: This boolean flag is used throughout the rendering code to determine if an object or pass should use separate translucency rendering.
-
Usage: It’s commonly used in view relevance calculations and in determining which render passes should be executed for a given object.
-
Setting: Its value is typically derived from the r.SeparateTranslucency console variable, but can also be influenced by other factors like the current rendering path or platform capabilities.
-
Best Practices:
- When implementing custom render proxies or primitives, respect this flag to ensure your objects behave correctly with separate translucency.
- Be aware that this flag might be forced on in certain scenarios (e.g., when using Temporal Super Resolution) even if r.SeparateTranslucency is off.
The r.SeparateTranslucency setting and its associated bSeparateTranslucency flag are crucial for achieving high-quality rendering of translucent objects in scenes with depth of field effects, but developers should use them judiciously, considering their performance implications.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Classes/Engine/RendererSettings.h:604
Scope (from outer to inner):
file
class class URendererSettings : public UDeveloperSettings
Source code excerpt:
UPROPERTY(config, EditAnywhere, Category=Translucency, meta=(
ConsoleVariable="r.SeparateTranslucency",
ToolTip="Allow translucency to be rendered to a separate render targeted and composited after depth of field. Prevents translucency from appearing out of focus."))
uint32 bSeparateTranslucency:1;
UPROPERTY(config, EditAnywhere, Category=Translucency, meta=(
ConsoleVariable="r.TranslucentSortPolicy",DisplayName="Translucent Sort Policy",
ToolTip="The sort mode for translucent primitives, affecting how they are ordered and how they change order as the camera moves. Requires that Separate Translucency (under Postprocessing) is true."))
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneRendering.cpp:245
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarAllowTranslucencyAfterDOF(
TEXT("r.SeparateTranslucency"),
1,
TEXT("Allows to disable the separate translucency feature (all translucency is rendered in separate RT and composited\n")
TEXT("after DOF, if not specified otherwise in the material).\n")
TEXT(" 0: off (translucency is affected by depth of field)\n")
TEXT(" 1: on costs GPU performance and memory but keeps translucency unaffected by Depth of Field. (default)"),
ECVF_Scalability | ECVF_RenderThreadSafe);
#Associated Variable and Callsites
This variable is associated with another variable named bSeparateTranslucency
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Plugins/Animation/ControlRig/Source/ControlRig/Private/ControlRigComponent.cpp:2157
Scope (from outer to inner):
file
function FPrimitiveViewRelevance FControlRigSceneProxy::GetViewRelevance
Source code excerpt:
ViewRelevance.bDynamicRelevance = true;
// ideally the TranslucencyRelevance should be filled out by the material, here we do it conservative
ViewRelevance.bSeparateTranslucency = ViewRelevance.bNormalTranslucency = true;
return ViewRelevance;
}
uint32 FControlRigSceneProxy::GetMemoryFootprint(void) const
{
return(sizeof(*this) + GetAllocatedSize());
#Loc: <Workspace>/Engine/Plugins/Experimental/Animation/ContextualAnimation/Source/ContextualAnimation/Private/ContextualAnimSceneActorComponent.cpp:1357
Scope (from outer to inner):
file
function FPrimitiveSceneProxy* UContextualAnimSceneActorComponent::CreateSceneProxy
class class FSceneActorCompProxy final : public FPrimitiveSceneProxy
function virtual FPrimitiveViewRelevance GetViewRelevance
Source code excerpt:
Result.bDrawRelevance = IsShown(View);
Result.bDynamicRelevance = true;
Result.bNormalTranslucency = Result.bSeparateTranslucency = IsShown(View);
return Result;
}
virtual uint32 GetMemoryFootprint(void) const override
{
return(sizeof(*this) + GetAllocatedSize());
#Loc: <Workspace>/Engine/Plugins/Runtime/NavCorridor/Source/NavCorridor/Private/NavCorridorTestingComponent.cpp:202
Scope (from outer to inner):
file
function FDebugRenderSceneProxy* UNavCorridorTestingComponent::CreateDebugSceneProxy
class class FNavCorridorDebugRenderSceneProxy : public FDebugRenderSceneProxy
function virtual FPrimitiveViewRelevance GetViewRelevance
Source code excerpt:
Result.bDynamicRelevance = true;
// ideally the TranslucencyRelevance should be filled out by the material, here we do it conservative
Result.bSeparateTranslucency = Result.bNormalTranslucency = IsShown(View) && GIsEditor;
return Result;
}
};
FNavCorridorDebugRenderSceneProxy* DebugProxy = new FNavCorridorDebugRenderSceneProxy(this);
check(DebugProxy);
#Loc: <Workspace>/Engine/Plugins/Runtime/SmartObjects/Source/SmartObjectsModule/Private/SmartObjectContainerRenderingComponent.cpp:71
Scope (from outer to inner):
file
class class FSOContainerRenderingSceneProxy final : public FDebugRenderSceneProxy
function virtual FPrimitiveViewRelevance GetViewRelevance
Source code excerpt:
Result.bDynamicRelevance = true;
// ideally the TranslucencyRelevance should be filled out by the material, here we do it conservative
Result.bSeparateTranslucency = Result.bNormalTranslucency = IsShown(View);
return Result;
}
FVector OwnerLocation;
TArray<FVector> EndLocations;
};
#Loc: <Workspace>/Engine/Plugins/Runtime/SmartObjects/Source/SmartObjectsModule/Private/SmartObjectDebugSceneProxy.cpp:17
Scope (from outer to inner):
file
function FPrimitiveViewRelevance FSmartObjectDebugSceneProxy::GetViewRelevance
Source code excerpt:
Result.bDrawRelevance = IsShown(View) && (ViewFlagIndex == INDEX_NONE || View->Family->EngineShowFlags.GetSingleFlag(ViewFlagIndex));
Result.bDynamicRelevance = true;
Result.bSeparateTranslucency = Result.bNormalTranslucency = true;
return Result;
}
uint32 FSmartObjectDebugSceneProxy::GetMemoryFootprint(void) const
{
return sizeof(*this) + FDebugRenderSceneProxy::GetAllocatedSize();
#Loc: <Workspace>/Engine/Plugins/Runtime/SmartObjects/Source/SmartObjectsModule/Private/SmartObjectRenderingComponent.cpp:90
Scope (from outer to inner):
file
class class FSORenderingSceneProxy final : public FDebugRenderSceneProxy
function virtual FPrimitiveViewRelevance GetViewRelevance
Source code excerpt:
Result.bDynamicRelevance = true;
// ideally the TranslucencyRelevance should be filled out by the material, here we do it conservative
Result.bSeparateTranslucency = Result.bNormalTranslucency = IsShown(View);
return Result;
}
bool bDrawEvenIfNotSelected = true;
};
#Loc: <Workspace>/Engine/Plugins/Runtime/ZoneGraph/Source/ZoneGraph/Private/ZoneGraphRenderingComponent.cpp:142
Scope (from outer to inner):
file
function FPrimitiveViewRelevance FZoneGraphSceneProxy::GetViewRelevance
Source code excerpt:
Result.bDynamicRelevance = true;
// ideally the TranslucencyRelevance should be filled out by the material, here we do it conservative
Result.bSeparateTranslucency = Result.bNormalTranslucency = bVisible && IsShown(View);
return Result;
}
FZoneGraphSceneProxy::FDrawDistances FZoneGraphSceneProxy::GetDrawDistances(const float MinDrawDistance, const float MaxDrawDistance)
{
float ShapeMaxDrawDistance = 0.5f;
#Loc: <Workspace>/Engine/Plugins/Runtime/ZoneGraph/Source/ZoneGraph/Private/ZoneShapeComponent.cpp:860
Scope (from outer to inner):
file
function FPrimitiveSceneProxy* UZoneShapeComponent::CreateSceneProxy
class class FZoneShapeSceneProxy final : public FPrimitiveSceneProxy
function virtual FPrimitiveViewRelevance GetViewRelevance
Source code excerpt:
Result.bShadowRelevance = IsShadowCast(View);
Result.bEditorPrimitiveRelevance = UseEditorCompositing(View);
Result.bSeparateTranslucency = Result.bNormalTranslucency = true;
return Result;
}
virtual uint32 GetMemoryFootprint(void) const override { return sizeof * this + GetAllocatedSize(); }
uint32 GetAllocatedSize(void) const { return (uint32)FPrimitiveSceneProxy::GetAllocatedSize(); }
#Loc: <Workspace>/Engine/Plugins/Runtime/ZoneGraphAnnotations/Source/ZoneGraphAnnotations/Private/ZoneGraphAnnotationComponent.cpp:35
Scope (from outer to inner):
file
function FPrimitiveViewRelevance FZoneGraphAnnotationSceneProxy::GetViewRelevance
Source code excerpt:
Result.bDynamicRelevance = true;
// ideally the TranslucencyRelevance should be filled out by the material, here we do it conservative
Result.bSeparateTranslucency = Result.bNormalTranslucency = true;
return Result;
}
uint32 FZoneGraphAnnotationSceneProxy::GetMemoryFootprint(void) const
{
return sizeof(*this) + FDebugRenderSceneProxy::GetAllocatedSize();
#Loc: <Workspace>/Engine/Source/Developer/FunctionalTesting/Private/FuncTestRenderingComponent.cpp:49
Scope (from outer to inner):
file
class class FFTestRenderingSceneProxy final : public FPrimitiveSceneProxy
function virtual FPrimitiveViewRelevance GetViewRelevance
Source code excerpt:
Result.bDynamicRelevance = true;
// ideally the TranslucencyRelevance should be filled out by the material, here we do it conservative
Result.bSeparateTranslucency = Result.bNormalTranslucency = IsShown(View);
return Result;
}
virtual void GetDynamicMeshElements(const TArray<const FSceneView*>& Views, const FSceneViewFamily& ViewFamily, uint32 VisibilityMap, FMeshElementCollector& Collector) const override
{
static const FLinearColor RadiusColor = FLinearColor(FColorList::Orange);
#Loc: <Workspace>/Engine/Source/Developer/LogVisualizer/Private/VisualLoggerRenderingActorBase.cpp:41
Scope (from outer to inner):
file
class class FVisualLoggerSceneProxy final : public FDebugRenderSceneProxy
function virtual FPrimitiveViewRelevance GetViewRelevance
Source code excerpt:
Result.bDynamicRelevance = true;
// ideally the TranslucencyRelevance should be filled out by the material, here we do it conservative
Result.bSeparateTranslucency = Result.bNormalTranslucency = IsShown(View) && GIsEditor;
return Result;
}
virtual uint32 GetMemoryFootprint(void) const override { return sizeof(*this) + GetAllocatedSize(); }
};
#Loc: <Workspace>/Engine/Source/Editor/HardwareTargeting/Private/HardwareTargetingModule.cpp:242
Scope (from outer to inner):
file
function void FHardwareTargetingModule::GatherSettings
Source code excerpt:
// Separate translucency
UE_META_SETTING_ENTRY(Builder, URendererSettings, bSeparateTranslucency, !bAnyMobile);
// Motion blur, auto-exposure, and ambient occlusion
UE_META_SETTING_ENTRY(Builder, URendererSettings, bDefaultFeatureMotionBlur, bHighEndPC);
UE_META_SETTING_ENTRY(Builder, URendererSettings, bDefaultFeatureAutoExposure, bHighEndPC);
UE_META_SETTING_ENTRY(Builder, URendererSettings, bDefaultFeatureAmbientOcclusion, bAnyPC);
#Loc: <Workspace>/Engine/Source/Runtime/AIModule/Private/EnvironmentQuery/EQSRenderingComponent.cpp:270
Scope (from outer to inner):
file
function FPrimitiveViewRelevance FEQSSceneProxy::GetViewRelevance
Source code excerpt:
Result.bDynamicRelevance = true;
// ideally the TranslucencyRelevance should be filled out by the material, here we do it conservative
Result.bSeparateTranslucency = Result.bNormalTranslucency = IsShown(View);
return Result;
}
//----------------------------------------------------------------------//
// UEQSRenderingComponent
//----------------------------------------------------------------------//
#Loc: <Workspace>/Engine/Source/Runtime/AIModule/Private/GameplayDebugger/GameplayDebuggerCategory_AI.cpp:409
Scope (from outer to inner):
file
function FDebugRenderSceneProxy* FGameplayDebuggerCategory_AI::CreateDebugSceneProxy
class class FPathDebugRenderSceneProxy final : public FDebugRenderSceneProxy
function FPrimitiveViewRelevance GetViewRelevance
Source code excerpt:
FPrimitiveViewRelevance Result;
Result.bDrawRelevance = Result.bSeparateTranslucency = Result.bNormalTranslucency = bCanShow;
Result.bDynamicRelevance = true;
return Result;
}
};
if (PathDataPack.PathCorridor.Num())
#Loc: <Workspace>/Engine/Source/Runtime/AIModule/Private/GameplayDebugger/GameplayDebuggerCategory_NavLocalGrid.cpp:290
Scope (from outer to inner):
file
class class FNavLocalGridSceneProxy final : public FDebugRenderSceneProxy
function virtual FPrimitiveViewRelevance GetViewRelevance
Source code excerpt:
Result.bDrawRelevance = IsShown(View);
Result.bDynamicRelevance = true;
Result.bNormalTranslucency = Result.bSeparateTranslucency = IsShown(View);
return Result;
}
virtual uint32 GetMemoryFootprint(void) const override
{
return sizeof(*this) + GetAllocatedSize();
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Classes/Engine/RendererSettings.h:606
Scope (from outer to inner):
file
class class URendererSettings : public UDeveloperSettings
Source code excerpt:
ConsoleVariable="r.SeparateTranslucency",
ToolTip="Allow translucency to be rendered to a separate render targeted and composited after depth of field. Prevents translucency from appearing out of focus."))
uint32 bSeparateTranslucency:1;
UPROPERTY(config, EditAnywhere, Category=Translucency, meta=(
ConsoleVariable="r.TranslucentSortPolicy",DisplayName="Translucent Sort Policy",
ToolTip="The sort mode for translucent primitives, affecting how they are ordered and how they change order as the camera moves. Requires that Separate Translucency (under Postprocessing) is true."))
TEnumAsByte<ETranslucentSortPolicy::Type> TranslucentSortPolicy;
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Classes/Materials/MaterialRelevance.h:25
Scope: file
Source code excerpt:
uint8 bHairStrands : 1;
uint8 bTwoSided : 1;
uint8 bSeparateTranslucency : 1; // Translucency After DOF
uint8 bTranslucencyModulate : 1;
uint8 bPostMotionBlurTranslucency : 1;
uint8 bNormalTranslucency : 1;
uint8 bUsesSceneColorCopy : 1;
uint8 bOutputsTranslucentVelocity : 1;
uint8 bUsesGlobalDistanceField : 1;
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Components/LineBatchComponent.cpp:121
Scope (from outer to inner):
file
function FPrimitiveViewRelevance FLineBatcherSceneProxy::GetViewRelevance
Source code excerpt:
ViewRelevance.bDynamicRelevance = true;
// ideally the TranslucencyRelevance should be filled out by the material, here we do it conservative
ViewRelevance.bSeparateTranslucency = ViewRelevance.bNormalTranslucency = true;
return ViewRelevance;
}
uint32 FLineBatcherSceneProxy::GetMemoryFootprint( void ) const
{
return( sizeof( *this ) + GetAllocatedSize() );
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Materials/MaterialInterface.cpp:491
Scope (from outer to inner):
file
function FMaterialRelevance UMaterialInterface::GetRelevance_Internal
Source code excerpt:
MaterialRelevance.bHairStrands = IsCompatibleWithHairStrands(MaterialResource, InFeatureLevel);
MaterialRelevance.bTwoSided = MaterialResource->IsTwoSided();
MaterialRelevance.bSeparateTranslucency = bIsTranslucent && (TranslucencyPass == MTP_AfterDOF);
MaterialRelevance.bTranslucencyModulate = bMaterialSeparateModulation;
MaterialRelevance.bPostMotionBlurTranslucency = (TranslucencyPass == MTP_AfterMotionBlur);
MaterialRelevance.bNormalTranslucency = bIsTranslucent && (TranslucencyPass == MTP_BeforeDOF);
MaterialRelevance.bDisableDepthTest = bIsTranslucent && Material->bDisableDepthTest;
MaterialRelevance.bUsesSceneColorCopy = bIsTranslucent && MaterialResource->RequiresSceneColorCopy_GameThread();
MaterialRelevance.bOutputsTranslucentVelocity = Material->IsTranslucencyWritingVelocity();
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/SkeletalMesh.cpp:7120
Scope (from outer to inner):
file
function FPrimitiveViewRelevance FSkeletalMeshSceneProxy::GetViewRelevance
Source code excerpt:
#if !UE_BUILD_SHIPPING
Result.bSeparateTranslucency |= View->Family->EngineShowFlags.Constraints;
#endif
#if WITH_EDITOR
//only check these in the editor
if (Result.bStaticRelevance)
{
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/PrimitiveViewRelevance.h:78
Scope (from outer to inner):
file
function bool HasTranslucency
Source code excerpt:
bool HasTranslucency() const
{
return bNormalTranslucency || bSeparateTranslucency || bTranslucencyModulate || bPostMotionBlurTranslucency;
}
bool HasVelocity() const
{
return bVelocityRelevance || bOutputsTranslucentVelocity;
}
#Loc: <Workspace>/Engine/Source/Runtime/Experimental/GeometryCollectionEngine/Public/GeometryCollection/GeometryCollectionISMPoolDebugDrawComponent.cpp:57
Scope (from outer to inner):
file
class class FGeometryCollectionISMPoolDebugDrawSceneProxy final : public FDebugRenderSceneProxy
function FPrimitiveViewRelevance GetViewRelevance
Source code excerpt:
Result.bDrawRelevance = true;
Result.bDynamicRelevance = true;
Result.bSeparateTranslucency = Result.bNormalTranslucency = true;
return Result;
}
};
UGeometryCollectionISMPoolDebugDrawComponent::UGeometryCollectionISMPoolDebugDrawComponent(const FObjectInitializer& ObjectInitializer)
#Loc: <Workspace>/Engine/Source/Runtime/Landscape/Private/LandscapeGizmoActor.cpp:367
Scope (from outer to inner):
file
class class FLandscapeGizmoRenderSceneProxy final : public FPrimitiveSceneProxy
function virtual FPrimitiveViewRelevance GetViewRelevance
Source code excerpt:
Result.bDynamicRelevance = true;
// ideally the TranslucencyRelevance should be filled out by the material, here we do it conservative
Result.bSeparateTranslucency = Result.bNormalTranslucency = true;
#endif
return Result;
}
virtual uint32 GetMemoryFootprint( void ) const override { return( sizeof( *this ) + GetAllocatedSize() ); }
uint32 GetAllocatedSize( void ) const { return static_cast<uint32>(FPrimitiveSceneProxy::GetAllocatedSize()); }
#Loc: <Workspace>/Engine/Source/Runtime/MRMesh/Private/MRMeshComponent.cpp:494
Scope (from outer to inner):
file
class class FMRMeshProxy final : public FPrimitiveSceneProxy
function virtual FPrimitiveViewRelevance GetViewRelevance
Source code excerpt:
Result.bRenderCustomDepth = ShouldRenderCustomDepth();
TMicRecursionGuard RecursionGuard;
Result.bSeparateTranslucency = MaterialToUse->GetMaterial_Concurrent(RecursionGuard)->TranslucencyPass == MTP_AfterDOF;
//MaterialRelevance.SetPrimitiveViewRelevance(Result);
return Result;
}
virtual uint32 GetMemoryFootprint(void) const
{
return(sizeof(*this) + GetAllocatedSize());
#Loc: <Workspace>/Engine/Source/Runtime/NavigationSystem/Private/NavLinkRenderingComponent.cpp:443
Scope (from outer to inner):
file
function FPrimitiveViewRelevance FNavLinkRenderingProxy::GetViewRelevance
Source code excerpt:
Result.bDynamicRelevance = true;
// ideally the TranslucencyRelevance should be filled out by the material, here we do it conservative
Result.bSeparateTranslucency = Result.bNormalTranslucency = IsShown(View);
Result.bShadowRelevance = IsShadowCast(View);
Result.bEditorPrimitiveRelevance = UseEditorCompositing(View);
return Result;
}
uint32 FNavLinkRenderingProxy::GetMemoryFootprint( void ) const
#Loc: <Workspace>/Engine/Source/Runtime/NavigationSystem/Private/NavMesh/NavMeshRenderingComponent.cpp:1687
Scope (from outer to inner):
file
function FPrimitiveViewRelevance FNavMeshSceneProxy::GetViewRelevance
Source code excerpt:
Result.bDynamicRelevance = true;
// ideally the TranslucencyRelevance should be filled out by the material, here we do it conservative
Result.bSeparateTranslucency = Result.bNormalTranslucency = bVisible && IsShown(View);
return Result;
}
uint32 FNavMeshSceneProxy::GetAllocatedSizeInternal() const
{
return IntCastChecked<uint32>(
#Loc: <Workspace>/Engine/Source/Runtime/NavigationSystem/Private/NavMesh/NavTestRenderingComponent.cpp:316
Scope (from outer to inner):
file
function FPrimitiveViewRelevance FNavTestSceneProxy::GetViewRelevance
Source code excerpt:
Result.bDynamicRelevance = true;
// ideally the TranslucencyRelevance should be filled out by the material, here we do it conservative
Result.bSeparateTranslucency = Result.bNormalTranslucency = IsShown(View) && GIsEditor;
return Result;
}
uint32 FNavTestSceneProxy::GetAllocatedSizeInternal() const
{
SIZE_T InternalAllocSize = 0;
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneVisibility.cpp:1638
Scope: file
Source code excerpt:
if (View.Family->AllowTranslucencyAfterDOF())
{
if ((ViewRelevance.bNormalTranslucency || (View.AutoBeforeDOFTranslucencyBoundary > 0.0f && ViewRelevance.bSeparateTranslucency)))
{
DrawCommandPacket.AddCommandsForMesh(PrimitiveIndex, PrimitiveSceneInfo, StaticMeshRelevance, StaticMesh, CullingPayloadFlags, Scene, bCanCache, EMeshPass::TranslucencyStandard);
}
if ((ViewRelevance.bNormalTranslucency || (View.AutoBeforeDOFTranslucencyBoundary > 0.0f && ViewRelevance.bSeparateTranslucency)) && ViewRelevance.bTranslucencyModulate && View.Family->AllowStandardTranslucencySeparated())
{
DrawCommandPacket.AddCommandsForMesh(PrimitiveIndex, PrimitiveSceneInfo, StaticMeshRelevance, StaticMesh, CullingPayloadFlags, Scene, bCanCache, EMeshPass::TranslucencyStandardModulate);
}
if (ViewRelevance.bSeparateTranslucency)
{
DrawCommandPacket.AddCommandsForMesh(PrimitiveIndex, PrimitiveSceneInfo, StaticMeshRelevance, StaticMesh, CullingPayloadFlags, Scene, bCanCache, EMeshPass::TranslucencyAfterDOF);
}
if (ViewRelevance.bSeparateTranslucency && ViewRelevance.bTranslucencyModulate)
{
DrawCommandPacket.AddCommandsForMesh(PrimitiveIndex, PrimitiveSceneInfo, StaticMeshRelevance, StaticMesh, CullingPayloadFlags, Scene, bCanCache, EMeshPass::TranslucencyAfterDOFModulate);
}
if (ViewRelevance.bPostMotionBlurTranslucency)
{
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneVisibility.cpp:1861
Scope (from outer to inner):
file
function void FRelevancePacket::ComputeRelevance
Source code excerpt:
if (View.Family->AllowTranslucencyAfterDOF())
{
if ((ViewRelevance.bNormalTranslucency || (View.AutoBeforeDOFTranslucencyBoundary > 0.0f && ViewRelevance.bSeparateTranslucency)))
{
TranslucentPrimCount.Add(ETranslucencyPass::TPT_TranslucencyStandard, ViewRelevance.bUsesSceneColorCopy);
}
if ((ViewRelevance.bNormalTranslucency || (View.AutoBeforeDOFTranslucencyBoundary > 0.0f && ViewRelevance.bSeparateTranslucency)) && ViewRelevance.bTranslucencyModulate && View.Family->AllowStandardTranslucencySeparated())
{
TranslucentPrimCount.Add(ETranslucencyPass::TPT_TranslucencyStandardModulate, ViewRelevance.bUsesSceneColorCopy);
}
if (ViewRelevance.bSeparateTranslucency)
{
TranslucentPrimCount.Add(ETranslucencyPass::TPT_TranslucencyAfterDOF, ViewRelevance.bUsesSceneColorCopy);
}
if (ViewRelevance.bSeparateTranslucency && ViewRelevance.bTranslucencyModulate)
{
TranslucentPrimCount.Add(ETranslucencyPass::TPT_TranslucencyAfterDOFModulate, ViewRelevance.bUsesSceneColorCopy);
}
if (ViewRelevance.bPostMotionBlurTranslucency)
{
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneVisibility.cpp:2291
Scope (from outer to inner):
file
function static void ComputeDynamicMeshRelevance
Source code excerpt:
if (View.Family->AllowTranslucencyAfterDOF())
{
if ((ViewRelevance.bNormalTranslucency || (View.AutoBeforeDOFTranslucencyBoundary > 0.0f && ViewRelevance.bSeparateTranslucency)))
{
PassMask.Set(EMeshPass::TranslucencyStandard);
View.NumVisibleDynamicMeshElements[EMeshPass::TranslucencyStandard] += NumElements;
}
if ((ViewRelevance.bNormalTranslucency || (View.AutoBeforeDOFTranslucencyBoundary > 0.0f && ViewRelevance.bSeparateTranslucency)) && ViewRelevance.bTranslucencyModulate && View.Family->AllowStandardTranslucencySeparated())
{
PassMask.Set(EMeshPass::TranslucencyStandardModulate);
View.NumVisibleDynamicMeshElements[EMeshPass::TranslucencyStandardModulate] += NumElements;
}
if (ViewRelevance.bSeparateTranslucency)
{
PassMask.Set(EMeshPass::TranslucencyAfterDOF);
View.NumVisibleDynamicMeshElements[EMeshPass::TranslucencyAfterDOF] += NumElements;
}
if (ViewRelevance.bSeparateTranslucency && ViewRelevance.bTranslucencyModulate)
{
PassMask.Set(EMeshPass::TranslucencyAfterDOFModulate);
View.NumVisibleDynamicMeshElements[EMeshPass::TranslucencyAfterDOFModulate] += NumElements;
}
if (ViewRelevance.bPostMotionBlurTranslucency)
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneRendering.cpp:244
Scope: file
Source code excerpt:
);
static TAutoConsoleVariable<int32> CVarAllowTranslucencyAfterDOF(
TEXT("r.SeparateTranslucency"),
1,
TEXT("Allows to disable the separate translucency feature (all translucency is rendered in separate RT and composited\n")
TEXT("after DOF, if not specified otherwise in the material).\n")
TEXT(" 0: off (translucency is affected by depth of field)\n")
TEXT(" 1: on costs GPU performance and memory but keeps translucency unaffected by Depth of Field. (default)"),
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneRendering.cpp:2896
Scope (from outer to inner):
file
function FSceneRenderer::FSceneRenderer
Source code excerpt:
}
ViewFamily.bAllowTranslucencyAfterDOF = SeparateTranslucencyEnabled && CVarAllowTranslucencyAfterDOF.GetValueOnAnyThread() != 0;
if (!ViewFamily.bAllowTranslucencyAfterDOF && !bIsMobile && CVarTSRForceSeparateTranslucency.GetValueOnAnyThread() != 0)
{
for (FViewInfo* View : AllViews)
{
if (View->AntiAliasingMethod == AAM_TSR)