FlatBackgroundGUI

FlatBackgroundGUI provides a background that is loaded from a PNG or JPEG image. The string for backgroundPath should be in "stringImportPaths" specified in dub.json

Destructor

A destructor is present on this object, but not explicitly documented in the source.

Members

Functions

onDraw
void onDraw(ImageRef!RGBA diffuseMap, ImageRef!L16 depthMap, ImageRef!RGBA materialMap, box2i[] dirtyRects)

Fill diffuse map with diffuse from background image. Alpha is ignored since ideally a background image will not need an alpha channel. Material and depth maps are zeroed out to initialize them. Otherwise this can lead to nasty errors.

Inherited Members

From GUIGraphics

WindowListener
class WindowListener
setUpdateMargin
void setUpdateMargin(int margin)

Tune this to tune the trade-off between light quality and speed. The default value was tuned by hand on very shiny light sources. Too high and processing becomes very expensive. Too little and the ligth decay doesn't feel natural.

_updateMargin
int _updateMargin;

Amount of pixels dirty rectangles are extended with.

renderElements
void renderElements()

Redraw UIElements

compositeGUI
void compositeGUI(ImageRef!RGBA wfb, WindowPixelFormat pf)

Compose lighting effects from depth and diffuse into a result. takes output image and non-overlapping areas as input Useful multithreading code.

regenerateMipmaps
void regenerateMipmaps()

Compose lighting effects from depth and diffuse into a result. takes output image and non-overlapping areas as input Useful multithreading code.

Meta