2013-08-16 11:01:52 +00:00
|
|
|
#ifndef COMPONENTS_TERRAIN_MATERIAL_H
|
|
|
|
#define COMPONENTS_TERRAIN_MATERIAL_H
|
|
|
|
|
2017-03-03 17:26:40 +00:00
|
|
|
#include <osg/StateSet>
|
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
|
|
|
|
2016-02-19 00:30:15 +00:00
|
|
|
namespace Shader
|
|
|
|
{
|
|
|
|
class ShaderManager;
|
|
|
|
}
|
|
|
|
|
2013-08-16 11:01:52 +00:00
|
|
|
namespace Terrain
|
|
|
|
{
|
|
|
|
|
2016-02-19 00:30:15 +00:00
|
|
|
struct TextureLayer
|
|
|
|
{
|
|
|
|
osg::ref_ptr<osg::Texture2D> mDiffuseMap;
|
|
|
|
osg::ref_ptr<osg::Texture2D> mNormalMap; // optional
|
2016-03-22 20:00:31 +00:00
|
|
|
bool mParallax;
|
2016-02-20 18:54:47 +00:00
|
|
|
bool mSpecular;
|
2016-02-19 00:30:15 +00:00
|
|
|
};
|
|
|
|
|
2019-02-20 13:37:00 +00:00
|
|
|
std::vector<osg::ref_ptr<osg::StateSet> > createPasses(bool useShaders, Shader::ShaderManager* shaderManager,
|
2017-03-03 17:26:40 +00:00
|
|
|
const std::vector<TextureLayer>& layers,
|
2017-03-12 23:15:36 +00:00
|
|
|
const std::vector<osg::ref_ptr<osg::Texture2D> >& blendmaps, int blendmapScale, float layerTileSize);
|
2017-03-07 15:33:31 +00:00
|
|
|
|
2013-08-16 11:01:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|