Re: [osg-users] OSG Texture1D and GL_UNSIGNED_SHORT

2012-01-13 Thread Robert Osfield
Hi Chris,

On 12 January 2012 22:44, Chris 'Xenon' Hanson xe...@alphapixel.com wrote:

  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.

Could you send this adapted code, or even better a version of
osgtexture1D.cpp that can be
run with a command line option (such as --ushort) to replicate this error?

  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 know what the issue is.  Texture2D has been used far more
heavily over the years than Texture1D
so I can imagine bugs that have been spotted and fixed in Texture2D
that haven't been in Texture1D.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] OSG Texture1D and GL_UNSIGNED_SHORT

2012-01-13 Thread Chris 'Xenon' Hanson
On 1/13/2012 2:28 AM, Robert Osfield wrote:
 Could you send this adapted code, or even better a version of
 osgtexture1D.cpp that can be
 run with a command line option (such as --ushort) to replicate this error?

  I'll see if I can replicate it in a simple form. It was very slippery.

 I don't know what the issue is.  Texture2D has been used far more
 heavily over the years than Texture1D
 so I can imagine bugs that have been spotted and fixed in Texture2D
 that haven't been in Texture1D.

  Yeah, that's what I suspected. It may have to do with generating mipmaps or 
something.

-- 
Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com 
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
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] OSG Texture1D and GL_UNSIGNED_SHORT

2012-01-12 Thread Chris 'Xenon' Hanson

  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. xe...@alphapixel.com 
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
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org