class render::IBLUtility

Inherits: Module<IBLUtility>

Helper class that handles generation and processing of textures used for image based lighting.

Public

Methods

FilterCubemapForSpecular

virtual void FilterCubemapForSpecular(GpuCommandBuffer &commandBuffer, const SPtr<Texture> &cubemap, const SPtr<Texture> &scratch) const = 0

Performs filtering on the cubemap, populating its mip-maps with filtered values that can be used for evaluating specular reflections.

commandBuffer
Command buffer to execute on.
cubemap
Cubemap to filter. Its mip level 0 will be read, filtered and written into other mip levels.
scratch
Temporary cubemap texture to use for the filtering process. Must match the size of the source cubemap. Provide null to automatically create a scratch cubemap.

FilterCubemapForIrradiance

virtual void FilterCubemapForIrradiance(GpuCommandBuffer &commandBuffer, const SPtr<Texture> &cubemap, const SPtr<Texture> &output) const = 0

Performs filtering on the cubemap, populating the output cubemap with values that can be used for evaluating irradiance for use in diffuse lighting.

Uses order-5 SH (25 coefficients) and outputs the values in the form of a cubemap.

commandBuffer
Command buffer to execute on.
cubemap
Cubemap to filter. Its mip level 0 will be used as source.
output
Output cubemap to store the irradiance data in.

FilterCubemapForIrradiance

virtual void FilterCubemapForIrradiance(GpuCommandBuffer &commandBuffer, const SPtr<Texture> &cubemap, const SPtr<Texture> &output, u32 outputIdx) const = 0

Performs filtering on the cubemap, populating the output texture with values that can be used for evaluating irradiance for use in diffuse lighting.

Uses order-3 SH (9 coefficients) and outputs the values in the form of SH coefficients.

commandBuffer
Command buffer to execute on.
cubemap
Cubemap to filter. Its mip level 0 will be used as source.
output
Output texture in which to place the results. Must be allocated using IrradianceReduceMat::createOutputTexture();
outputIdx
Index in the output buffer at which to write the output coefficients to.

ScaleCubemap

virtual void ScaleCubemap(GpuCommandBuffer &commandBuffer, const SPtr<Texture> &src, u32 srcMip, const SPtr<Texture> &dst, u32 dstMip) const = 0

Scales a cubemap and outputs it in the destination texture, using hardware acceleration.

If both textures are the same size, performs a copy instead.

commandBuffer
Command buffer to execute on.
src
Source cubemap to scale.
srcMip
Determines which mip level of the source texture to scale.
dst
Desination texture to output the scaled data to. Must be usable as a render target.
dstMip
Determines which mip level of the destination texture to scale.

staticGetShCoeffTextureSize

static Vector2I GetShCoeffTextureSize(u32 numCoeffSets, u32 shOrder)

Returns the size of the texture required to store the provided number of SH coefficient sets.

staticGetShCoeffXyFromIdx

static Vector2I GetShCoeffXyFromIdx(u32 idx, u32 shOrder)

Determines the position of a set of coefficients in the coefficient texture, depending on the coefficient index.

staticInstance

static T &Instance()

Returns a reference to the module instance.

Module has to have been started up first otherwise an exception will be thrown.

staticInstancePtr

static T *InstancePtr()

Returns a pointer to the module instance.

Module has to have been started up first otherwise an exception will be thrown.

staticShutDown

static void ShutDown()

Shuts down this module and frees any resources it is using.

staticIsStarted

static bool IsStarted()

Query if the module has been started.

Protected

Methods

~Module<T>

virtual ~Module<T>() = default

OnStartUp

virtual void OnStartUp()

Override if you want your module to be notified once it has been constructed and started.

OnShutDown

virtual void OnShutDown()

Override if you want your module to be notified just before it is deleted.

staticInstanceInternal

static T *&InstanceInternal()

Returns a singleton instance of this module.

staticIsDestroyed

static bool &IsDestroyed()

Checks has the Module been shut down.

staticIsStartedUp

static bool &IsStartedUp()

Checks has the Module been started up.