Hi Fred,
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);
I don't see anything wrong here.
Code:
#version 150 compatibility
#extension GL_EXT_gpu_shader4 : enable
For me (NVIDIA 280GTX graphics card in linux), it works just to declare:
#version 130
uniform sampler1D tex; // shall I use sampler1D here, or sampler2D?
This has to be:
uniform samplerBuffer tex;
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).
[...]
}
I use texelFetchBuffer but if you solved it I guess you use the same.
Cheers,
Juan
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org