Hi Juan,
I managed to make some progress.
- I replaced osg::BufferObject::Extensions with GLEW
- I changed the other offending expression:
generateTextureObject(contextID, GL_TEXTURE_BUFFER_EXT);
to
generateTextureObject(this, contextID, GL_TEXTURE_BUFFER_EXT);
Things compile fine.
I have never used TBOs before. How do you use your new class?
Is the following correct?
Code:
// Creation
osg::TextureBuffer *tb = new osg::TextureBuffer();
// This will create a buffer of 300 * 4 bytes = 1200 bytes
osg::Image *image = new osg::Image();
image->allocateImage(300 /*width*/, 1 /*height is ALWAYS 1, right?*/, 1,
GL_RGBA, GL_FLOAT, 1); // GL_RGBA + GL_FLOAT = 4 floating point components for
my color
// here, feed buffer with data
tb->setImage(image);
Fragment shader:
Code:
#version 150 compatibility
#extension GL_EXT_gpu_shader4 : enable
uniform sampler1D tex; // shall I use sampler1D here, or sampler2D?
void main(void)
{
vec4 color = texelFetch(tex, 0); // I get a compile error here, texelFetch
is not a recognized function name (?!). I use a Fermi card with the latest
drivers. Confused with the different function names I found on the web
(texelFetch, texelFetch1D/2D, texelFetchBuffer which, I understand, are
deprecated).
[...]
}
Cheers,
Fred
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=35742#35742
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org