Base GPU Sky Generator

class BaseGpuSkyGenerator

Public Functions

BaseGpuSkyGenerator()
virtual ~BaseGpuSkyGenerator()
void Reset()
inline bool GetEnabled() const

Whether this GPU sky generator should be used to calculate the sky.”)

inline void SetEnabled(bool v)
virtual void RestoreDeviceObjects(crossplatform::RenderPlatform*)

Platform-dependent function called when initializing the Sky Generator.

virtual void InvalidateDeviceObjects()

Platform-dependent function called when uninitializing the Sky Generator.

virtual void RecompileShaders()

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

inline virtual void SetDirectTargets(crossplatform::Texture **loss, crossplatform::Texture **insc, crossplatform::Texture **skyl, crossplatform::StructuredBuffer<vec4, crossplatform::BufferUsageHint::ONCE> **brt, crossplatform::Texture *light_t)
inline virtual bool CanPerformGPUGeneration() const

Return true if the derived class can make sky tables using the GPU.

float GetBrightness(int cycled_index) const
virtual void MakeLossAndInscatterTextures(crossplatform::DeviceContext &deviceContext, float4 wavelengthsNm, int cycled_index, simul::sky::AtmosphericScatteringInterface *skyInterface, const GpuSkyParameters &gpuSkyParameters, const GpuSkyAtmosphereParameters &gpuSkyAtmosphereParameters, const GpuSkyInfraredParameters &gpuSkyInfraredParameters)
void MakeLossAndInscatterTextures(crossplatform::DeviceContext &deviceContext, sky::float4 wavelengthsNm, simul::sky::AtmosphericScatteringInterface *skyInterface, const sky::GpuSkyParameters &p, const sky::GpuSkyAtmosphereParameters &a, const sky::GpuSkyInfraredParameters &ir, int &texIndex, crossplatform::Texture *loss, crossplatform::Texture *insc, crossplatform::Texture *skyl, crossplatform::StructuredBuffer<vec4, crossplatform::BufferUsageHint::ONCE> *skyBrightness, int cycled_index)
inline crossplatform::Texture *GetOpticalDepthTexture()
inline crossplatform::Texture *GetDensityTexture()
struct GpuTexGenStats

Subclassed by simul::sky::GpuSkyParameters

Public Members

int numElevations
int numDistances
int numAltitudes
float min_alt_km
float max_alt_km
float max_distance_km
int fill_up_to_texels
unsigned keyframe_checksum
struct GpuMoon

Public Members

vec3 dir
float radius_radians
vec3 irradiance_factor
struct GpuPhysicalSkyParameters

Public Members

simul::sky::float4 sun_irradiance
simul::sky::float4 starlight
vec3 dir_to_sun
GpuMoon moons[10]
int num_moons
simul::sky::HazeStruct hazeStruct
simul::sky::float4 ozone
float sun_start_alt_km
float sun_radius_radians
struct GpuColourTextureSpec

Public Members

vec3 horizon
vec3 zenith
float interp
struct GpuSkyParameters : public simul::sky::GpuTexGenStats

Public Members

float blendToColours
float brightnessPower
GpuPhysicalSkyParameters physical
GpuColourTextureSpec colour
struct GpuSkyAtmosphereParameters

Public Members

const simul::sky::float4 *density_table
const simul::sky::float4 *optical_table
const simul::sky::float4 *blackbody_table
int table_size
float maxDensityAltKm
unsigned tables_checksum
float planet_radius_km
struct GpuSkyInfraredParameters

Public Members

float emissivity
float seaLevelTemperatureK