Rendu
A lightweight rendering engine for experimentations
Loading...
Searching...
No Matches
Classes | Public Member Functions | Public Attributes | List of all members
GPUShaders::Common::Atmosphere Class Reference

Atmosphere general shader. More...

Classes

struct  AtmosphereParameters
 

Public Member Functions

float rayleighPhase (float cosAngle)
 
float miePhase (float cosAngle, float gMie)
 
vec3 computeAtmosphereRadiance (vec3 rayOrigin, vec3 rayDir, vec3 sunDir, texture2D scatterTable, AtmosphereParameters params)
 

Public Attributes

AtmosphereParameters defaultAtmosphere = AtmosphereParameters(vec3(1.474, 1.8504, 1.91198), vec3(5.5e-6, 13.0e-6, 22.4e-6), 6371e3, 6471e3, 20.0, 21e-6, 8000.0, 1200.0, 0.758, 0.04675, 0.998)
 

Detailed Description

Atmosphere general shader.

See also
GPUShaders::Common::Constants, GPUShaders::Common::Geometry, GPUShaders::Common::Samplers

Member Function Documentation

◆ computeAtmosphereRadiance()

vec3 GPUShaders::Common::Atmosphere::computeAtmosphereRadiance ( vec3  rayOrigin,
vec3  rayDir,
vec3  sunDir,
texture2D  scatterTable,
AtmosphereParameters  params 
)
inline

Compute the radiance for a given ray, based on the atmosphere scattering model.

Parameters
rayOriginthe ray origin in ground space
rayDirthe ray direction
sunDirthe light direction
scatterTablethe precomputed secondary scattering lookup table
paramsatmosphere physics parameters
Returns
the estimated radiance

◆ miePhase()

float GPUShaders::Common::Atmosphere::miePhase ( float  cosAngle,
float  gMie 
)
inline

Compute the Mie phase.

Parameters
cosAngleCosine of the angle between the ray and the light directions
gMiethe Mie atmosphere parameter
Returns
the phase

◆ rayleighPhase()

float GPUShaders::Common::Atmosphere::rayleighPhase ( float  cosAngle)
inline

Compute the Rayleigh phase.

Parameters
cosAngleCosine of the angle between the ray and the light directions
Returns
the phase

Member Data Documentation

◆ defaultAtmosphere

AtmosphereParameters GPUShaders::Common::Atmosphere::defaultAtmosphere = AtmosphereParameters(vec3(1.474, 1.8504, 1.91198), vec3(5.5e-6, 13.0e-6, 22.4e-6), 6371e3, 6471e3, 20.0, 21e-6, 8000.0, 1200.0, 0.758, 0.04675, 0.998)

Default atmosphere parameters.


The documentation for this class was generated from the following file: