esp::gfx_batch::RendererConfiguration struct

Global renderer configuration.

Passed to Renderer::Renderer(const RendererConfiguration&) and RendererStandalone::RendererStandalone(const RendererConfiguration&, const RendererStandaloneConfiguration&).

Constructors, destructors, conversion operators

RendererConfiguration() explicit
~RendererConfiguration()

Public functions

auto setFlags(RendererFlags flags) -> RendererConfiguration&
Set renderer flags.
auto setTileSizeCount(const Magnum::Vector2i& tileSize, const Magnum::Vector2i& tileCount) -> RendererConfiguration&
Set tile size and count.
auto setMaxLightCount(Magnum::UnsignedInt count) -> RendererConfiguration&
Set max light count per draw.
auto setAmbientFactor(Magnum::Float factor) -> RendererConfiguration&
Set ambient factor.

Function documentation

RendererConfiguration& esp::gfx_batch::RendererConfiguration::setFlags(RendererFlags flags)

Set renderer flags.

By default no flags are set.

RendererConfiguration& esp::gfx_batch::RendererConfiguration::setTileSizeCount(const Magnum::Vector2i& tileSize, const Magnum::Vector2i& tileCount)

Set tile size and count.

By default there's a single {128, 128} tile, corresponding to a single rendered scene. Tiles are organized in the framebuffer in a grid and tileCount implies an upper bound on number of scenes rendered. To avoid hitting GPU limits with large tile counts and/or sizes, it's best to aim for the total framebuffer size given by tileSize*tileCount to be a power-of-two square. On the other hand, having tiles organized in a single column may make it easier for external libraries to consume the data tile-by-tile, as there's no row stride to account for.

Scenes that are empty are not rendered at all, so it's fine to have unused tiles, they only occupy space in the output framebuffer. For example, if you want 13 scenes, set tileCount to {4, 4} and ignore the last 3.

RendererConfiguration& esp::gfx_batch::RendererConfiguration::setMaxLightCount(Magnum::UnsignedInt count)

Set max light count per draw.

By default no lights are used, i.e. flat-shaded rendering. At the moment there's no light culling in place, which means that light count per draw is equivalent to the total light count used per scene.

RendererConfiguration& esp::gfx_batch::RendererConfiguration::setAmbientFactor(Magnum::Float factor)

Set ambient factor.

How much of the diffuse color / texture is used for ambient light in Phong-shaded materials. Default value is 0.1f, setting it to 0.0f will make the render completely black in areas without light contribution. In comparison, flat-shaded materials (i.e., imported with Magnum::Trade::MaterialType::Flat) have the ambient factor always 1.0 and are unaffected by lights.

This value can currently only set upfront due to how materials are implemented internally.