2013-08-16 13:01:52 +02:00
|
|
|
#ifndef COMPONENTS_TERRAIN_MATERIAL_H
|
|
|
|
#define COMPONENTS_TERRAIN_MATERIAL_H
|
|
|
|
|
2017-03-03 18:26:40 +01:00
|
|
|
#include <osg/StateSet>
|
2013-08-16 13:01:52 +02:00
|
|
|
|
2015-06-03 01:18:36 +02:00
|
|
|
namespace osg
|
|
|
|
{
|
|
|
|
class Texture2D;
|
|
|
|
}
|
2013-12-04 21:43:10 +01:00
|
|
|
|
2022-05-13 18:58:00 -07:00
|
|
|
namespace Resource
|
2016-02-19 01:30:15 +01:00
|
|
|
{
|
2022-05-13 18:58:00 -07:00
|
|
|
class SceneManager;
|
2016-02-19 01:30:15 +01:00
|
|
|
}
|
|
|
|
|
2013-08-16 13:01:52 +02:00
|
|
|
namespace Terrain
|
|
|
|
{
|
|
|
|
|
2016-02-19 01:30:15 +01:00
|
|
|
struct TextureLayer
|
|
|
|
{
|
|
|
|
osg::ref_ptr<osg::Texture2D> mDiffuseMap;
|
|
|
|
osg::ref_ptr<osg::Texture2D> mNormalMap; // optional
|
2016-03-22 21:00:31 +01:00
|
|
|
bool mParallax;
|
2016-02-20 19:54:47 +01:00
|
|
|
bool mSpecular;
|
2016-02-19 01:30:15 +01:00
|
|
|
};
|
|
|
|
|
2022-05-13 18:58:00 -07:00
|
|
|
std::vector<osg::ref_ptr<osg::StateSet>> createPasses(bool useShaders, Resource::SceneManager* sceneManager,
|
2017-03-13 00:15:36 +01:00
|
|
|
const std::vector<TextureLayer>& layers, const std::vector<osg::ref_ptr<osg::Texture2D>>& blendmaps,
|
|
|
|
int blendmapScale, float layerTileSize);
|
2017-03-07 16:33:31 +01:00
|
|
|
|
2013-08-16 13:01:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|