Rendu
A lightweight rendering engine for experimentations
|
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 () |
Window & | window () |
virtual | ~Application () |
Application (const Application &)=delete | |
Application & | operator= (const Application &)=delete |
Application (Application &&)=delete | |
Application & | operator= (Application &&)=delete |
Static Public Member Functions | |
static void | precomputeTable (const Sky::AtmosphereParameters ¶ms, 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. | |
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.
AtmosphereApp::AtmosphereApp | ( | RenderingConfig & | config, |
Window & | window | ||
) |
Constructor
config | rendering config |
window | the window to render to |
|
overridevirtual |
Draw call.
Implements Application.
|
static |
Compute a scattering lookup table for real-time atmosphere rendering.
params | the atmosphere parameters |
samples | number of samples along a ray |
table | the image to fill. |
|
overridevirtual |
Handle a window resize event, the configuration has been updated with the new size.
Implements Application.
|
overridevirtual |
Per-frame update.
Reimplemented from CameraApp.
|
private |
Update the lookup table based on internal atmosphere parameters.