Optimal display of a large 32 byte float texture

Hi all,
I start with openGl and shader, any help is very useful for me

Here is my problem:

I’m trying to write software to display a big floating point textures (RGB image 32 float). I am using :
glTexImage2D(GL_TEXTURE_RECTANGLE_NV, 0, GL_FLOAT_RGB32_NV, w1, h1, 0,
GL_RGB, GL_FLOAT, tableau);

It work correctly but the PROBLEMEM, that when the texture is greater than 4096*4096 (data in stocked in the “tableau”), I obtain segmentation fault, I think it’s normal because I’m using nvdia 5200 card (this is the limit) …

Does any body know this problem? And have a good idea to view big texture (for example 16000*16000 ) ? My question is :
1)how i can with shader tile my big image into multiple textures? if we now some code example, it is very cool …

2)i hope for optimal method with maximum of speed…

I now that it is possible to use Memory Mapping (CPU) but i’m not sure if it is possible in the case of shader+OpenGl(GPU)?

Thanks a lot.

Well, all graphics processors have a limit to the size of textures. When you load a texture that is too large, it should not crash, it should cause a GLerror, so you might not be handling that case correctly.

To handle something like this, the easiest solution is to not render the image as one quad, but instead for you to break it into tiles yourself. Obviously, I am assuming that you do not need to do any filtering across tile.

If you really need to do it in the shader, you would need a sampler for each tile, and you would need to perform math on the incoming coordinate. Then you would need to use conditional control flow to select the proper sampler to fetch from. Depending on the hardware and the number of tiles, this could become pretty expensive.


Another suggestion (although it might not entirely suit your needs) is to use clipmapping, this causes a few issues with toroidal (wraparound) updates with floating point textures, so you’ll have to code something to take care of simulating the GL_REPEAT functionality.

The last part comes down to (in my experience), something like:
wrapped texcoord = texcoord - step(1.0,texcoord);
Which only takes care of coordinates from 0 - 2, but then, your toroidal grid offsets SHOULD stay in the 0-1 (normalized) range.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.