Files
UnrealEngineUWP/Engine/Source/Runtime/Foliage/Private/InstancedGrass.cpp
jamie hayes 5f34587cc5 UHierarchicalInstancedStaticMeshComponent: Stop assuming that an empty PerinstanceSMData means that the component is grass (incorrect for Nanite grass since recent changes to AcceptPrebuiltTree).
Created UGrassHierarchicalInstancedStaticMeshComponent for the purpose of moving all Landscape grass-specific logic to a subclass (similar to Foliage), and out of the generic HISM base as much as possible.
Deprecated a couple of HISM methods that are currently only used by grass in preparation to move them to the new subclass.

#rb jeremy.moore
#preflight 62630191cf17922036da1d5f

#ROBOMERGE-AUTHOR: jamie.hayes
#ROBOMERGE-SOURCE: CL 19870897 via CL 19871939 via CL 19873152
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v940-19807014)

[CL 19875905 by jamie hayes in ue5-main branch]
2022-04-22 18:29:36 -04:00

52 lines
1.6 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "GrassInstancedStaticMeshComponent.h"
UGrassInstancedStaticMeshComponent::UGrassInstancedStaticMeshComponent(const FObjectInitializer& ObjectInitializer) :
Super(ObjectInitializer)
{
ViewRelevanceType = EHISMViewRelevanceType::Grass;
}
void UGrassInstancedStaticMeshComponent::BuildTreeAnyThread(
TArray<FMatrix>& InstanceTransforms,
TArray<float>& InstanceCustomDataFloats,
int32 NumCustomDataFloats,
const FBox& MeshBox,
TArray<FClusterNode>& OutClusterTree,
TArray<int32>& OutSortedInstances,
TArray<int32>& OutInstanceReorderTable,
int32& OutOcclusionLayerNum,
int32 MaxInstancesPerLeaf,
bool InGenerateInstanceScalingRange
)
{
// TODO: Move the implementation of this function in the base here in 5.2
PRAGMA_DISABLE_DEPRECATION_WARNINGS
Super::BuildTreeAnyThread(
InstanceTransforms,
InstanceCustomDataFloats,
NumCustomDataFloats,
MeshBox,
OutClusterTree,
OutSortedInstances,
OutInstanceReorderTable,
OutOcclusionLayerNum,
MaxInstancesPerLeaf,
InGenerateInstanceScalingRange);
PRAGMA_ENABLE_DEPRECATION_WARNINGS
}
void UGrassInstancedStaticMeshComponent::AcceptPrebuiltTree(TArray<FInstancedStaticMeshInstanceData>& InInstanceData, TArray<FClusterNode>& InClusterTree, int32 InOcclusionLayerNumNodes, int32 InNumBuiltRenderInstances)
{
// TODO: Move the implementation of this function in the base to here in 5.2
PRAGMA_DISABLE_DEPRECATION_WARNINGS
Super::AcceptPrebuiltTree(
InInstanceData,
InClusterTree,
InOcclusionLayerNumNodes,
InNumBuiltRenderInstances);
PRAGMA_ENABLE_DEPRECATION_WARNINGS
}