[osg-users] Float textures seem to be clamped in GLSL

Thrall, Bryan bryan.thrall at flightsafety.com
Wed Mar 4 15:27:10 PST 2009


David Spilling wrote on Wednesday, March 04, 2009 5:06 PM:
> My initial thought was that nowhere were you saying that the image was
> floating point. Digging further, I realised that TransferFunction
should be
> doing it for you - I've never used this before - but this line (in
> osg/TransferFunction1D.cpp) looks a little odd to me:   
> 
>     _image->setImage(numX,1,1,GL_RGBA, GL_RGBA, GL_FLOAT, (unsigned
> char*)&_colors[0], osg::Image::NO_DELETE); 
> 
> Shouldn't that be "GL_RGBA32F_ARB,GL_RGBA, GL_FLOAT"?
> 
> I guess also doing a texture1D->setInternalFormat(GL_RGBA32F_ARB)
might help,
> but I think (without looking at the code) that osg probably picks this
up
> from the image format anyway.  

I think you're using an older OSG version than I do, since I've only got
TransferFunction.cpp, and TransferFunction1D uses
image->allocateImage(), but either way, setting the Image internal
format to GL_RGBA32F_ARB doesn't help.

I should also note that I'm running an NVIDIA 8800 GT on Windows
(compiled with VS 2005), and osgviewer reports I have ARB_texture_float
supported.
-- 
Bryan Thrall
FlightSafety International
bryan.thrall at flightsafety.com



More information about the osg-users mailing list