FLandscapeComponentSceneProxy

[FLandscapeComponentSceneProxy](API\Runtime\Landscape\FLandscapeComponentSceneProxy)

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

Landscape

Header

/Engine/Source/Runtime/Landscape/Public/LandscapeRender.h

Include

#include "LandscapeRender.h"

Syntax

class FLandscapeComponentSceneProxy :
    public FPrimitiveSceneProxy,
    public FLandscapeNeighborInfo

Remarks

Variables

Name Description

Protected variable

TArray< UMateri...

 

AvailableMaterials

All available materials for non mobile, including LOD Material, Tessellation generated materials

Protected variable

UTexture2D *...

 

BaseColorForGITexture

Protected variable

bool: 1

 

bRequiresAdjacencyInformation

Protected variable

int32

 

CollisionMipLevel

Data used in editor or visualisers

Protected variable

FCollisionRespo...

 

CollisionResponse

Protected variable

TUniquePtr< FLa...

 

ComponentLightInfo

Protected variable

float

 

ComponentMaxExtend

Protected variable

int32

 

ComponentSizeQuads

Size of the component in unique heights.

Protected variable

int32

 

ComponentSizeVerts

ComponentSizeQuads + 1.

Protected variable

float

 

ComponentSquaredScreenSizeToUseSubSections

Protected variable

FLandscapeEditT...

 

EditToolRenderData

Protected variable

int32

 

FirstLOD

Protected variable

int32

 

FirstVirtualTextureLOD

Protected variable

FLandscapeVerte...

 

FixedGridVertexFactory

Protected variable

TArray< FLandsc...

 

GrassBatchParams

Protected variable

FMeshBatch

 

GrassMeshBatch

Precomputed grass rendering MeshBatch and per-LOD params.

Protected variable

FVector4

 

HeightmapScaleBias

Protected variable

float

 

HeightmapSubsectionOffsetU

Protected variable

float

 

HeightmapSubsectionOffsetV

Protected variable

const ULandscap...

 

LandscapeComponent

Protected variable

TUniformBuffer<...

 

LandscapeUniformShaderParameters

Protected variable

int32

 

LastLOD

Protected variable

int32

 

LastVirtualTextureLOD

Protected variable

TArray< FLinear...

 

LayerColors

Protected variable

int32

 

LightMapResolution

LightMap resolution used for VMI_LightmapDensity

Protected variable

FMatrix

 

LocalToWorldNoScaling

Protected variable

TArray< int8 >

 

LODIndexToMaterialIndex

Mapping between LOD and Material Index

Protected variable

TArray< float >

 

LODScreenRatioSquared

Protected variable

TBitArray

 

MaterialHasTessellationEnabled

A cache to know if the material stored in AvailableMaterials[X] has tessellation enabled

Protected variable

TArray< int8 >

 

MaterialIndexToDisabledTessellationMaterial

Mapping between Material Index to associated generated disabled Tessellation Material

Protected variable

TArray< int8 >

 

MaterialIndexToStaticMeshBatchLOD

Mapping between Material Index to Static Mesh Batch

Protected variable

TArray< FMateri...

 

MaterialRelevances

Material Relevance for each material in AvailableMaterials

Protected variable

int8

 

MaxLOD

Protected variable

float

 

MaxValidLOD

Protected variable

float

 

MinValidLOD

Protected variable

UTexture2D *...

 

NormalmapTexture

Protected variable

int32

 

NumSubsections

Number of subsections within the component in each dimension, this can be 1 or 2.

Protected variable

int8

 

NumWeightmapLayerAllocations

Protected variable

FIntPoint

 

SectionBase

Address of the component within the parent Landscape in unique height texels.

Protected variable

FLandscapeShare...

 

SharedBuffers

Protected variable

uint32

 

SharedBuffersKey

Protected variable

int32

 

SimpleCollisionMipLevel

Protected variable

TArray< FLandsc...

 

StaticBatchParamArray

Storage for static draw list batch params.

Protected variable

uint8

 

StaticLightingLOD

Protected variable

float

 

StaticLightingResolution

Protected variable

TArray< FVector...

 

SubSectionScreenSizeTestingPosition

Protected variable

int32

 

SubsectionSizeQuads

Number of unique heights in the subsection.

Protected variable

int32

 

SubsectionSizeVerts

Number of heightmap heights in the subsection. This includes the duplicate row at the end.

Protected variable

float

 

TessellationComponentScreenSizeFalloff

Protected variable

float

 

TessellationComponentSquaredScreenSize

Protected variable

bool: 1

 

UseTessellationComponentScreenSizeFalloff

Protected variable

FLandscapeVerte...

 

VertexFactory

Protected variable

int32

 

VisibilityWeightmapChannel

Protected variable

UTexture2D *...

 

VisibilityWeightmapTexture

Protected variable

FVector4

 

WeightmapScaleBias

Protected variable

float

 

WeightmapSubsectionOffset

Protected variable

TArray< UTextur...

 

WeightmapTextures

Protected variable

FMatrix

 

WorldToLocal

Cached versions of these.

Protected variable

UTexture2D *...

 

XYOffsetmapTexture

Constructors

Name Description

Public function

FLandscapeComponentSceneProxy

(
    ULandscapeComponent* InCompone...
)

Constructor

Destructors

Functions

Name Description

Protected function Const

void

 

BuildDynamicMeshElement

(
    const FViewCustomDataLOD* InPr...,
    bool InToolMesh,
    bool InHasTessellation,
    bool InDisableTessellation,
    FMeshBatch& OutMeshBatch,
    TArray< FLandscapeBatchElementParam...
)

Protected function Const

void

 

CalculateBatchElementLOD

(
    const FSceneView& InView,
    float InMeshScreenSizeSquared,
    float InViewLODScale,
    FViewCustomDataLOD& InOutLODData,
    bool InForceCombined
)

Protected function Const

void

 

CalculateLODFromScreenSize

(
    const FSceneView& InView,
    float InMeshScreenSizeSquared,
    float InViewLODScale,
    int32 InSubSectionIndex,
    FViewCustomDataLOD& InOutLODData
)

Protected function Const

bool

 

CanUseMeshBatchForShadowCascade

(
    int8 InLODIndex,
    float InShadowMapTextureResolution,
    float InShadowMapCascadeSize
)

Public function

void

 

ChangeComponentScreenSizeToUseSubSections_RenderThread

(
    float InComponentScreenSizeToUseSub...
)

Public function

void

 

ChangeTessellationComponentScreenSize_RenderThread

(
    float InTessellationComponentScreen...
)

FLandcapeSceneProxy.

Public function

void

 

ChangeTessellationComponentScreenSizeFalloff_RenderThread

(
    float InTessellationComponentScreen...
)

Public function

void

 

ChangeUseTessellationComponentScreenSizeFalloff_RenderThread

(
    bool InUseTessellationComponentScre...
)

Protected function Const

float

 

ComputeBatchElementCurrentLOD

(
    int32 InSelectedLODIndex,
    float InComponentScreenSize,
    float InViewLODScale
)

Protected function

void

 

ComputeStaticBatchIndexToRender

(
    FViewCustomDataLOD& OutLODData,
    int32 InSubSectionIndex
)

Protected function Const

void

 

ComputeTessellationFalloffShaderValues

(
    const FViewCustomDataLOD& InLODDat...,
    const FMatrix& InViewProjectionMat...,
    float& OutC,
    float& OutK
)

Protected function Const

int32

 

ConvertBatchElementLODToBatchElementIndex

(
    int8 InBatchElementLOD,
    bool InUseCombinedMeshBatch
)

Protected function Const

float

 

GetComponentScreenSize

(
    const FSceneView* View,
    const FVector& Origin,
    float MaxExtend,
    float ElementRadius
)

Public function Const

const FMeshB...

 

GetGrassMeshBatch()

Protected function Const

int8

 

GetLODFromScreenSize

(
    float InScreenSizeSquared,
    float InViewLODScale
)

Protected function Const

bool

 

GetMeshElement

(
    bool UseSeperateBatchForShadow,
    bool ShadowOnly,
    bool HasTessellation,
    int8 InLODIndex,
    UMaterialInterface* InMaterial...,
    FMeshBatch& OutMeshBatch,
    TArray< FLandscapeBatchElementParam...
)

Protected function Const

bool

 

GetMeshElementForVirtualTexture

(
    int32 InLodIndex,
    ERuntimeVirtualTextureMaterialType ...,
    UMaterialInterface* InMaterial...,
    FMeshBatch& OutMeshBatch,
    TArray< FLandscapeBatchElementParam...
)

Creates a mesh batch for virtual texture rendering.

Protected function Const

float

 

GetNeighborLOD

(
    const FSceneView& InView,
    float InBatchElementCurrentLOD,
    int8 InNeighborIndex,
    int8 InSubSectionX,
    int8 InSubSectionY,
    int8 InCurrentSubSectionIndex
)

Protected function Const

void

 

GetShaderCurrentNeighborLOD

(
    const FSceneView& InView,
    float InBatchElementCurrentLOD,
    int8 InSubSectionX,
    int8 InSubSectionY,
    int8 InCurrentSubSectionIndex,
    FVector4& OutShaderCurrentNeighbor...
)

Protected function Const

FVector4

 

GetShaderLODBias()

Protected function Const

FVector4

 

GetShaderLODValues

(
    int8 BatchElementCurrentLOD
)

Public function Const

uint64

 

GetStaticBatchElementVisibility

(
    const FSceneView& InView,
    const FMeshBatch* InBatch,
    const void* InViewCustomData
)

Public function Virtual

void *

 

InitViewCustomData

(
    const FSceneView& InView,
    float InViewLODScale,
    FMemStackBase& InCustomDataMemStac...,
    bool InIsStaticRelevant,
    bool InIsShadowOnly,
    const FLODMask* InVisiblePrimi...,
    float InMeshScreenSizeSquared
)

Public function Const

void

 

PostInitViewCustomData

(
    const FSceneView& InView,
    void* InViewCustomData
)

Overridden from FPrimitiveSceneProxy

Name Description

Public function Virtual

void

 

ApplyWorldOffset

(
    FVector InOffset
)

Shifts primitive position and all relevant data by an arbitrary delta.

Public function Virtual Const

bool

 

CanBeOccluded()

Public function Virtual Const

int32

 

CollectOccluderElements

(
    FOccluderElementsCollector& Collec...
)

Collects occluder geometry for software occlusion culling

Public function Virtual

void

 

CreateRenderThreadResources()

Called when the rendering thread adds the proxy to the scene.

Public function Virtual

void

 

DrawStaticElements

Draws the primitive's static elements.

Public function Virtual Const

FLODMask

 

GetCustomLOD

(
    const FSceneView& InView,
    float InViewLODScale,
    int32 InForcedLODLevel,
    float& OutScreenSizeSquared
)

Called during the scene visibility phase or shadow phase, if primitive wasn't visible but project visible shadow, on static primitives to override default LOD logic but only if IsUsingCustomLODRules() return true.

Public function Virtual Const

FLODMask

 

GetCustomWholeSceneShadowLOD

(
    const FSceneView& InView,
    float InViewLODScale,
    int32 InForcedLODLevel,
    const FLODMask& InVisibilePrimitiv...,
    float InShadowMapTextureResolution,
    float InShadowMapCascadeSize,
    int8 InShadowCascadeId,
    bool InHasSelfShadow
)

Called during the whole scene shadow phase on static primitives to override default LOD logic but only if IsUsingCustomWholeSceneShadowLODRules() return true.

Public function Virtual Const

void

 

GetDynamicMeshElements

(
    const TArray< const FSceneView*...,
    const FSceneViewFamily& ViewFamily,
    uint32 VisibilityMap,
    FMeshElementCollector& Collector
)

Gathers the primitive's dynamic mesh elements.

Public function Virtual

void

 

GetHeightfieldRepresentation

(
    UTexture2D*& OutHeightmapTextu...,
    UTexture2D*& OutDiffuseColorTe...,
    UTexture2D*& OutVisibilityText...,
    FHeightfieldComponentDescription& ...
)

Public function Virtual

void

 

GetLCIs

(
    FLCIArray& LCIs
)

Public function Virtual Const

int32

 

GetLightMapResolution()

Get the lightmap resolution for this primitive. Used in VMI_LightmapDensity.

Public function Virtual Const

void

 

GetLightRelevance

(
    const FLightSceneProxy* LightS...,
    bool& bDynamic,
    bool& bRelevant,
    bool& bLightMapped,
    bool& bShadowMapped
)

Determines the relevance of this primitive's elements to the given light.

Public function Virtual Const

uint32

 

GetMemoryFootprint()

Every derived class should override these functions

Public function Virtual Const

FPrimitiveVi...

 

GetViewRelevance

(
    const FSceneView* View
)

Determines the relevance of this primitive's elements to the given view.

Public function Virtual Const

bool

 

HeightfieldHasPendingStreaming()

Public function Virtual Const

bool

 

IsUsingCustomLODRules()

Tell us if we should rely on the default LOD computing rules or not.

Public function Virtual Const

bool

 

IsUsingCustomWholeSceneShadowLODRules()

Tell us if we should rely on the default shadow LOD computing rules or not for generating whole scene shadow.

Public function 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.

Public function Virtual

void

 

OnTransformChanged()

Called to notify the proxy when its transform has been updated.

Overridden from FLandscapeNeighborInfo

Name Description

Protected function Virtual Const

const ULands...

 

GetLandscapeComponent()

Classes

Name

Description

Public struct

FViewCustomDataLOD

NOTE: CustomData is added in a FMemStack of the render thread, so no destructor will be called on any of the elements.

Public struct

FViewCustomDataSubSectionLOD

NOTE: CustomData is added in a FMemStack of the render thread, so no destructor will be called on any of the elements.

Constants

Name

Description

MAX_SUBSECTION_COUNT

SharedBuffersMap

Reference counted vertex and index buffer shared among all landscape scene proxies of the same component size Key is the component size and number of subsections.

Deprecated Variables

Name Description

Protected variable

ELandscapeLODFa...

 

LODFalloff_DEPRECATED

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback