Rendu
A lightweight rendering engine for experimentations
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
AtmosphereApp Class Referencefinal

Demo application for the atmospheric scattering shader. Demonstrate real-time approximate atmospheric scattering simulation. Based on Precomputed Atmospheric Scattering, E. Bruneton, F. Neyret, EGSR 2008. More...

#include <AtmosphereApp.hpp>

Public Member Functions

 AtmosphereApp (RenderingConfig &config, Window &window)
 
void draw () override
 
void update () override
 
void resize () override
 
- Public Member Functions inherited from CameraApp
 CameraApp (RenderingConfig &config, Window &window)
 
virtual void update () override
 
virtual void physics (double fullTime, double frameTime)
 
- Public Member Functions inherited from Application
 Application (RenderingConfig &config, Window &window)
 
virtual void draw ()=0
 
virtual void update ()
 
virtual void finish ()
 
virtual void resize ()=0
 
double timeElapsed ()
 
double frameTime ()
 
double frameRate ()
 
Windowwindow ()
 
virtual ~Application ()
 
 Application (const Application &)=delete
 
Applicationoperator= (const Application &)=delete
 
 Application (Application &&)=delete
 
Applicationoperator= (Application &&)=delete
 

Static Public Member Functions

static void precomputeTable (const Sky::AtmosphereParameters &params, uint samples, Image &table)
 

Private Member Functions

void updateSky ()
 

Private Attributes

Texture _atmosphereBuffer
 Scene texture.
 
Program_atmosphere
 Atmospheric scattering shader.
 
Program_tonemap
 Tonemapping shader.
 
Texture _scattering
 Scattering lookup table.
 
Sky::AtmosphereParameters _atmoParams
 Atmosphere parameters.
 
int _tableRes = 256
 Scattering table resolution.
 
int _tableSamples = 64
 Scattering table sample count.
 
glm::vec3 _lightDirection
 Sun light direction.
 
float _lightElevation = 10.0f
 Sun vertical angular elevation.
 
float _lightAzimuth = 290.0f
 Sun horizontal orientation.
 
float _altitude = 1.0f
 View altitude above the planet surface.
 

Additional Inherited Members

- Protected Member Functions inherited from CameraApp
void freezeCamera (bool shouldFreeze)
 
- Protected Attributes inherited from CameraApp
ControllableCamera _userCamera
 The interactive camera.
 
- Protected Attributes inherited from Application
RenderingConfig_config
 The current configuration.
 
std::unique_ptr< DebugViewer_debug
 Debug viewer.
 

Detailed Description

Demo application for the atmospheric scattering shader. Demonstrate real-time approximate atmospheric scattering simulation. Based on Precomputed Atmospheric Scattering, E. Bruneton, F. Neyret, EGSR 2008.

Inherits CameraApp.

Constructor & Destructor Documentation

◆ AtmosphereApp()

AtmosphereApp::AtmosphereApp ( RenderingConfig config,
Window window 
)

Constructor

Parameters
configrendering config
windowthe window to render to

Member Function Documentation

◆ draw()

void AtmosphereApp::draw ( )
overridevirtual

Draw call.

Implements Application.

◆ precomputeTable()

void AtmosphereApp::precomputeTable ( const Sky::AtmosphereParameters params,
uint  samples,
Image table 
)
static

Compute a scattering lookup table for real-time atmosphere rendering.

Parameters
paramsthe atmosphere parameters
samplesnumber of samples along a ray
tablethe image to fill.

◆ resize()

void AtmosphereApp::resize ( )
overridevirtual

Handle a window resize event, the configuration has been updated with the new size.

Implements Application.

◆ update()

void AtmosphereApp::update ( )
overridevirtual

Per-frame update.

Reimplemented from CameraApp.

◆ updateSky()

void AtmosphereApp::updateSky ( )
private

Update the lookup table based on internal atmosphere parameters.


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