Hello
I have win7 x64 & nvidia video card
I found strange problem after update to version 275.33 of nvidia drivers.
I see artifacts with shaders, i tried to find why.
Part of shader uniform variables are not work correctly.
i try to debug it with gdebugger and i noticed non-initialized values in part
of uniforms.
file src/osg/Program.cpp lines 672-673
Code:
_extensions->glGetActiveUniform( _glProgramHandle,
i, maxLen, 0, &size, &type, name );
Later i found that names of array variables coming with [0]. example -
"%name%[0]"
i tested with 266.58 they coming without [0]
as result in _uniformInfoMap[Uniform::getNameID(reinterpret_cast<const
char*>(name))] = ...
we recording values with [0].
file src/osg/Program.cpp lines 213
Code:
inline void apply(const Uniform& uniform) const
{
GLint location = getUniformLocation(uniform.getNameID());
if (location>=0)
and here we can't get right location
i fix it, please look patch
Code:
--- a/OpenSceneGraph/src/osg/Uniform.cpp
+++ b/OpenSceneGraph/src/osg/Uniform.cpp
@@ -611,13 +611,13 @@ unsigned int Uniform::getNameID(const std::string& name)
static UniformNameIDMap s_uniformNameIDMap;
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(s_mutex_uniformNameIDMap);
- UniformNameIDMap::iterator it = s_uniformNameIDMap.find(name);
+ UniformNameIDMap::iterator it = s_uniformNameIDMap.find(name.substr(0,
name.find("[")));
if (it != s_uniformNameIDMap.end())
{
return it->second;
}
unsigned int id = s_uniformNameIDMap.size();
- s_uniformNameIDMap.insert(UniformNameIDMap::value_type(name, id));
+ s_uniformNameIDMap.insert(UniformNameIDMap::value_type(name.substr(0,
name.find("[")), id));
return id;
}
But i don't think that is a good solution.
Thank you!
Cheers,
Alexander
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=40201#40201
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org