Just wanted to log a peculiar error I just dodged.

  Ive been using a 1D texture to do contour lines on terrain, a common 
technique. I had
some trouble where it appeared that OSG was turning my GL_RGB UBYTE texture into
GL_UNSIGNED_SHORT as it was uploading. I'm not sure why this was. I also tried 
adapting
the very code from the osg osgtexture1D.cpp, create1DTextureStateToDecorate() 
and it
seemed to do the same.

  I didn't debug it all the way into OSG, but I verified with gDebugger that 
glTexImage1D
was being called with GL_UNSIGNED_SHORT for some reason.

  I switched to Texture2D, which seems to have no downside, and it works 
properly.

  I don't have a fix, I'm just recording my experience in case someone else 
runs into the
same situation. Just switch to Texture2D with an n*1 texture unless you have a 
good reason
not to.


-- 
Chris 'Xenon' Hanson, omo sanza lettere. [email protected] 
http://www.alphapixel.com/
  Digital Imaging. OpenGL. Scene Graphs. GIS. GPS. Training. Consulting. 
Contracting.
    "There is no Truth. There is only Perception. To Perceive is to Exist." - 
Xen

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to