Commit fcbb07d7 authored by Martin Schultz's avatar Martin Schultz

Merge branch 'master' into fixOpenVolumeMeshCorePicking

and adopted shader loading with generator
parents d67e9bab 09343ea1
......@@ -1111,6 +1111,12 @@ void VolumeMeshNodeT<VolumeMeshT>::getRenderObjects(IRenderer* _renderer, GLStat
template<class VolumeMeshT>
void VolumeMeshNodeT<VolumeMeshT>::pick(GLState& _state, PickTarget _target) {
bool drawModeOverride = false;
if(lastDrawMode_ == DrawModes::NONE) // no last drawmode so the picking renderer
{ // is probably calling this function for rendering
lastDrawMode_ = drawMode();
drawModeOverride = true;
}
if(_state.compatibilityProfile())
pickCompat(_state, _target);
......@@ -1205,9 +1211,10 @@ void VolumeMeshNodeT<VolumeMeshT>::pick(GLState& _state, PickTarget _target) {
}
_state.set_depthFunc(oldDepthFunc);
lastPickTarget_ = _target;
}
if(drawModeOverride)
lastDrawMode_ = DrawModes::NONE;
}
template<class VolumeMeshT>
......@@ -1248,12 +1255,20 @@ void VolumeMeshNodeT<VolumeMeshT>::pickVertices(GLState& _state) {
int pickVertexMethod_ = 0;
static GLSL::Program* pickVertexShader_;
static ACG::ShaderGenDesc desc;
// load from cache
if (pickVertexMethod_ == 0)
pickVertexShader_ = ShaderCache::getInstance()->getProgram("Picking/pick_vertices_vs.glsl", "Picking/pick_vertices_fs.glsl", 0, false);
{
desc.vertexTemplateFile = "Picking/pick_vertices_vs.glsl";
desc.fragmentTemplateFile = "Picking/pick_vertices_fs.glsl";
}
else
pickVertexShader_ = ShaderCache::getInstance()->getProgram("Picking/vertex.glsl", "Picking/pick_vertices_fs2.glsl", 0, false);
{
desc.vertexTemplateFile = "Picking/vertex.glsl";
desc.fragmentTemplateFile = "Picking/pick_vertices_fs2.glsl";
}
pickVertexShader_ = ShaderCache::getInstance()->getProgram(&desc,nullptr);
// check link status
if(!( pickVertexShader_ && pickVertexShader_->isLinked()))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment