True Sky Renderer

class TrueSkyRenderer : public crossplatform::BaseRenderer

Subclassed by simul::plugin::PluginTrueSkyRenderer

Public Functions

virtual void RestoreDeviceObjects(crossplatform::RenderPlatform *r)

Platform-dependent function called when initializing the renderer.

virtual void InvalidateDeviceObjects()

Platform-dependent function called when uninitializing the renderer.

virtual void RecompileShaders()

Platform-dependent function to reload the shaders - only use this for debug purposes.

void RenderOverlays(crossplatform::GraphicsDeviceContext &deviceContext, crossplatform::Texture *texture, float exposure, float gamma)

Render the active debug overlays.

bool CopySkylight(crossplatform::GraphicsDeviceContext &deviceContext, crossplatform::Texture *targetTexture, float *targetShValues, int shOrder, const mat4 *engineToSimulMatrix4x4, int updateFrequency, float blend, float exposure, float gamma, const vec3 &ground_colour, int amortization, bool allFaces, bool allMips)

Update the specified texture as a cubemap, and its spherical harmonics. Copy the specified skylight into the target texture. This texture MUST be the same size, format and mip count as was specified for this cubemap id when GetSkylight was called. This function has latency depending on the platform.

void EnsureSkylight(int cubemap_view_id, int size, int mips, crossplatform::PixelFormat format, const mat4 *cubeToSimulMatrix, int shOrder, int updateFrequency, float blend, float exposure, float gamma, const vec3 &ground_colour, int amortization, bool allFaces, bool allMips)

Create or update a skylight.

bool ProbeSkylight(crossplatform::DeviceContext &pContext, int cubemap_view_id, int mip_size, int face_index, uint2 pos, uint2 size, vec4 *targetValuesFloat4)

Get linear colours from the specified skylight. Returns true if successful.

void ReloadTextures()

Reload the textures.

void SetAmortization(int view_id, int a)

How often to update each cloud texel; 1:always, 2:every 4 frames, n:every n^2 frames.

int GetAmortization(int view_id) const

Get the amortization of the given frame.

inline terrain::BaseWaterRenderer *GetWaterRenderer()

Get a pointer to the water renderer.

inline class clouds::BaseWeatherRenderer *GetSimulWeatherRenderer()

Get a pointer to the weather renderer.

inline simul::scene::BaseSceneRenderer *GetSceneRenderer()

Get a pointer to the scene renderer.

inline terrain::BaseTerrainRenderer *GetTerrainRenderer()

Get a pointer to the terrain renderer.

inline crossplatform::HdrRenderer *GetSimulHDRRenderer()

Get a pointer to the HDR renderer.

void CleanupOldAllocations(int max_age = -1)

Delete GPU allocations to save memory. By default, max age is MaxViewAgeFrames. max_age=0 clears all views.

void SetSequence(const char *txt)

Load sequence data.

void SetInterpolationMode(int value = -1)

Set the interpolation mode for cloud updates.

Public Static Functions

static void EnsureEffectsAreBuilt(crossplatform::RenderPlatform *r)

Check that all shaders have been correctly compiled.