Hi all,

I have solved the issues with the complex textures. In the end, I had to write 
a new image plugin that loads files with OpenGL texure data (much like the KTX 
format).

There seem to be some issues with OSG's texture loading code, more 
specifically, with how internalFormat and format are computed.

In my case, I needed an unsigned 8-bit integer texture. This corresponds to 
internalFormat = GL_R8UI, format = GL_RED_INTEGER, type = GL_UNSIGNED_BYTE. 
With existing texture plugins, there does not seem to be a way to accomplish 
this. For example, when loading a PNG 8-bit grayscale image, type = 
GL_UNSIGNED_BYTE, but format will be GL_LUMINANCE. Even when overriding 
internalFormat = GL_R8UI in the input file, format will still be GL_LUMINANCE 
rather than GL_RED_INTEGER, leading to an OpenGL error. 

I solved this problem by embedding the format in the image and writing a new 
image plugin (much like the KTX format), and then overriding intermalFormat 
from the input file.

Another solution would be making OSG's texture loading code smarter (e.g., when 
internalFormat  = GL_R8UI then format could be set automatically to  
GL_RED_INTEGER), or to expose a way to ovverride both internalFormat and format 
from the input file.

I am still having issues with the OSG file format, for which I cannot find any 
docs. Can anyone please tell me how I "include" an external OBJ file in my main 
OSG file? I just want a node that loads geometry from a file.

Best regards,

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=33522#33522





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

Reply via email to