Rendu
A lightweight rendering engine for experimentations
Loading...
Searching...
No Matches
AtmosphereApp.hpp
1#pragma once
2#include "Application.hpp"
3#include "scene/Sky.hpp"
4#include "resources/Texture.hpp"
5#include "system/Config.hpp"
6#include "Common.hpp"
7
12class AtmosphereApp final : public CameraApp {
13public:
14
20
22 void draw() override;
23
25 void update() override;
26
28 void resize() override;
29
36 static void precomputeTable(const Sky::AtmosphereParameters & params, uint samples, Image & table);
37
38private:
39
41 void updateSky();
42
47
48 // Atmosphere parameters.
50 int _tableRes = 256;
51 int _tableSamples = 64;
52
53 // Real-time parameters.
54 glm::vec3 _lightDirection;
55 float _lightElevation = 10.0f;
56 float _lightAzimuth = 290.0f;
57 float _altitude = 1.0f;
58};
Window & window()
Definition: Application.cpp:95
Demo application for the atmospheric scattering shader. Demonstrate real-time approximate atmospheric...
Definition: AtmosphereApp.hpp:12
Program * _tonemap
Tonemapping shader.
Definition: AtmosphereApp.hpp:45
float _lightElevation
Sun vertical angular elevation.
Definition: AtmosphereApp.hpp:55
Texture _atmosphereBuffer
Scene texture.
Definition: AtmosphereApp.hpp:43
Sky::AtmosphereParameters _atmoParams
Atmosphere parameters.
Definition: AtmosphereApp.hpp:49
Texture _scattering
Scattering lookup table.
Definition: AtmosphereApp.hpp:46
void draw() override
Definition: AtmosphereApp.cpp:31
float _altitude
View altitude above the planet surface.
Definition: AtmosphereApp.hpp:57
void resize() override
Definition: AtmosphereApp.cpp:141
void updateSky()
Definition: AtmosphereApp.cpp:194
void update() override
Definition: AtmosphereApp.cpp:78
int _tableSamples
Scattering table sample count.
Definition: AtmosphereApp.hpp:51
Program * _atmosphere
Atmospheric scattering shader.
Definition: AtmosphereApp.hpp:44
float _lightAzimuth
Sun horizontal orientation.
Definition: AtmosphereApp.hpp:56
static void precomputeTable(const Sky::AtmosphereParameters &params, uint samples, Image &table)
Definition: AtmosphereApp.cpp:145
glm::vec3 _lightDirection
Sun light direction.
Definition: AtmosphereApp.hpp:54
int _tableRes
Scattering table resolution.
Definition: AtmosphereApp.hpp:50
Application with an interactive camera.
Definition: Application.hpp:89
Represents an image composed of pixels with values in [0,1]. Provide image loading/saving utilities,...
Definition: Image.hpp:8
Represents a group of shaders used for rendering.
Definition: Program.hpp:31
Configuration containing parameters for windows and renderers.
Definition: Config.hpp:113
Represents a texture containing one or more images, stored on the CPU and/or GPU.
Definition: Texture.hpp:12
Represent an OS window and its associated rendering context.
Definition: Window.hpp:14
Atmosphere parameters. Default values correspond to Earth-like atmosphere.
Definition: Sky.hpp:53