Base Atmospherics Renderer

class simul::sky::BaseAtmosphericsRenderer

The graphics API-independent base class for atmospherics renderers, which draw distance fades, aerial perspective, fog and so on.

Public Functions

virtual META_BeginProperties Whether to use infrared rendering Scattering and distance grid size virtual META_RangeProperty(int, MaxAmortization, 4, 1, 8,"Maximum amortization of scattering volume generation.") META_EndProperties virtual void RestoreDeviceObjects(crossplatform void InvalidateDeviceObjects ()

Platform-dependent function called when initializing the atmospherics renderer.

Platform-dependent function called when uninitializing the atmospherics renderer.

void PreRenderUpdate(crossplatform::GraphicsDeviceContext&)

Once per-frame update. Do this before any rendering each frame.

void SetIlluminationTexture(crossplatform::Texture*)

Set the texture defining the extent of illuminated inscatter. R=near, G=far, B and A unused.

const ScatteringVolume *GetScatteringVolume(int view_id)

Get the per-frame 3D volume scattering texture for the given view id.

inline virtual void SetCloudShadowTexture(const CloudShadowStruct &c)

Set the 2D cloud shadow texture to be used for lighting.

virtual void RecompileShaders()

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

void SetCameraPosition(const float *pos)

Get the current location of the camera.

void SetSkyInterface(simul::sky::SkyKeyframer *si)

Set the sky and atmospherics interface to allow the renderer to use the correct lighting values.

inline void SetFogHeightKm(float h_km)

Set the height of the fog.

inline void SetFogDensity(float d)

Set the density of the fog.

Public Static Functions

static void EnsureEffectsAreBuilt(crossplatform::RenderPlatform *r)

Check that all shaders have been correctly compiled.

struct ScatteringVolume