UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FGrassVariety Struct Reference

#include <LandscapeGrassType.h>

Public Member Functions

UE_API FGrassVariety ()
 
UE_API bool IsGrassQualityLevelEnable () const
 
UE_API int32 GetStartCullDistance () const
 
UE_API int32 GetEndCullDistance () const
 
UE_API float GetDensity () const
 

Public Attributes

TObjectPtr< UStaticMeshGrassMesh
 
TArray< TObjectPtr< class UMaterialInterface > > OverrideMaterials
 
FPerPlatformFloat GrassDensity
 
FPerQualityLevelFloat GrassDensityQuality
 
bool bUseGrid
 
float PlacementJitter
 
FPerPlatformInt StartCullDistance
 
FPerQualityLevelInt StartCullDistanceQuality
 
FPerPlatformInt EndCullDistance
 
FPerQualityLevelInt EndCullDistanceQuality
 
int32 MinLOD
 
FFloatInterval AllowedDensityRange
 
EGrassScaling Scaling
 
FFloatInterval ScaleX
 
FFloatInterval ScaleY
 
FFloatInterval ScaleZ
 
bool bWeightAttenuatesMaxScale = false
 
float MaxScaleWeightAttenuation = 0.5f
 
bool RandomRotation
 
bool AlignToSurface
 
bool bAlignToTriangleNormals
 
bool bUseLandscapeLightmap
 
FLightingChannels LightingChannels
 
bool bReceivesDecals
 
bool bAffectDistanceFieldLighting
 
bool bCastDynamicShadow
 
bool bCastContactShadow
 
bool bKeepInstanceBufferCPUCopy
 
uint32 InstanceWorldPositionOffsetDisableDistance
 
EShadowCacheInvalidationBehavior ShadowCacheInvalidationBehavior
 

Constructor & Destructor Documentation

◆ FGrassVariety()

FGrassVariety::FGrassVariety ( )

Member Function Documentation

◆ GetDensity()

float FGrassVariety::GetDensity ( ) const

◆ GetEndCullDistance()

int32 FGrassVariety::GetEndCullDistance ( ) const

◆ GetStartCullDistance()

int32 FGrassVariety::GetStartCullDistance ( ) const

◆ IsGrassQualityLevelEnable()

bool FGrassVariety::IsGrassQualityLevelEnable ( ) const

Member Data Documentation

◆ AlignToSurface

bool FGrassVariety::AlignToSurface

Whether the grass instances should be tilted to the normal of the landscape (true), or always vertical (false)

◆ AllowedDensityRange

FFloatInterval FGrassVariety::AllowedDensityRange

Specifies the density range where the grass variety is allowed to be spawned ([0,1] represents the entire range).

◆ bAffectDistanceFieldLighting

bool FGrassVariety::bAffectDistanceFieldLighting

Controls whether the primitive should affect dynamic distance field lighting methods.

◆ bAlignToTriangleNormals

bool FGrassVariety::bAlignToTriangleNormals

When aligning to the surface when using grid mode, whether we should align to triangle normal (true) or a smooth grid-based normal (false). Halton always uses triangle normal.

◆ bCastContactShadow

bool FGrassVariety::bCastContactShadow

Whether the grass should cast contact shadows.

◆ bCastDynamicShadow

bool FGrassVariety::bCastDynamicShadow

Whether the grass should cast shadows when using non-precomputed shadowing.

◆ bKeepInstanceBufferCPUCopy

bool FGrassVariety::bKeepInstanceBufferCPUCopy

Whether we should keep a cpu copy of the instance buffer. This should be set to true if you plan on using GetOverlappingXXXXCount functions of the component otherwise it won't return any data.

◆ bReceivesDecals

bool FGrassVariety::bReceivesDecals

Whether the grass instances should receive decals.

◆ bUseGrid

bool FGrassVariety::bUseGrid

◆ bUseLandscapeLightmap

bool FGrassVariety::bUseLandscapeLightmap

◆ bWeightAttenuatesMaxScale

bool FGrassVariety::bWeightAttenuatesMaxScale = false

If enabled the the scale of instances is reduced as the weight (density) decreases

◆ EndCullDistance

FPerPlatformInt FGrassVariety::EndCullDistance

The distance where instances will have completely faded out when using a PerInstanceFadeAmount material node. 0 disables. When the entire cluster is beyond this distance, the cluster is completely culled and not rendered at all.

◆ EndCullDistanceQuality

FPerQualityLevelInt FGrassVariety::EndCullDistanceQuality

◆ GrassDensity

FPerPlatformFloat FGrassVariety::GrassDensity

◆ GrassDensityQuality

FPerQualityLevelFloat FGrassVariety::GrassDensityQuality

◆ GrassMesh

TObjectPtr<UStaticMesh> FGrassVariety::GrassMesh

◆ InstanceWorldPositionOffsetDisableDistance

uint32 FGrassVariety::InstanceWorldPositionOffsetDisableDistance

Distance at which to grass instances should disable WPO for performance reasons

◆ LightingChannels

FLightingChannels FGrassVariety::LightingChannels

Lighting channels that the grass will be assigned. Lights with matching channels will affect the grass. These channels only apply to opaque materials, direct lighting, and dynamic lighting and shadowing.

◆ MaxScaleWeightAttenuation

float FGrassVariety::MaxScaleWeightAttenuation = 0.5f

Modulate the scale of the instances based on weight (normalized density). The weight range (ScaleWeightAttenuation, 1.0) maps to (scaleMin, scaleMax), weight values less than ScaleWeightAttenuation are set to minScale

◆ MinLOD

int32 FGrassVariety::MinLOD

Specifies the smallest LOD that will be used for this component. If -1 (default), the MinLOD of the static mesh asset will be used instead.

◆ OverrideMaterials

TArray<TObjectPtr<class UMaterialInterface> > FGrassVariety::OverrideMaterials

◆ PlacementJitter

float FGrassVariety::PlacementJitter

◆ RandomRotation

bool FGrassVariety::RandomRotation

Whether the grass instances should be placed at random rotation (true) or all at the same rotation (false)

◆ ScaleX

FFloatInterval FGrassVariety::ScaleX

Specifies the range of scale, from minimum to maximum, to apply to a grass instance's X Scale property

◆ ScaleY

FFloatInterval FGrassVariety::ScaleY

Specifies the range of scale, from minimum to maximum, to apply to a grass instance's Y Scale property

◆ ScaleZ

FFloatInterval FGrassVariety::ScaleZ

Specifies the range of scale, from minimum to maximum, to apply to a grass instance's Z Scale property

◆ Scaling

EGrassScaling FGrassVariety::Scaling

Specifies grass instance scaling type

◆ ShadowCacheInvalidationBehavior

EShadowCacheInvalidationBehavior FGrassVariety::ShadowCacheInvalidationBehavior

Control shadow invalidation behavior, in particular with respect to Virtual Shadow Maps and material effects like World Position Offset.

◆ StartCullDistance

FPerPlatformInt FGrassVariety::StartCullDistance

◆ StartCullDistanceQuality

FPerQualityLevelInt FGrassVariety::StartCullDistanceQuality

The documentation for this struct was generated from the following files: