Image as texture problem with large image ?

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

Image as texture problem with large image ?

Mabula Haverkamp
This post was updated on .
Dear support,

I am using JOGL in my astrophotography package Astro Pixel Processor.

I have a problem with large images and I am wondering if the error is familiar to you.

If a big image (2GB large in 32bit Float format) is loaded as a texture, then in some occasions the image data is not shown correctly on the texture.  Instead the image is not visible and we are left with a texture with something like a rainbow...

Visible here:
https://s3.eu-central-1.amazonaws.com/apastropixelprocessordl/opengl/rainbow.png

The image should look like this:
https://s3.eu-central-1.amazonaws.com/apastropixelprocessordl/opengl/orion.jpg

When a large image is loaded, I do check if the image dimensions are not larger than the maximum texture size, which in this case it isn't. So I am loading it as 1 texture.

This error seems to occur only when large images like this are concerned. This particular image has dimensions of

13704x13311

pixels in RGB format. The maximum textures size = 16384 in this case, so I would think the image can be loaded as 1 texture.

Is this error familiar? Do I perhaps need to check for another opengl capability besides the maximum texture size here?

It seems to be related possibly to Surface Scale other than 1.0, for instance on Mac Retina displays, but I am not sure yet, I will do further testing.

Thanks,
Mabula Haverkamp
Reply | Threaded
Open this post in threaded view
|

Re: Image as texture problem with large image ?

gouessej
Administrator
Hello

At first, yes please ensure that it has nothing to do with the surface scale even though I doubt that it's the real root cause.

Then, try to make a similar image with exactly 16384 * 16384 pixels in order to check whether large square textures work with your hardware. If it does, you'll have to use this kind of workaround in some cases. Otherwise, try with a smaller texture.

My guess is that some drivers return wrong information about the maximum texture size.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Image as texture problem with large image ?

Mabula Haverkamp
Hi Julien,

Thank you very much for you response.

I will do some more testing in the coming days.

Probably the best/safest way for me to implement this is by simply drawing each image as several textures that are small enough to be gauranteed within the maximum texture size... would you concur?

Mabula
Reply | Threaded
Open this post in threaded view
|

Re: Image as texture problem with large image ?

gouessej
Administrator
It would work if and only if the driver returned the correct information, which isn't always the case.
Julien Gouesse | Personal blog | Website