UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FAdaptiveVirtualTexture Class Referencefinal

#include <AdaptiveVirtualTexture.h>

+ Inheritance diagram for FAdaptiveVirtualTexture:

Classes

struct  FAllocatedInfo
 
struct  FProducerInfo
 

Public Member Functions

 FAdaptiveVirtualTexture (FAdaptiveVTDescription const &InAdaptiveDesc, FAllocatedVTDescription const &InAllocatedDesc)
 
void Init (FRHICommandListBase &RHICmdList, FVirtualTextureSystem *InSystem)
 
uint32 GetPackedAllocationRequest (uint32 vAddress, uint32 vLevelPlusOne, uint32 Frame) const
 
void QueuePackedAllocationRequests (TConstArrayView< uint32 > InRequests, uint32 InFrame)
 
void UpdateAllocations (FVirtualTextureSystem *InSystem, FRHICommandListImmediate &RHICmdList, uint32 InFrame)
 
void ApplyPageTableUpdates (FVirtualTextureSystem *InSystem, FRDGBuilder &GraphBuilder, FRDGExternalAccessQueue &ExternalAccessQueue)
 
virtual IAllocatedVirtualTextureGetAllocatedVirtualTexture () override
 
virtual int32 GetSpaceID () const override
 
void GetProducers (FIntRect const &InTextureRegion, uint32 InMaxLevel, TArray< FProducerInfo > &OutProducerInfos) const
 
void GetAllocatedVirtualTextures (FBox2D const &InUVRegion, uint32 InLevel, TArray< FAllocatedInfo > &OutInfos, TArray< uint32 > &OutAllocationRequests)
 

Static Public Member Functions

static void QueuePackedAllocationRequests (FVirtualTextureSystem *InSystem, TConstArrayView< uint32 > InRequests, uint32 InFrame)
 

Protected Member Functions

virtual void Destroy (class FVirtualTextureSystem *InSystem) override
 
- Protected Member Functions inherited from IAdaptiveVirtualTexture
virtual ~IAdaptiveVirtualTexture ()
 

Detailed Description

Concrete implementation of an adaptive virtual texture. This allocates multiple virtual textures within the same space: one each for a grid of UV ranges, and an additional persistent one for the low resolution mips. We then use an additional page table indirection texture in the shader to select the correct page table address range for our sampled UV. We use the virtual texture feedback to decide when to increase or decrease the resolution of each UV range. When we change resolution for a range we directly remap the page table entires. This removes the cost and any visual glitch from regenerating the pages.

Constructor & Destructor Documentation

◆ FAdaptiveVirtualTexture()

FAdaptiveVirtualTexture::FAdaptiveVirtualTexture ( FAdaptiveVTDescription const &  InAdaptiveDesc,
FAllocatedVTDescription const &  InAllocatedDesc 
)

Member Function Documentation

◆ ApplyPageTableUpdates()

void FAdaptiveVirtualTexture::ApplyPageTableUpdates ( FVirtualTextureSystem InSystem,
FRDGBuilder GraphBuilder,
FRDGExternalAccessQueue ExternalAccessQueue 
)

Apply any page table updates.

RDG parameters for update pass.

◆ Destroy()

void FAdaptiveVirtualTexture::Destroy ( class FVirtualTextureSystem InSystem)
overrideprotectedvirtual

◆ GetAllocatedVirtualTexture()

IAllocatedVirtualTexture * FAdaptiveVirtualTexture::GetAllocatedVirtualTexture ( )
overridevirtual

Get the persistent allocated virtual texture for low mips from the adaptive virtual texture.

Implements IAdaptiveVirtualTexture.

◆ GetAllocatedVirtualTextures()

void FAdaptiveVirtualTexture::GetAllocatedVirtualTextures ( FBox2D const &  InUVRegion,
uint32  InLevel,
TArray< FAllocatedInfo > &  OutInfos,
TArray< uint32 > &  OutAllocationRequests 
)

Get internal allocated virtual textures that touch the texture UV region.

◆ GetPackedAllocationRequest()

uint32 FAdaptiveVirtualTexture::GetPackedAllocationRequest ( uint32  vAddress,
uint32  vLevelPlusOne,
uint32  Frame 
) const

Get a packed allocation key based on a virtual texture feedback request. The virtual texture system collects these opaque keys before queuing them for processing.

◆ GetProducers()

void FAdaptiveVirtualTexture::GetProducers ( FIntRect const &  InTextureRegion,
uint32  InMaxLevel,
TArray< FProducerInfo > &  OutProducerInfos 
) const

Get internal producers that touch the texture texel region.

◆ GetSpaceID()

int32 FAdaptiveVirtualTexture::GetSpaceID ( ) const
overridevirtual

◆ Init()

void FAdaptiveVirtualTexture::Init ( FRHICommandListBase RHICmdList,
FVirtualTextureSystem InSystem 
)

Initialize the object. This creates the persistent low mips allocated VT.

◆ QueuePackedAllocationRequests() [1/2]

void FAdaptiveVirtualTexture::QueuePackedAllocationRequests ( FVirtualTextureSystem InSystem,
TConstArrayView< uint32 InRequests,
uint32  InFrame 
)
static

Queue a batch of allocation requests. This static function relays the global requests to the individual object queues. Internally it sorts the requests.

◆ QueuePackedAllocationRequests() [2/2]

void FAdaptiveVirtualTexture::QueuePackedAllocationRequests ( TConstArrayView< uint32 InRequests,
uint32  InFrame 
)

Queue a batch of allocation requests. These will be used to reallocate any virtual textures during the next call to UpdateAllocations().

◆ UpdateAllocations()

void FAdaptiveVirtualTexture::UpdateAllocations ( FVirtualTextureSystem InSystem,
FRHICommandListImmediate RHICmdList,
uint32  InFrame 
)

Update any allocations based on recent requests.


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