2013-12-08 19:54:34 +00:00
|
|
|
#ifndef WATERRENDERER_H
|
|
|
|
#define WATERRENDERER_H
|
|
|
|
|
|
|
|
#include "software_global.h"
|
|
|
|
|
2013-12-17 22:45:09 +00:00
|
|
|
#include "LightFilter.h"
|
|
|
|
|
2013-12-08 19:54:34 +00:00
|
|
|
#include "TerrainDefinition.h"
|
|
|
|
#include "Vector3.h"
|
|
|
|
#include "Color.h"
|
|
|
|
|
|
|
|
namespace paysages {
|
|
|
|
namespace software {
|
|
|
|
|
2013-12-17 22:45:09 +00:00
|
|
|
class SOFTWARESHARED_EXPORT WaterRenderer:public LightFilter
|
2013-12-08 19:54:34 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
Vector3 location;
|
|
|
|
Color base;
|
|
|
|
Color reflected;
|
|
|
|
Color refracted;
|
|
|
|
Color foam;
|
|
|
|
Color final;
|
|
|
|
} WaterResult;
|
|
|
|
|
|
|
|
public:
|
|
|
|
WaterRenderer(SoftwareRenderer* parent);
|
|
|
|
virtual ~WaterRenderer();
|
|
|
|
|
2013-12-17 22:45:09 +00:00
|
|
|
virtual void update();
|
|
|
|
|
2013-12-08 19:54:34 +00:00
|
|
|
virtual HeightInfo getHeightInfo();
|
|
|
|
virtual double getHeight(double x, double z);
|
|
|
|
virtual WaterResult getResult(double x, double z);
|
2013-12-17 22:45:09 +00:00
|
|
|
virtual bool applyLightFilter(LightComponent &light, const Vector3 &at) override;
|
2013-12-08 19:54:34 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
SoftwareRenderer* parent;
|
2014-01-21 20:51:11 +00:00
|
|
|
FractalNoise* noise;
|
2013-12-08 19:54:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // WATERRENDERER_H
|