2013-08-16 13:01:52 +02:00
|
|
|
#ifndef COMPONENTS_TERRAIN_MATERIAL_H
|
|
|
|
#define COMPONENTS_TERRAIN_MATERIAL_H
|
|
|
|
|
2015-06-03 01:18:36 +02:00
|
|
|
#include <osgFX/Technique>
|
|
|
|
#include <osgFX/Effect>
|
2013-08-16 13:01:52 +02:00
|
|
|
|
2015-06-03 01:18:36 +02:00
|
|
|
#include "defs.hpp"
|
|
|
|
|
|
|
|
namespace osg
|
|
|
|
{
|
|
|
|
class Texture2D;
|
|
|
|
}
|
2013-12-04 21:43:10 +01:00
|
|
|
|
2013-08-16 13:01:52 +02:00
|
|
|
namespace Terrain
|
|
|
|
{
|
|
|
|
|
2015-06-03 01:18:36 +02:00
|
|
|
class FixedFunctionTechnique : public osgFX::Technique
|
2013-08-16 13:01:52 +02:00
|
|
|
{
|
|
|
|
public:
|
2015-06-03 01:18:36 +02:00
|
|
|
FixedFunctionTechnique(
|
|
|
|
const std::vector<osg::ref_ptr<osg::Texture2D> >& layers,
|
2015-11-06 20:14:57 +01:00
|
|
|
const std::vector<osg::ref_ptr<osg::Texture2D> >& blendmaps, int blendmapScale, float layerTileSize);
|
2013-08-16 13:01:52 +02:00
|
|
|
|
2015-06-03 01:18:36 +02:00
|
|
|
protected:
|
|
|
|
virtual void define_passes() {}
|
|
|
|
};
|
2013-08-20 09:52:27 +02:00
|
|
|
|
2015-06-03 01:18:36 +02:00
|
|
|
class Effect : public osgFX::Effect
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Effect(
|
|
|
|
const std::vector<osg::ref_ptr<osg::Texture2D> >& layers,
|
2015-11-06 20:14:57 +01:00
|
|
|
const std::vector<osg::ref_ptr<osg::Texture2D> >& blendmaps, int blendmapScale, float layerTileSize);
|
2013-08-16 13:01:52 +02:00
|
|
|
|
2015-06-03 01:18:36 +02:00
|
|
|
virtual bool define_techniques();
|
2013-08-16 13:01:52 +02:00
|
|
|
|
2015-06-03 01:18:36 +02:00
|
|
|
virtual const char *effectName() const
|
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
virtual const char *effectDescription() const
|
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
virtual const char *effectAuthor() const
|
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
2013-08-16 13:01:52 +02:00
|
|
|
|
|
|
|
private:
|
2015-06-03 01:18:36 +02:00
|
|
|
std::vector<osg::ref_ptr<osg::Texture2D> > mLayers;
|
|
|
|
std::vector<osg::ref_ptr<osg::Texture2D> > mBlendmaps;
|
2015-11-06 20:14:57 +01:00
|
|
|
int mBlendmapScale;
|
2015-11-06 15:23:37 +01:00
|
|
|
float mLayerTileSize;
|
2013-08-16 13:01:52 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|