Little trouble with loading DDS-Files

classic Classic list List threaded Threaded
5 messages Options
adi
Reply | Threaded
Open this post in threaded view
|

Little trouble with loading DDS-Files

adi
I use the following method to load my textures.

TextureIO.newTextureData( GLProfile glp, InputStream stream,
boolean mipmap, String fileSuffix)
                                 
that works with tga, jpg and png files, but crashes if i want to load an dds-file.
Must i take another method to load dds-files?

Problematic is in my opinion, that the textures must enable and bind
an texture object that lies in main memory and not in the graphic card memory.

If i want to load my textures in graphic card memory i use
gl.glTexImage2D( GL4bc.GL_TEXTURE_2D, 0, format, width, height, 0, format, GL2.GL_UNSIGNED_BYTE, datas )

but the exact texture types from TextureData object  i have not found.
It's not good ( nothing ) documented.
Is it pixelFormat, Internelformat or PixelType??

   
Reply | Threaded
Open this post in threaded view
|

Re: Little trouble with loading DDS-Files

gouessej
Administrator
Hi

Look at JoglUtils or in major scenegraphs relying on JOGL 2.0 (for example Ardor3D) to understand how DDS texture loading is supported.
Julien Gouesse | Personal blog | Website
adi
Reply | Threaded
Open this post in threaded view
|

Re: Little trouble with loading DDS-Files

adi
Thanks for your hint.
I have found another solution.
First i load all my textures in the main memory.
In this phase the textures must not have a opengl context.
(I think this is a better approach to organise many textures in a program)
In the init - part then, i load all textures in the graphic card, an free the
main memory from the texture datas.

Then i have rewrite the class "com.jogamp.opengl.util.texture.spi.DDSImage",
so that it can read packed cubemaps (holds the 6 cubemap textures in a single dds with a tool from Nvidea).
I hope this is ok?
Mipmapping this cubemap is then relative simple.






 
Reply | Threaded
Open this post in threaded view
|

Re: Little trouble with loading DDS-Files

gouessej
Administrator
Was DDSImage buggy according to you??
Julien Gouesse | Personal blog | Website
adi
Reply | Threaded
Open this post in threaded view
|

Re: Little trouble with loading DDS-Files

adi
This post was updated on .
No, i have  it a little bit expanded only.