class Program;
/**
-Renders a procedurally generated sky at the background. Based on the paper
-"A Scalable and Production Ready Sky and Atmosphere Rendering Technique" by
-Sébastien Hillaire (https://sebh.github.io/publications/egsr2020.pdf).
+Renders a procedurally generated sky at the background.
+
+In addition to the background, the transmittance of the sun light is calculated
+to produce realistic lighting at dawn and dusk.
+
+Based on the techniques described in "A Scalable and Production Ready Sky and
+Atmosphere Rendering Technique" by Sébastien Hillaire
+(https://sebh.github.io/publications/egsr2020.pdf).
*/
class Sky: public Effect
{
static Planet earth();
};
+ struct Template: Effect::Template
+ {
+ class Loader: public DataFile::DerivedObjectLoader<Template, Effect::Template::Loader>
+ {
+ private:
+ static ActionMap shared_actions;
+
+ public:
+ Loader(Template &, Collection &);
+ private:
+ virtual void init_actions();
+ };
+
+ DirectionalLight *sun = 0;
+
+ virtual Sky *create(const std::map<std::string, Renderable *> &) const;
+ };
+
private:
Planet planet;
DirectionalLight &sun;
const Program &backdrop_shprog;
const Sampler &sampler;
const Sampler &wrap_sampler;
+ const Texture &dummy_texture;
mutable ProgramData shdata;
float view_height;
bool rendered;