Files
UnrealEngineUWP/Engine/Source/Editor/SparseVolumeTexture/Private/SparseVolumeTextureOpenVDBUtility.h
tim doerries 838de94380 New streaming system for SparseVolumeTextures. It is based on the Nanite FStreamingManager design and supports streaming both from disk and from DDC. This first version uses a single logical tile data texture for all frames of a single UStreamableSparseVolumeTexture and starts streaming out tiles of older mip levels once it runs out of space. The highest mip level (lowest resolution) is always resident in the tile data texture, so there is always something available for rendering. Each frame's page table texture is currently always fully resident. There is now also a buffer storing the lowest resident mip level index for each frame.
In a future version, additional logical tile data textures may be allocated to handle cases where more mip levels are being requested than can physically fit into a single texture. In addition, page table textures should also be resized so that streamed out frames take up less GPU memory. It might also be necessary to implement a blocking streaming option for MRQ and similar use cases. This feature probably depends on being able to spill to additional physical page table textures.

Also moved all of the SVT runtime classes into a shared namespace (UE::SVT), which is why this CL ended up touching almost all SVT related files.

#rb Sebastien.Hillaire, Rune.Stubbe, Devon.Penney, Patrick.Kelly
#rnx
#preflight 64772ef20d55081f54759f0b

[CL 25699866 by tim doerries in ue5-main branch]
2023-05-31 08:14:22 -04:00

66 lines
1.3 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#if WITH_EDITOR
#include "CoreMinimal.h"
namespace UE
{
namespace SVT
{
struct FTextureData;
}
}
enum class EOpenVDBGridType : uint8
{
Unknown = 0,
Half,
Half2,
Half3,
Half4,
Float,
Float2,
Float3,
Float4,
Double,
Double2,
Double3,
Double4,
};
struct FOpenVDBGridInfo
{
FMatrix44f Transform;
FIntVector3 VolumeActiveAABBMin;
FIntVector3 VolumeActiveAABBMax;
FIntVector3 VolumeActiveDim;
FVector VolumeVoxelSize;
FString Name;
FString DisplayString; // Contains Index (into source file grids), Type and Name
uint32 Index;
uint32 NumComponents;
EOpenVDBGridType Type;
bool bIsInWorldSpace;
bool bHasUniformVoxels;
};
struct FOpenVDBToSVTConversionResult
{
struct FSparseVolumeAssetHeader* Header;
TArray<uint32>* PageTable;
TArray<uint8>* PhysicalTileDataA;
TArray<uint8>* PhysicalTileDataB;
};
bool IsOpenVDBGridValid(const FOpenVDBGridInfo& GridInfo, const FString& Filename);
bool GetOpenVDBGridInfo(TArray64<uint8>& SourceFile, bool bCreateStrings, TArray<FOpenVDBGridInfo>* OutGridInfo);
bool ConvertOpenVDBToSparseVolumeTexture(TArray64<uint8>& SourceFile, const struct FOpenVDBImportOptions& ImportOptions, const FIntVector3& VolumeBoundsMin, UE::SVT::FTextureData& OutResult);
const TCHAR* OpenVDBGridTypeToString(EOpenVDBGridType Type);
#endif // WITH_EDITOR