Skip to content

Commit e52e7ee

Browse files
committed
add shader for terrain
1 parent 610e634 commit e52e7ee

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

src/OpenCOVER/plugins/general/GeoData/GeoDataLoader.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,7 @@ bool GeoDataLoader::init()
382382

383383
selectionName = new ui::Label(editGroup, "name");
384384
selectionName->setText("nothing is selected");
385+
shader = coVRShaderList::instance()->get("Brightness");
385386

386387
return true;
387388
}
@@ -420,6 +421,7 @@ void GeoDataLoader::setRegionEnabled(const std::string &region_name, bool enable
420421
terrainRoot->addChild(terrainNode);
421422
terrainNode->setName(region_name);
422423
terrainNode->setNodeMask(showTerrain ? 0xffffffff : 0x0);
424+
shader->apply(terrainNode);
423425
}
424426
}
425427

src/OpenCOVER/plugins/general/GeoData/GeoDataLoader.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#include <cover/ui/Label.h>
4040
#include <cover/ui/SelectionList.h>
4141
#include <optional>
42+
#include <cover/coVRShader.h>
4243

4344
#include <OpenVRUI/coCombinedButtonInteraction.h>
4445
#include <cover/coIntersection.h>
@@ -138,6 +139,7 @@ class GeoDataLoader : public opencover::coVRPlugin,
138139
static GeoDataLoader *s_instance;
139140
PJ_CONTEXT *ProjContext;
140141
PJ *ProjInstance;
142+
opencover::coVRShader *shader=nullptr;
141143

142144
std::map<std::string, osg::ref_ptr<osg::Node>> loadedTerrains;
143145
std::map<std::string, osg::ref_ptr<osg::Node>> loadedBuildings;

0 commit comments

Comments
 (0)