Encapsulates the data which is mirrored to render a UPrimitiveComponent parallel to the game thread. 更多...
#include <PrimitiveSceneProxy.h>
类 FPrimitiveSceneProxy 继承关系图:Public 类型 | |
| typedef TArray< class FLightCacheInterface *, TInlineAllocator< 8 > > | FLCIArray |
| Get the list of LCIs. 更多... | |
Public 成员函数 | |
| virtual void | AcceptOcclusionResults (const FSceneView *View, TArray< bool > *Results, int32 ResultsStart, int32 NumResults) |
| Gives the primitive the results of sub-occlusion-queries 更多... | |
| virtual ENGINE_API void | ApplyLateUpdateTransform (const FMatrix &LateUpdateTransform) |
| Applies a "late in the frame" adjustment to the proxy's existing transform 更多... | |
| virtual ENGINE_API void | ApplyWorldOffset (FVector InOffset) |
| Shifts primitive position and all relevant data by an arbitrary delta. 更多... | |
| virtual bool | CanBeOccluded () const |
| virtual int32 | CollectOccluderElements (class FOccluderElementsCollector &Collector) const |
| Collects occluder geometry for software occlusion culling | |
| virtual ENGINE_API HHitProxy * | CreateHitProxies (UPrimitiveComponent *Component, TArray< TRefCountPtr< HHitProxy > > &OutHitProxies) |
| Creates the hit proxies are used when DrawDynamicElements is called. 更多... | |
| virtual void | CreateRenderThreadResources () |
| Called when the rendering thread adds the proxy to the scene. 更多... | |
| virtual void | DestroyRenderThreadResources () |
| Called when the rendering thread removes the proxy from the scene. 更多... | |
| virtual void | DrawStaticElements (FStaticPrimitiveDrawInterface *PDI) |
| Draws the primitive's static elements. 更多... | |
| bool | DrawsVelocity () const |
| Returns whether draws velocity in base pass. | |
| ENGINE_API | FPrimitiveSceneProxy (const UPrimitiveComponent *InComponent, FName ResourceName=NAME_None) |
| Initialization constructor. | |
| virtual void | GatherSimpleLights (const FSceneViewFamily &ViewFamily, FSimpleLightArray &OutParticleLights) const |
| Callback from the renderer to gather simple lights that this proxy wants renderered. | |
| virtual FBoxSphereBounds | GetCustomOcclusionBounds () const |
| Return the custom occlusion bounds for this scene proxy. 更多... | |
| ENGINE_API const FCustomPrimitiveData * | GetCustomPrimitiveData () const |
| Get the custom primitive data for this scene proxy. 更多... | |
| uint8 | GetDepthPriorityGroup (const FSceneView *View) const |
| Determines the DPG to render the primitive in for the given view. 更多... | |
| virtual void | GetDynamicMeshElements (const TArray< const FSceneView * > &Views, const FSceneViewFamily &ViewFamily, uint32 VisibilityMap, class FMeshElementCollector &Collector) const |
| Gathers the primitive's dynamic mesh elements. 更多... | |
| virtual int32 | GetLightMapResolution () const |
| Get the lightmap resolution for this primitive. 更多... | |
| virtual void | GetLightRelevance (const FLightSceneProxy *LightSceneProxy, bool &bDynamic, bool &bRelevant, bool &bLightMapped, bool &bShadowMapped) const |
| Determines the relevance of this primitive's elements to the given light. 更多... | |
| virtual int32 | GetLOD (const FSceneView *View) const |
| Returns the LOD that the primitive will render at for this view. | |
| virtual uint32 | GetMemoryFootprint (void) const =0 |
| Every derived class should override these functions | |
| virtual void | GetMeshDescription (int32 LODIndex, TArray< FMeshBatch > &OutMeshElements) const |
| Gathers a description of the mesh elements to be rendered for the given LOD index, without consideration for views. | |
| virtual const TArray< FBoxSphereBounds > * | GetOcclusionQueries (const FSceneView *View) const |
| Gets the boxes for sub occlusion queries 更多... | |
| virtual void | GetShadowShapes (TArray< FCapsuleShape > &CapsuleShapes) const |
| Gathers shadow shapes from this proxy. | |
| virtual uint8 | GetStaticDepthPriorityGroup () const |
| Determines the DPG to render the primitive in regardless of view. 更多... | |
| virtual ENGINE_API SIZE_T | GetTypeHash () const =0 |
| Return a type (or subtype) specific hash for sorting purposes | |
| virtual ENGINE_API FPrimitiveViewRelevance | GetViewRelevance (const FSceneView *View) const |
| Determines the relevance of this primitive's elements to the given view. 更多... | |
| virtual bool | HasCustomOcclusionBounds () const |
| Returns whether the proxy utilizes custom occlusion bounds or not 更多... | |
| virtual bool | HasSubprimitiveOcclusionQueries () const |
| virtual bool | IsDetailMesh () const |
| Returns whether this proxy should be considered a "detail mesh". 更多... | |
| virtual ENGINE_API bool | IsDrawnInGame () const |
| Tell us if this proxy is drawn in game. | |
| ENGINE_API bool | IsShadowCast (const FSceneView *View) const |
| ENGINE_API bool | IsShown (const FSceneView *View) const |
| virtual bool | IsUsingDistanceCullFade () const |
| virtual void | OnDetachLight (const FLightSceneInfo *Light) |
| Called by the rendering thread to notify the proxy when a light is no longer associated with the proxy, so that it can clean up any cached resources. 更多... | |
| virtual void | OnLevelAddedToWorld () |
| Called to notify the proxy that the level has been fully added to the world and the primitive will now be rendered. 更多... | |
| virtual void | OnTransformChanged () |
| Called to notify the proxy when its transform has been updated. 更多... | |
| ENGINE_API void | RenderBounds (FPrimitiveDrawInterface *PDI, const FEngineShowFlags &EngineShowFlags, const FBoxSphereBounds &Bounds, bool bRenderInEditor) const |
| Helper for components that want to render bounds. | |
| void | SetCollisionEnabled_GameThread (const bool bNewEnabled) |
| Set the collision flag on the scene proxy to enable/disable collision drawing 更多... | |
| void | SetCollisionEnabled_RenderThread (const bool bNewEnabled) |
| Set the collision flag on the scene proxy to enable/disable collision drawing (RENDER THREAD) 更多... | |
| void | SetCustomDepthEnabled_GameThread (const bool bInRenderCustomDepth) |
| Set the custom depth enabled flag 更多... | |
| void | SetCustomDepthEnabled_RenderThread (const bool bInRenderCustomDepth) |
| Set the custom depth enabled flag (RENDER THREAD) 更多... | |
| void | SetCustomDepthStencilValue_GameThread (const int32 InCustomDepthStencilValue) |
| Set the custom depth stencil value 更多... | |
| void | SetCustomDepthStencilValue_RenderThread (const int32 InCustomDepthStencilValue) |
| Set the custom depth stencil value (RENDER THREAD) 更多... | |
| virtual ENGINE_API void | SetDebugMassData (const TArray< FDebugMassData > &InDebugMassData) |
| Sets the primitive proxy's mass space to component space. 更多... | |
| void | SetHiddenEdViews_GameThread (uint64 InHiddenEditorViews) |
| Updates the hidden editor view visibility map on the game thread which just enqueues a command on the render thread | |
| void | SetHovered_GameThread (const bool bInHovered) |
| Updates hover state for the primitive proxy. 更多... | |
| void | SetLightingChannels_GameThread (FLightingChannels LightingChannels) |
| Updates the lighting channels for the primitive proxy. | |
| void | SetSelection_GameThread (const bool bInParentSelected, const bool bInIndividuallySelected=false) |
| Updates selection for the primitive proxy. 更多... | |
| ENGINE_API void | UpdateUniformBuffer () |
| Updates the primitive proxy's uniform buffer. | |
| ENGINE_API bool | VerifyUsedMaterial (const class FMaterialRenderProxy *MaterialRenderProxy) const |
| Verifies that a material used for rendering was present in the component's GetUsedMaterials list. | |
| virtual ENGINE_API | ~FPrimitiveSceneProxy () |
| Virtual destructor. | |
静态 Public 成员函数 | |
| static ENGINE_API void | DrawArc (FPrimitiveDrawInterface *PDI, const FVector &Start, const FVector &End, const float Height, const uint32 Segments, const FLinearColor &Color, uint8 DepthPriorityGroup, const float Thickness=0.0f, const bool bScreenSpace=false) |
| Drawing helper. 更多... | |
Protected 成员函数 | |
| bool | DrawInVirtualTextureOnly (bool bEditor) const |
| Returns true if primitive should be hidden because it is drawn only to the runtime virtual texture. | |
| void | OverrideOwnerName (FName InOwnerName) |
| Allow subclasses to override the primitive name. 更多... | |
| void | SetHovered_RenderThread (const bool bInHovered) |
| Updates hover state for the primitive proxy. 更多... | |
| void | SetSelection_RenderThread (const bool bInParentSelected, const bool bInIndividuallySelected) |
| Updates selection for the primitive proxy. 更多... | |
Protected 属性 | |
| uint8 | bAffectDynamicIndirectLighting: 1 |
| True if the primitive casts Reflective Shadow Map shadows (meaning it affects Light Propagation Volumes). | |
| uint8 | bAlwaysHasVelocity: 1 |
| Whether the primitive should always be considered to have velocities, even if it hasn't moved. | |
| uint8 | bCastCapsuleDirectShadow: 1 |
| Whether the primitive should use capsules for direct shadowing, if present. 更多... | |
| uint8 | bCastCinematicShadow: 1 |
| Whether this component should create a per-object shadow that gives higher effective shadow resolution. 更多... | |
| uint8 | bCastContactShadow: 1 |
| Whether the object should cast a contact shadow | |
| uint8 | bCastDynamicShadow: 1 |
| True if the primitive casts dynamic shadows. | |
| uint8 | bCastHiddenShadow: 1 |
| True if the primitive casts shadows even when hidden. | |
| uint8 | bCastInsetShadow: 1 |
| Whether this component should create a per-object shadow that gives higher effective shadow resolution. 更多... | |
| uint8 | bCastsDynamicIndirectShadow: 1 |
| Whether the primitive should use an inset indirect shadow from capsules or mesh distance fields. | |
| uint8 | bCastShadowAsTwoSided: 1 |
| Whether this primitive should cast dynamic shadows as if it were a two sided material. | |
| uint8 | bCastStaticShadow: 1 |
| True if the primitive casts static shadows. | |
| uint8 | bCastVolumetricTranslucentShadow: 1 |
| Whether the object should cast a volumetric translucent shadow. 更多... | |
| uint8 | bGoodCandidateForCachedShadowmap: 1 |
| Whether this proxy's mesh is unlikely to be constantly changing. | |
| uint8 | bHasValidSettingsForStaticLighting: 1 |
| True if the primitive wants to use static lighting, but has invalid content settings to do so. | |
| uint8 | bLightAttachmentsAsGroup: 1 |
| Whether to light this component and any attachments as a group. 更多... | |
| uint8 | bNeedsLevelAddedToWorldNotification: 1 |
| Whether this primitive requires notification when its level is added to the world and made visible for the first time. | |
| uint8 | bNeedsUnbuiltPreviewLighting: 1 |
| Whether the primitive should be statically lit but has unbuilt lighting, and a preview should be used. | |
| uint8 | bSelfShadowOnly: 1 |
| When enabled, the component will only cast a shadow on itself and not other components in the world. 更多... | |
| uint8 | bSingleSampleShadowFromStationaryLights: 1 |
| Whether the whole component should be shadowed as one from stationary lights, which makes shadow receiving much cheaper. 更多... | |
| uint8 | bStaticElementsAlwaysUseProxyPrimitiveUniformBuffer: 1 |
| Whether this proxy always uses UniformBuffer and no other uniform buffers. 更多... | |
| uint8 | bSupportsDistanceFieldRepresentation: 1 |
| Whether the primitive type supports a distance field representation. 更多... | |
| uint8 | bSupportsHeightfieldRepresentation: 1 |
| Whether the primitive implements GetHeightfieldRepresentation() | |
| uint8 | bVFRequiresPrimitiveUniformBuffer: 1 |
| Whether this proxy ever draws with vertex factories that require a primitive uniform buffer. 更多... | |
| uint8 | bWantsSelectionOutline: 1 |
| true by default, if set to false will make given proxy never drawn with selection outline | |
| uint8 | bWillEverBeLit: 1 |
| Can be set to false to skip some work only needed on lit primitives. | |
| float | DynamicIndirectShadowMinVisibility |
| Min visibility for capsule shadows. | |
| TEnumAsByte< EIndirectLightingCacheQuality > | IndirectLightingCacheQuality |
| Quality of interpolated indirect lighting for Movable components. | |
| float | LpvBiasMultiplier |
| The bias applied to LPV injection | |
| TArray< ERuntimeVirtualTextureMaterialType > | RuntimeVirtualTextureMaterialTypes |
| Set of unique runtime virtual texture material types referenced by RuntimeVirtualTextures. | |
| TArray< URuntimeVirtualTexture * > | RuntimeVirtualTextures |
| Array of runtime virtual textures that this proxy should render to. | |
| int8 | VirtualTextureCullMips |
| Number of low mips to skip when rendering to runtime virtual texture. | |
| int8 | VirtualTextureLodBias |
| Geometry Lod bias when rendering to runtime virtual texture. | |
| int8 | VirtualTextureMinCoverage |
| Log2 of minimum estimated pixel coverage before culling from runtime virtual texture. | |
Encapsulates the data which is mirrored to render a UPrimitiveComponent parallel to the game thread.
This is intended to be subclassed to support different primitive types.
| typedef TArray<class FLightCacheInterface*, TInlineAllocator<8> > FPrimitiveSceneProxy::FLCIArray |
Get the list of LCIs.
Used to set the precomputed lighting uniform buffers, which can only be created by the RENDERER_API.
|
inlinevirtual |
Gives the primitive the results of sub-occlusion-queries
| View | - the view the occlusion results are for |
| Results | - visibility results, allocated from the scene allocator, so valid until the end of the frame |
| NumResults | - number of visibility bools |
|
virtual |
Applies a "late in the frame" adjustment to the proxy's existing transform
| LateUpdateTransform | - The post-transform to be applied to the LocalToWorld matrix |
|
virtual |
Shifts primitive position and all relevant data by an arbitrary delta.
Called on world origin changes
| InOffset | - The delta to shift by |
|
inlinevirtual |
被 FSkeletalMeshSceneProxy , 以及 FStaticMeshSceneProxy 重载.
|
virtual |
Creates the hit proxies are used when DrawDynamicElements is called.
Called in the game thread.
| OutHitProxies | - Hit proxes which are created should be added to this array. |
|
inlinevirtual |
Called when the rendering thread adds the proxy to the scene.
This function allows for generating renderer-side resources. Called in the rendering thread.
被 FStaticMeshSceneProxy 重载.
|
inlinevirtual |
Called when the rendering thread removes the proxy from the scene.
This function allows for removing renderer-side resources. Called in the rendering thread.
被 FStaticMeshSceneProxy 重载.
|
static |
Drawing helper.
Draws nice bouncy line.
|
inlinevirtual |
Draws the primitive's static elements.
This is called from the rendering thread once when the scene proxy is created. The static elements will only be rendered if GetViewRelevance declares static relevance.
| PDI | - The interface which receives the primitive elements. |
被 FSkeletalMeshSceneProxy , 以及 FStaticMeshSceneProxy 重载.
|
inlinevirtual |
Return the custom occlusion bounds for this scene proxy.
|
inline |
Get the custom primitive data for this scene proxy.
|
inline |
Determines the DPG to render the primitive in for the given view.
May be called regardless of the result of HasViewDependentDPG.
| View | - The view to determine the primitive's DPG for. |
|
inlinevirtual |
Gathers the primitive's dynamic mesh elements.
This will only be called if GetViewRelevance declares dynamic relevance. This is called from the rendering thread for each set of views that might be rendered.
Game thread state like UObjects must have their properties mirrored on the proxy to avoid race conditions. The rendering thread must not dereference UObjects. The gathered mesh elements will be used multiple times, any memory referenced must last as long as the Collector (eg no stack memory should be referenced). This function should not modify the proxy but simply collect a description of things to render. Updates to the proxy need to be pushed from game thread or external events.
| Views | - the array of views to consider. These may not exist in the ViewFamily. |
| ViewFamily | - the view family, for convenience |
| VisibilityMap | - a bit representing this proxy's visibility in the Views array |
| Collector | - gathers the mesh elements to be rendered and provides mechanisms for temporary allocations |
被 FLineBatcherSceneProxy, FSkeletalMeshSceneProxy , 以及 FStaticMeshSceneProxy 重载.
|
inlinevirtual |
Get the lightmap resolution for this primitive.
Used in VMI_LightmapDensity.
|
inlinevirtual |
Determines the relevance of this primitive's elements to the given light.
| LightSceneProxy | The light to determine relevance for |
| bDynamic | (output) The light is dynamic for this primitive |
| bRelevant | (output) The light is relevant for this primitive |
| bLightMapped | (output) The light is light mapped for this primitive |
被 FStaticMeshSceneProxy 重载.
|
inlinevirtual |
Gets the boxes for sub occlusion queries
| View | - the view the occlusion results are for |
|
inlinevirtual |
Determines the DPG to render the primitive in regardless of view.
Should only be called if HasViewDependentDPG()==true.
|
virtual |
Determines the relevance of this primitive's elements to the given view.
Called in the rendering thread.
| View | - The view to determine relevance for. |
被 FLineBatcherSceneProxy, FSkeletalMeshSceneProxy, FSplineMeshSceneProxy , 以及 FStaticMeshSceneProxy 重载.
|
inlinevirtual |
Returns whether the proxy utilizes custom occlusion bounds or not
|
inlinevirtual |
|
inlinevirtual |
Returns whether this proxy should be considered a "detail mesh".
Detail meshes are distance culled even if distance culling is normally disabled for the view. (e.g. in editor)
| ENGINE_API bool FPrimitiveSceneProxy::IsShadowCast | ( | const FSceneView * | View | ) | const |
| ENGINE_API bool FPrimitiveSceneProxy::IsShown | ( | const FSceneView * | View | ) | const |
|
inlinevirtual |
被 FSkeletalMeshSceneProxy , 以及 FStaticMeshSceneProxy 重载.
|
inlinevirtual |
Called by the rendering thread to notify the proxy when a light is no longer associated with the proxy, so that it can clean up any cached resources.
| Light | - The light to be removed. |
|
inlinevirtual |
Called to notify the proxy that the level has been fully added to the world and the primitive will now be rendered.
Only called if bNeedsLevelAddedToWorldNotification is set to true.
|
inlinevirtual |
Called to notify the proxy when its transform has been updated.
Called in the thread that owns the proxy; game or rendering.
被 FSkeletalMeshSceneProxy 重载.
|
inlineprotected |
Allow subclasses to override the primitive name.
Used primarily by BSP.
| void FPrimitiveSceneProxy::SetCollisionEnabled_GameThread | ( | const bool | bNewEnabled | ) |
Set the collision flag on the scene proxy to enable/disable collision drawing
| const | bool bNewEnabled new state for collision drawing |
| void FPrimitiveSceneProxy::SetCollisionEnabled_RenderThread | ( | const bool | bNewEnabled | ) |
Set the collision flag on the scene proxy to enable/disable collision drawing (RENDER THREAD)
| const | bool bNewEnabled new state for collision drawing |
| void FPrimitiveSceneProxy::SetCustomDepthEnabled_GameThread | ( | const bool | bInRenderCustomDepth | ) |
Set the custom depth enabled flag
| the | new value |
| void FPrimitiveSceneProxy::SetCustomDepthEnabled_RenderThread | ( | const bool | bInRenderCustomDepth | ) |
Set the custom depth enabled flag (RENDER THREAD)
| the | new value |
| void FPrimitiveSceneProxy::SetCustomDepthStencilValue_GameThread | ( | const int32 | InCustomDepthStencilValue | ) |
Set the custom depth stencil value
| the | new value |
| void FPrimitiveSceneProxy::SetCustomDepthStencilValue_RenderThread | ( | const int32 | InCustomDepthStencilValue | ) |
Set the custom depth stencil value (RENDER THREAD)
| the | new value |
|
virtual |
Sets the primitive proxy's mass space to component space.
Useful for debugging physics center of mass and inertia tensor
| void FPrimitiveSceneProxy::SetHovered_GameThread | ( | const bool | bInHovered | ) |
Updates hover state for the primitive proxy.
This simply sends a message to the rendering thread to call SetHovered_RenderThread. This is called in the game thread as hover state changes
| bInHovered | - true if the parent actor is hovered |
|
protected |
Updates hover state for the primitive proxy.
This is called in the rendering thread by SetHovered_GameThread.
| void FPrimitiveSceneProxy::SetSelection_GameThread | ( | const bool | bInParentSelected, |
| const bool | bInIndividuallySelected = false |
||
| ) |
Updates selection for the primitive proxy.
This simply sends a message to the rendering thread to call SetSelection_RenderThread. This is called in the game thread as selection is toggled.
| bInParentSelected | - true if the parent actor is selected in the editor |
| bInIndividuallySelected | - true if the component is selected in the editor directly |
|
protected |
Updates selection for the primitive proxy.
This is called in the rendering thread by SetSelection_GameThread.
|
protected |
Whether the primitive should use capsules for direct shadowing, if present.
Forces inset shadows.
|
protected |
Whether this component should create a per-object shadow that gives higher effective shadow resolution.
Useful for cinematic character shadowing. Assumed to be enabled if bSelfShadowOnly is enabled.
|
protected |
Whether this component should create a per-object shadow that gives higher effective shadow resolution.
true if bSelfShadowOnly is true.
|
protected |
Whether the object should cast a volumetric translucent shadow.
Volumetric translucent shadows are useful for primitives with smoothly changing opacity like particles representing a volume, But have artifacts when used on highly opaque surfaces.
|
protected |
Whether to light this component and any attachments as a group.
This only has effect on the root component of an attachment tree. When enabled, attached component shadowing settings like bCastInsetShadow, bCastVolumetricTranslucentShadow, etc, will be ignored. This is useful for improving performance when multiple movable components are attached together.
|
protected |
When enabled, the component will only cast a shadow on itself and not other components in the world.
This is especially useful for first person weapons, and forces bCastInsetShadow to be enabled.
|
protected |
Whether the whole component should be shadowed as one from stationary lights, which makes shadow receiving much cheaper.
When enabled shadowing data comes from the volume lighting samples precomputed by Lightmass, which are very sparse. This is currently only used on stationary directional lights.
|
protected |
Whether this proxy always uses UniformBuffer and no other uniform buffers.
When true, a fast path for updating can be used that does not update static draw lists.
|
protected |
Whether the primitive type supports a distance field representation.
Does not mean the primitive has a valid representation.
|
protected |
Whether this proxy ever draws with vertex factories that require a primitive uniform buffer.
When false, updating the primitive uniform buffer can be skipped since vertex factories always use GPUScene instead.