2013-11-09 17:46:34 +00:00
|
|
|
#ifndef SOFTWARERENDERER_H
|
|
|
|
#define SOFTWARERENDERER_H
|
|
|
|
|
|
|
|
#include "software_global.h"
|
|
|
|
|
|
|
|
#include "renderer.h"
|
|
|
|
|
|
|
|
namespace paysages {
|
|
|
|
namespace software {
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief This class renders a defined scenery in sotware mode (using only standard CPU computations).
|
|
|
|
*/
|
|
|
|
class SOFTWARESHARED_EXPORT SoftwareRenderer: public Renderer
|
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
2013-11-10 16:04:38 +00:00
|
|
|
SoftwareRenderer(Scenery* scenery=0);
|
2013-11-09 17:46:34 +00:00
|
|
|
virtual ~SoftwareRenderer();
|
|
|
|
|
2013-11-17 21:36:18 +00:00
|
|
|
/*!
|
|
|
|
* \brief Set the scenery to render.
|
|
|
|
*
|
|
|
|
* Don't call this after rendering has already started.
|
|
|
|
*/
|
|
|
|
virtual void setScenery(Scenery* scenery) override;
|
|
|
|
|
2013-11-12 20:34:35 +00:00
|
|
|
/*!
|
|
|
|
* \brief Prepare the renderer sub-systems.
|
|
|
|
*
|
|
|
|
* This will clear the caches and connect elements together.
|
|
|
|
* After this call, don't update the scenery when renderer is in use.
|
|
|
|
*/
|
2013-11-17 21:36:18 +00:00
|
|
|
virtual void prepare() override;
|
2013-11-11 14:42:11 +00:00
|
|
|
|
2013-12-01 18:24:53 +00:00
|
|
|
/*!
|
|
|
|
* \brief Start the rasterization process.
|
|
|
|
*/
|
|
|
|
virtual void rasterize() override;
|
|
|
|
|
2013-11-09 17:46:34 +00:00
|
|
|
inline Scenery* getScenery() const {return scenery;}
|
2013-12-01 18:24:53 +00:00
|
|
|
|
2013-11-12 20:34:35 +00:00
|
|
|
inline BaseAtmosphereRenderer* getAtmosphereRenderer() const {return atmosphere_renderer;}
|
2013-12-01 18:24:53 +00:00
|
|
|
inline CloudsRenderer* getCloudsRenderer() const {return clouds_renderer;}
|
|
|
|
|
2013-11-11 14:42:11 +00:00
|
|
|
inline FluidMediumManager* getFluidMediumManager() const {return fluid_medium;}
|
2013-11-09 17:46:34 +00:00
|
|
|
|
2013-12-01 18:24:53 +00:00
|
|
|
virtual Color applyMediumTraversal(Vector3 location, Color color) override;
|
2013-11-10 16:04:38 +00:00
|
|
|
|
2013-11-09 17:46:34 +00:00
|
|
|
private:
|
|
|
|
Scenery* scenery;
|
2013-11-13 22:36:52 +00:00
|
|
|
bool own_scenery;
|
2013-11-11 14:42:11 +00:00
|
|
|
FluidMediumManager* fluid_medium;
|
2013-11-12 20:34:35 +00:00
|
|
|
BaseAtmosphereRenderer* atmosphere_renderer;
|
2013-12-01 18:24:53 +00:00
|
|
|
CloudsRenderer* clouds_renderer;
|
2013-11-09 17:46:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // SOFTWARERENDERER_H
|