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