From 879f26f90c05b7fe6f791e9974c7509d95042fa6 Mon Sep 17 00:00:00 2001 From: Ansgar Philippsen <ansgar.philippsen@gmail.com> Date: Fri, 17 May 2013 11:18:43 -0400 Subject: [PATCH] fixed small bug in hf shader param settings --- modules/gfx/src/impl/fast_spheres.cc | 4 ++-- modules/gfx/src/scene.cc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/gfx/src/impl/fast_spheres.cc b/modules/gfx/src/impl/fast_spheres.cc index 325742d75..905791c34 100644 --- a/modules/gfx/src/impl/fast_spheres.cc +++ b/modules/gfx/src/impl/fast_spheres.cc @@ -78,8 +78,8 @@ namespace ost { namespace gfx { namespace impl { Shader::Instance().GetCurrentName()=="hf") { Shader::Instance().Activate("fast_sphere_hf"); GLuint cpr=Shader::Instance().GetCurrentProgram(); - GLuint loc=glGetUniformLocation(cpr,"hemi_param"); - if(loc>0) { + GLint loc=glGetUniformLocation(cpr,"hemi_param"); + if(loc>=0) { geom::Vec4 hp=Scene::Instance().GetHemiParams(); glUniform4f(loc,hp[0],hp[1],hp[2],hp[3]); } diff --git a/modules/gfx/src/scene.cc b/modules/gfx/src/scene.cc index dc2183f27..5c96c47ad 100644 --- a/modules/gfx/src/scene.cc +++ b/modules/gfx/src/scene.cc @@ -846,8 +846,8 @@ void Scene::RenderGL() #if OST_SHADER_SUPPORT_ENABLED { GLuint cpr=Shader::Instance().GetCurrentProgram(); - GLuint loc=glGetUniformLocation(cpr,"hemi_param"); - if(loc>0) { + GLint loc=glGetUniformLocation(cpr,"hemi_param"); + if(loc>=0) { glUniform4f(loc,hemi_param_[0],hemi_param_[1],hemi_param_[2],hemi_param_[3]); } } -- GitLab