5 #include "programdata.h"
6 #include "rendertarget.h"
11 class DirectionalLight;
16 Renders a procedurally generated sky at the background. Based on the paper
17 "A Scalable and Production Ready Sky and Atmosphere Rendering Technique" by
18 Sébastien Hillaire (https://sebh.github.io/publications/egsr2020.pdf).
20 class Sky: public Effect
25 Color rayleigh_scatter;
29 float rayleigh_density_decay;
30 float mie_density_decay;
31 float ozone_band_center;
32 float ozone_band_extent;
33 float atmosphere_thickness;
39 static Planet earth();
44 DirectionalLight &sun;
45 RenderTarget transmittance_lookup;
46 const Program &transmittance_shprog;
47 bool transmittance_lookup_dirty;
49 const Program &distant_shprog;
50 const Mesh &fullscreen_mesh;
51 const Program &backdrop_shprog;
52 const Sampler &sampler;
53 const Sampler &wrap_sampler;
54 mutable ProgramData shdata;
59 Sky(Renderable &, DirectionalLight &);
61 void set_planet(const Planet &);
62 void set_view_height(float);
64 Color get_transmittance(const Vector3 &);
66 virtual void setup_frame(Renderer &);
67 virtual void finish_frame();
68 virtual void render(Renderer &, Tag = Tag()) const;
70 virtual void set_debug_name(const std::string &);