class Skylight

A class to capture light from the sky in real time for diffuse and specular lighting.

Public Functions

void Render(crossplatform::GraphicsDeviceContext &parentDeviceContext, BaseWeatherRenderer *baseWeatherRenderer, int cube_id, crossplatform::BaseFramebuffer *fb, int faceIndex, const mat4 &engineToSimulMatrix4x4, float blend, float exposure = 1.0f, float gamma = 1.0f)

Fill in the texture.

void Update(crossplatform::GraphicsDeviceContext &deviceContext, BaseWeatherRenderer *weatherRenderer)

Update the skylight per-frame.

void RestoreDeviceObjects(crossplatform::RenderPlatform *r)

Initialize GPU objects.

void InvalidateDeviceObjects()

Free the GPU objects.

void RecompileShaders()

Recompile the shaders for this class.

void ShowDebug(crossplatform::GraphicsDeviceContext &deviceContext, int X, int Y, int w)

Show debug displays onscreen.

bool GetSphericalHarmonics(crossplatform::DeviceContext &deviceContext, float *targetShValues)
bool Probe(crossplatform::DeviceContext &deviceContext, int mip_size, int face_index, uint2 pos, uint2 size, vec4 *targetValuesFloat4)

Public Members

crossplatform::BaseFramebuffer *frameBuffer
int size
int mips
int view_id
crossplatform::PixelFormat format
int faceIndex
int actionIndex = 0
int currentMip
int bands
int last_update
int updateFrequency
bool initialized
bool fully_initialized
bool draw_clouds
float blend
float exposure
float gamma
vec3 ground_colour
mat4 engineToSimulMatrix4x4
int amortization
bool allFaces
bool allMips