You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Ex: position PF_A32B32G32R32F 1024x1024 (16MB) velocity PF_FloatRGBA 1024x1024 (8MB) Attribute1 PF_B8G8R8A8 1024x1024 (4MB) Attribute2 PF_B8G8R8A8 1024x1024 (4MB) Thoses textures are all double buffered and at full sizes, they represent 64 MB of render targets. When GFXCascadeGpuSpriteAllowDynAllocs is enabled, resizing happens when the TileAllocator of the FParticleSimulationResources run out of tiles. We then allocate new tiles and resize the gpu simulation resources render targets, each time by a factor 2 (X,Y). This introduce a TileZ index (TilePageIndex) which allow us to compute a tile page index at runtime and retrieve the resized tile coordinates. Resizing is limited by the maximum morton index possible (65535) and also the original resource sizes provided by the device profile (fx.GPUSimulationTextureSizeX,fx.GPUSimulationTextureSizeY). The resizing feature can be enable with fx.Cascade.GpuSpriteDynamicAllocations cvar, and the initial size is controlled by fx.GPUSimulationDynTextureSizeXY. Depending on the platform and map content, this can saves alot of memorey, ranging from 7MB to 56MB depending on the platforms. *Resizing feature currently dont support GPU sorting mode. Radix sort shader algo will need to support keys/values of different format than 32 bits to work with the dynamic resizing of the gpu sim resources. To work around this limitation, we currently, ignore gpu sorting mode on cascade emitters when resizing is enable. A Jira was created to track this issue, and potentially add support in the future. #reviewer [at]stu.meckenna, [at]rob.krajcarski #rb rob.krajcarski, Stu.McKenna [CL 30857374 by serge bernier in ue5-main branch]
22 lines
551 B
Plaintext
22 lines
551 B
Plaintext
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
/*=============================================================================
|
|
ParticleSimulationCommon.usf: Particle Simulation shared functions and defines.
|
|
=============================================================================*/
|
|
|
|
#pragma once
|
|
|
|
#include "MortonCode.ush"
|
|
|
|
float2 GetTilePageOffset(float ZTileIndex, float2 PageScale, bool bResize = true)
|
|
{
|
|
float2 UV = 0.0f;
|
|
|
|
if(bResize)
|
|
{
|
|
uint2 PageOffset = MortonDecode(ZTileIndex);
|
|
UV = PageOffset * PageScale;
|
|
}
|
|
|
|
return UV;
|
|
} |