2013-12-08 19:54:34 +00:00
|
|
|
#ifndef TEXTURESRENDERER_H
|
|
|
|
#define TEXTURESRENDERER_H
|
|
|
|
|
|
|
|
#include "software_global.h"
|
|
|
|
|
|
|
|
#include "TerrainRenderer.h"
|
|
|
|
|
|
|
|
#define TEXTURES_MAX_LAYERS 50
|
|
|
|
|
|
|
|
namespace paysages {
|
|
|
|
namespace software {
|
|
|
|
|
|
|
|
class SOFTWARESHARED_EXPORT TexturesRenderer
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
TextureLayerDefinition* layer;
|
|
|
|
double presence;
|
|
|
|
Color color;
|
|
|
|
} TexturesLayerResult;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
Vector3 base_location;
|
|
|
|
Vector3 base_normal;
|
|
|
|
int layer_count;
|
|
|
|
TexturesLayerResult layers[TEXTURES_MAX_LAYERS];
|
|
|
|
Vector3 final_location;
|
|
|
|
Color final_color;
|
|
|
|
} TexturesResult;
|
|
|
|
|
|
|
|
public:
|
|
|
|
TexturesRenderer(SoftwareRenderer *parent);
|
|
|
|
virtual ~TexturesRenderer();
|
|
|
|
|
2013-12-17 22:45:09 +00:00
|
|
|
virtual void update();
|
|
|
|
|
2013-12-08 19:54:34 +00:00
|
|
|
virtual double getMaximalDisplacement(TexturesDefinition *textures);
|
|
|
|
virtual double getLayerBasePresence(TextureLayerDefinition *layer, const TerrainRenderer::TerrainResult &terrain);
|
|
|
|
virtual double getTriplanarNoise(NoiseGenerator *noise, const Vector3 &location, const Vector3 &normal);
|
|
|
|
|
|
|
|
virtual Vector3 displaceTerrain(const TerrainRenderer::TerrainResult &terrain);
|
|
|
|
virtual double getBasePresence(int layer, const TerrainRenderer::TerrainResult &terrain);
|
|
|
|
virtual TexturesResult applyToTerrain(double x, double z);
|
|
|
|
|
|
|
|
private:
|
|
|
|
SoftwareRenderer *parent;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // TEXTURESRENDERER_H
|