Skip to content
Snippets Groups Projects
Commit c122151c authored by Ansgar Philippsen's avatar Ansgar Philippsen
Browse files

fixed gfx hf/hemilight bug in ost

parent d5d9ae5a
No related branches found
No related tags found
No related merge requests found
......@@ -269,11 +269,12 @@ void Scene::SetShadingMode(const std::string& smode)
// this here is required - in case SetShadingMode is called
// before GL is initialized (e.g. during batch mode rendering)
def_shading_mode_=smode;
if (!gl_init_) return;
if(smode=="fallback") {
Shader::Instance().Activate("");
} else if(smode=="basic") {
Shader::Instance().Activate("basic");
} else if(smode=="hf") {
} else if(smode=="hf" || smode=="hemilight") {
Shader::Instance().Activate("hemilight");
} else if(smode=="toon1") {
Shader::Instance().Activate("toon1");
......@@ -1414,7 +1415,7 @@ bool Scene::StartOffscreenMode(unsigned int width, unsigned int height)
root_node_->ContextSwitch();
#if OST_SHADER_SUPPORT_ENABLED
String shader_name = Shader::Instance().GetCurrentName();
String shader_name = !def_shading_mode_.empty() ? def_shading_mode_ : Shader::Instance().GetCurrentName();
#endif
LOG_DEBUG("Scene: initializing GL");
......@@ -1429,7 +1430,7 @@ bool Scene::StartOffscreenMode(unsigned int width, unsigned int height)
update_fog();
glDrawBuffer(GL_FRONT);
#if OST_SHADER_SUPPORT_ENABLED
LOG_DEBUG("Scene: activating shader");
LOG_DEBUG("Scene: activating shader " << shader_name);
Shader::Instance().Activate(shader_name);
#endif
return true;
......
......@@ -237,6 +237,8 @@ void Shader::Setup()
shader_program_list.push_back(shader_code_map_["basic_fs.glsl"]);
if(Shader::Link(shader_program_list,"hemilight",shader_program_id)) {
shader_program_map_["hemilight"]=shader_program_id;
// alias
shader_program_map_["hf"]=shader_program_id;
}
// selfx shader
shader_program_list.clear();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment