I'm rather new to using float textures and GLSL, so maybe I'm missing something. I'm trying to use a float texture as a lookup table in my fragment shader. I create the texture using osg::TransferFunction1D (see attached modified osgviewer.cpp), and use the following in my input file:
---8<--- 50 0 0 0 0 0 50 ---8<--- For example: osgviewer --pos implicit.pos implicit_surface.osg (the shaders need to be in a shaders/ subdirectory under implicit_surface.osg's directory) My shader takes these positions and renders implicit spheres around them, with the first line of the position file being the radius. However, the positions seem to be clamped to [0,1], since the resulting spheres overlap except for a little bit at the edge (changing the radius to 1 shows their centers are 1 unit apart). My understanding is that float textures should be passed through to the shader without clamping. Is there something I'm doing wrong with osg::TransferFunction1D, or is my understanding wrong? Thanks, -- Bryan Thrall FlightSafety International bryan.thr...@flightsafety.com
osgviewer.cpp
Description: osgviewer.cpp
implicit_surface.vert
Description: implicit_surface.vert
implicit_surface.frag
Description: implicit_surface.frag
implicit_surface.osg
Description: implicit_surface.osg
_______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org