Hi What exactly makes memory usage increase? What if you attach shader without uniform, or without adding uniform to stateset? Try to add "#version 110" directive as first line of your shaders, does it make any difference? I think you'd better send bugreport to intel, best if you can reproduce this with pure opengl.
Cheers. 09.10.2012, 09:28, "Clemens Spencer" <[email protected]>: > Hi, > > I'm trying to use shaders on an Intel HD 3000 graphics chip (Windows7 x64, > latest graphics driver). > > As soon as I pass a uniform variable to the shader (regardless of the type), > the memory of my process increases by about 400MB. Other than that, the > shader works fine. > The size of the object the shader is attached to or the complexity of the > shader do not make a difference. Every additional shader (containing at least > one uniform variable) I use, increases the memory usage by another 400MB. > > The problem does not occur on another machine with some NVidia graphics card. > > Has anyone encountered a similar problem or does someone have an idea what > could cause a problem like this? > > Code: > > osg::Program *program = new osg::Program; > osg::Shader *frag = new osg::Shader( osg::Shader::FRAGMENT, fragSource.str() > ); > osg::Shader *vert = new osg::Shader( osg::Shader::VERTEX, vertSource.str() ); > program->addShader( frag ); > program->addShader( vert ); > // add shader to stateSet > sset->setAttributeAndModes( program, osg::StateAttribute::ON ); > // add uniform variable > osg::Uniform *var = new osg::Uniform("MATERIAL_COLOR", > osg::Vec4(1.0f,1.0f,0.0f,1.0f)); > sset->addUniform(var); > > Code: > > // Vertex Shader > > void main() > { > gl_Position = ftransform(); > gl_ClipVertex = gl_ModelViewMatrix * gl_Vertex; > } > > // Fragment Shader > > uniform vec4 MATERIAL_COLOR; > > void main() > { > gl_FragColor = MATERIAL_COLOR; > } > > By the way, I know I'm not using reference pointers :? but this shouldn't be > a problem in this little example. > > ... > > Thank you! > > Cheers, > Clemens[/code] > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=50349#50349 > > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

