Weather Renderer

class WeatherRenderer

The main base class for all weather renderers, such as SimulGLWeatherRenderer, SimulWeatherRenderer (DX11) etc.

The derived classes of WeatherRenderer create and maintain the renderers for weather elements such as clouds, sky, rain and so on. So to use these sub-renderers it is usual to create an instance of one of the weather renderers, and allow this instance to manage the others.

Public Functions

virtual void RestoreDeviceObjects(platform::crossplatform::RenderPlatform *renderPlatform)

Platform-dependent function called when initializing the weather renderer.

virtual void InvalidateDeviceObjects()

Platform-dependent function called when uninitializing the weather renderer.

void RecompileShaders()

Recompile the shaders asynchronously.

virtual void Render(platform::crossplatform::GraphicsDeviceContext &deviceContext, const platform::crossplatform::ViewStruct &viewStruct2, TrueSkyRenderMode renderMode, float exposure, float gamma, platform::crossplatform::Texture *mainDepthTexture, platform::crossplatform::Texture *cubemapTexture, const platform::crossplatform::Viewport *depthViewport, const platform::crossplatform::Viewport *viewports = nullptr, vec3 cubemap_ground_colour = vec3(0, 0, 0), int amortization = 0)

Render the sky including atmospherics, into the current rendertarget, using a supplied depth texture.

deviceContext is the platform-dependent render context, viewStruct2 is the view structure for alternate eye in VR, exposure is a multiplier for the rendered sky brightness, The view_id is an integer that distinguishes between multiple simultaneous viewports onscreen. By convention, viewport 0 is the main view, and viewport 1 is the cubemap for reflections and lighting. If is_cubemap is set, low-definition rendering is used. The mainDepthTexture is a single-sampled or MSAA depth texture. You can use a platform::crossplatform::Texture-derived class to wrapper your depth texture. The depthViewport determines what part of the depth texture represents this viewport - normally (0,0,1,1). Optional viewports specifies the left and right eye viewports if we’re rendering both at once in VR.

simul::clouds::CloudRenderer *GetCloudRenderer()

Get a pointer to the cloud renderer.

simul::sky::SkyKeyframer *GetSkyKeyframer()

Convenience function to get the next sky keyframe that can be modified without any recalculation.