// Copyright Epic Games, Inc. All Rights Reserved. #pragma once #include "MuR/Instance.h" #include "MuR/ImagePrivate.h" #include "MuR/MeshPrivate.h" namespace mu { /** Helper functions to make and read FResourceIDs */ inline FResourceID MakeResourceID(uint32 RootAddress, uint32 ParameterBlobIndex) { return (uint64(RootAddress) << 32) | uint64(ParameterBlobIndex); } /** */ struct FInstanceSurface { FName Name; uint32 InternalId=0; uint32 ExternalId =0; uint32 SharedId =0; struct FInstanceImage { FResourceID Id; FName Name; }; TArray> Images; struct FInstanceVector { FVector4f Value; FName Name; }; TArray Vectors; struct FInstanceScalar { float Value; FName Name; }; TArray Scalars; struct FInstanceString { FString Value; FName Name; }; TArray Strings; }; struct FInstanceLOD { FResourceID MeshId; FName MeshName; // The order must match the meshes surfaces TArray> Surfaces; }; struct FInstanceComponent { uint16 Id; float OverlayMaterialId = -1.f; TArray> LODs; }; struct NamedExtensionData { TSharedPtr Data; FName Name; }; class FInstance::Private { public: //! FInstance::FID Id = 0; //! TArray> Components; // Every entry must have a valid ExtensionData and name TArray ExtensionData; int32 AddComponent(); int32 AddLOD(int32 ComponentIndex); void SetMesh(int32 ComponentIndex, int32 LODIndex, FResourceID, FName Name); int32 AddSurface(int32 ComponentIndex, int32 LODIndex); void SetSurfaceName( int32 ComponentIndex, int32 LODIndex, int32 SurfaceIndex, FName Name); int32 AddImage( int32 ComponentIndex, int32 LODIndex, int32 SurfaceIndex, FResourceID, FName Name); int32 AddVector( int32 ComponentIndex, int32 LODIndex, int32 SurfaceIndex, const FVector4f&, FName Name); int32 AddScalar( int32 ComponentIndex, int32 LODIndex, int32 SurfaceIndex, float, FName Name); int32 AddString( int32 ComponentIndex, int32 LODIndex, int32 SurfaceIndex, const FString& Value, FName Name); void AddOverlayMaterial( int32 ComponentIndex, float OverlayMaterialId); // Data must be non-null void AddExtensionData(const TSharedPtr& Data, FName Name); }; }