Skip to main content

CubeFilter

The CubeFilter class provides GPU-based filtering operations for cube and panorama textures, enabling the generation and reconstruction of spherical harmonics. Filters can be created with specific parameters and dispatched using compute shaders, either to generate coefficient buffers from cube textures or to reconstruct filtered textures from coefficients.

#include <graphics/TellusimCubeFilter.h>

Constructors

CubeFilter()

Methods

Clear filter.

void clear()

Check filter.

bool isCreated(Mode mode) const

Filter parameters.

uint32_t getGroupSize() const
uint32_t getMaxOrder() const
uint32_t getMaxSize() const
uint32_t getHarmonics() const

Create filter.

bool create(const Device &device, Mode mode, uint32_t order = 3, uint32_t size = 1024, uint32_t groups = 256)
bool create(const Device &device, Flags flags, uint32_t order = 3, uint32_t size = 1024, uint32_t groups = 256)
TypeNameDescription
uint32_torderMaximum filter order (2, 3, 5).
uint32_tsizeMaximum filter size.
uint32_tgroupsReduction group size.

Dispatch cube filter.

bool dispatch(Compute &compute, Buffer &buffer, uint32_t offset, Texture &texture, Slice slice) const
bool dispatch(Compute &compute, Buffer &buffer, uint32_t offset, Texture &texture) const
TypeNameDescription
BufferbufferDestination coefficients buffer.
uint32_toffsetDestination buffer offset.
TexturetextureSource cube texture.
SlicesliceSource texture slice.

Dispatch cube render.

bool dispatch(Compute &compute, Texture &texture, Slice slice, Buffer &buffer, uint32_t offset) const
bool dispatch(Compute &compute, Texture &texture, Buffer &buffer, uint32_t offset) const
TypeNameDescription
TexturetextureDestination cube texture (RGBAf16).
SlicesliceDestination texture slice.
BufferbufferSource coefficients buffer.
uint32_toffsetSource buffer offset.

Enums

Mode

Filter modes.

NameValue
ModeCube0
ModePanorama1
NumModes2

Flags

Filter flags.

NameValue
FlagCube(1 << ModeCube)
FlagPanorama(1 << ModePanorama)
FlagsAll(FlagCube | FlagPanorama)