2013-11-12 20:34:35 +00:00
|
|
|
#ifndef ATMOSPHERERENDERER_H
|
|
|
|
#define ATMOSPHERERENDERER_H
|
|
|
|
|
|
|
|
#include "software_global.h"
|
|
|
|
|
2015-09-24 22:12:31 +00:00
|
|
|
#include "LightSource.h"
|
2013-12-08 19:54:34 +00:00
|
|
|
|
2013-11-12 20:34:35 +00:00
|
|
|
namespace paysages {
|
|
|
|
namespace software {
|
|
|
|
|
2015-11-09 21:30:46 +00:00
|
|
|
class BaseAtmosphereRenderer : public LightSource {
|
|
|
|
public:
|
|
|
|
BaseAtmosphereRenderer(SoftwareRenderer *parent);
|
|
|
|
virtual ~BaseAtmosphereRenderer() {
|
|
|
|
}
|
2013-11-12 20:34:35 +00:00
|
|
|
|
2015-11-08 22:32:52 +00:00
|
|
|
virtual AtmosphereResult applyAerialPerspective(const Vector3 &location, const Color &base);
|
|
|
|
virtual AtmosphereResult getSkyColor(const Vector3 &direction);
|
2015-11-09 21:30:46 +00:00
|
|
|
virtual Vector3 getSunDirection(bool cache = true) const;
|
2013-11-12 20:34:35 +00:00
|
|
|
|
2015-09-24 22:12:31 +00:00
|
|
|
virtual bool getLightsAt(std::vector<LightComponent> &result, const Vector3 &location) const override;
|
2013-12-15 13:28:46 +00:00
|
|
|
|
2015-11-09 21:30:46 +00:00
|
|
|
protected:
|
|
|
|
virtual AtmosphereDefinition *getDefinition() const;
|
|
|
|
SoftwareRenderer *parent;
|
2013-11-12 20:34:35 +00:00
|
|
|
};
|
|
|
|
|
2015-11-09 21:30:46 +00:00
|
|
|
class SoftwareBrunetonAtmosphereRenderer : public BaseAtmosphereRenderer {
|
|
|
|
public:
|
|
|
|
SoftwareBrunetonAtmosphereRenderer(SoftwareRenderer *parent);
|
2013-12-08 19:54:34 +00:00
|
|
|
virtual ~SoftwareBrunetonAtmosphereRenderer();
|
2013-11-12 20:34:35 +00:00
|
|
|
|
2015-11-08 22:32:52 +00:00
|
|
|
virtual AtmosphereResult applyAerialPerspective(const Vector3 &location, const Color &base) override;
|
|
|
|
virtual AtmosphereResult getSkyColor(const Vector3 &direction) override;
|
2013-12-08 19:54:34 +00:00
|
|
|
|
2015-09-24 22:12:31 +00:00
|
|
|
virtual bool getLightsAt(std::vector<LightComponent> &result, const Vector3 &location) const override;
|
|
|
|
|
2015-11-09 21:30:46 +00:00
|
|
|
inline const AtmosphereModelBruneton *getModel() const {
|
|
|
|
return model;
|
|
|
|
}
|
2013-12-21 22:48:54 +00:00
|
|
|
|
2015-11-09 21:30:46 +00:00
|
|
|
private:
|
|
|
|
AtmosphereModelBruneton *model;
|
2013-11-12 20:34:35 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // ATMOSPHERERENDERER_H
|