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)
Type | Name | Description |
---|---|---|
uint32_t | order | Maximum filter order (2, 3, 5). |
uint32_t | size | Maximum filter size. |
uint32_t | groups | Reduction 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
Type | Name | Description |
---|---|---|
Buffer | buffer | Destination coefficients buffer. |
uint32_t | offset | Destination buffer offset. |
Texture | texture | Source cube texture. |
Slice | slice | Source 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
Type | Name | Description |
---|---|---|
Texture | texture | Destination cube texture (RGBAf16). |
Slice | slice | Destination texture slice. |
Buffer | buffer | Source coefficients buffer. |
uint32_t | offset | Source buffer offset. |
Enums
Mode
Filter modes.
Name | Value |
---|---|
ModeCube | 0 |
ModePanorama | 1 |
NumModes | 2 |
Flags
Filter flags.
Name | Value |
---|---|
FlagCube | (1 << ModeCube) |
FlagPanorama | (1 << ModePanorama) |
FlagsAll | (FlagCube | FlagPanorama) |