paysages3d/src/render/software/CloudsRenderer.h

74 lines
1.9 KiB
C
Raw Normal View History

#ifndef CLOUDSRENDERER_H
#define CLOUDSRENDERER_H
#include "software_global.h"
2013-12-17 22:45:09 +00:00
#include "LightFilter.h"
namespace paysages {
namespace software {
/*!
* \brief Software renderer of a group of cloud layers.
*/
2013-12-17 22:45:09 +00:00
class SOFTWARESHARED_EXPORT CloudsRenderer: public LightFilter
{
public:
CloudsRenderer(SoftwareRenderer* parent);
virtual ~CloudsRenderer();
/*!
2013-12-04 21:52:18 +00:00
* \brief Update the renderer with the bound scenery.
*
* Don't call this if another thread is currently using this renderer.
*/
2013-12-17 22:45:09 +00:00
virtual void update();
/*!
2013-12-04 21:52:18 +00:00
* \brief Get the layer renderer for a given layer.
*
* The returned renderer is managed by this object and should not be deleted.
*/
virtual BaseCloudLayerRenderer* getLayerRenderer(unsigned int layer);
/*!
2013-12-04 21:52:18 +00:00
* \brief Get the cloud model for a given layer.
*
* The returned model is managed by this object and should not be deleted.
*/
virtual BaseCloudsModel* getLayerModel(unsigned int layer);
2013-12-20 16:30:27 +00:00
/*!
* \brief Override de default density model for a given layer.
*
* This must be called after each update().
* Ownership of the model is taken.
*/
virtual void setLayerModel(unsigned int layer, BaseCloudsModel* model, bool delete_old=true);
2013-12-04 21:52:18 +00:00
/*!
* \brief Get the composited color, as applied on a base color and location.
*/
virtual Color getColor(const Vector3 &eye, const Vector3 &location, const Color &base);
/*!
2013-12-04 21:52:18 +00:00
* \brief Alter a light, as if passed through all layers.
*
* Return true if the light was altered.
*/
2013-12-17 22:45:09 +00:00
virtual bool applyLightFilter(LightComponent &light, const Vector3 &at) override;
private:
SoftwareRenderer* parent;
2013-12-04 21:52:18 +00:00
std::vector<BaseCloudLayerRenderer*> layer_renderers;
BaseCloudLayerRenderer* fake_renderer;
2013-12-04 21:52:18 +00:00
std::vector<BaseCloudsModel*> layer_models;
BaseCloudsModel* fake_model;
};
}
}
#endif // CLOUDSRENDERER_H