1

I've found that the maximum texture size that my opengl can support is 8192 but the image that I'm working with is 16997x15931. As you can see in this link, I've completed the class COpenGLControl and customized it for my own use to work with a smaller 7697x7309 image and activated different navigation tasks for it.

Render an outlined red rectangle on top a 2D texture in OpenGL

but now in the last stages of work, I've decided to change the part where applies the texture and enable it to handle images bigger than the size 8192.

Questions:

  • Is it possible in my opengl?
  • what concept should I study mipmaps, multiple texturing?
  • Will it expand performance of code?

Right now my program uses 271 MB of ram for just showing this small image(7697x7309) and I'm going to add a task to it (for image-processing filtering processes) that I have used all my effort to optimize the code but it uses 376 MB of ram for the (7697x7309) image(the code is already written as a console application will be combined with this project). So I think the final project would use up to 700 MB of ram for images near the 7000x7000 size. Obviously for the bigger image (16997x15931 ) the usage of ram will be alot higher!

So I'm looking for a concept to handle images bigger than the MAX_TEXTURE_SIZE and also optimize the performance of the program

More Questions:

  • What concept should I study in OpenGL to achieve the above goal?
  • explain alittle about the concept that you suggest?

I've asked the question in Game Developement too but decided to repeat the question here maybe it will have more viewers. As soon as I get the answer, I will delete the question from either on of the sites. So don't worry about multiple questionings.

Community
  • 1
  • 1
Sepideh Abadpour
  • 2,550
  • 10
  • 52
  • 88
  • what about MegaTextures? http://www.opengl.org/registry/specs/AMD/sparse_texture.txt and here http://renderingpipeline.com/2012/03/partially-resident-textures-amd_sparse_texture/ – fen Aug 29 '13 at 16:31
  • I'm not using modern OpenGL and you see I'm using the old WGL API in my class because I'm made to. Are Mega Textures supported in deprecated OpenGL as [the comments for this answer say](http://stackoverflow.com/a/18478717/1245120) say? @fen – Sepideh Abadpour Aug 29 '13 at 16:49
  • 1
    can you check what opengl version your hardware support? modern opengl is enabled by using extensions, loaded dynamically. If you cannot use mega textures then you can have 4 textures that are created from a part of your huge texture. Then in the app you have to manage them. Also look for a compression mechanism like DXT textures and compression (also supported via opengl extensions) – fen Aug 29 '13 at 17:38
  • Can you guide me how to check the version? I'm using window 7x64 – Sepideh Abadpour Aug 29 '13 at 17:45
  • 1
    http://www.ozone3d.net/gpu_caps_viewer/, http://stackoverflow.com/questions/14413/using-opengl-extensions-on-windows, http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-12-opengl-extensions/ – fen Aug 29 '13 at 17:48

1 Answers1

2

I will try to sum up my comments for the original question.

  • know your proper opengl version: maybe you can load some modern extension and work with even the recent version of opengl.
  • to reduce memory you can use some texture compression:
  • another simple idea: you can split the huge texture and create 4 smaller textures (from 16k x 16k into four 8k x 8k) and somehow render four squares.
  • maybe you can use OpenCL or CUDA to do the work?
  • regarding mipmaps: it is set of smaller version of your input texture, mipmaps improve performance and final quality of the filtering, but you need another 33% more memory for a texture with full mipmap chain. In your case they could be very helpful. For instance when you look at a wall from a huge distance you do not have to use full (large) texture... only a small version of it is enough. g-truc on mipmaps

In general there is a lot of options, but it depends on your experience what is simpler and fastest to implement.

fen
  • 9,835
  • 5
  • 34
  • 57
  • thanks I'm not so experienced in using opengl in fact this is my first program but I will take all of your advices in my future projects but just to be curious what is the use of mipmaps then? – Sepideh Abadpour Aug 29 '13 at 18:14
  • thanks @fen from a brief study I've found that mipmaps is something like pyramids in GIS applications that makes images smaller than the size of the original image and uses that to fast navigation tasks? So even using mipmaps will not solve my problem. It just makes smaller versions of my 8000x8000 image? But if I use multiple texturing as you suggested build four textures of my original image using mipmap concept will enhance the rendering performance? am I right? **I think for a beginner like me multiple texturing is best to solve the problem fast** – Sepideh Abadpour Aug 29 '13 at 18:24
  • do you want to display it on some 3d wall? maybe you can scale your input texture to some smaller version (even using some photo app) and then use it in the program? – fen Aug 29 '13 at 18:29
  • besides @fen excuse me for the stupid comment on my question my OpenGL version is as follows: **GL_RENDERER: GeForce GT 230M/PCI/SSE2** **GL_VERSION: 3.3.0** **GLSL version: 3.30 NVIDIA via Cg compiler** and my **Total GPU memory: 512MB** – Sepideh Abadpour Aug 29 '13 at 18:32
  • No don't want to do such thing. My program is for image-processing and I don't want to manipulate the resolution before entering the program. right now it works well with satellite geotiff images smaller than 8192. I'M JUST RENDERING THE IMAGE AND DO NAVIGATION TASKS ON A 2D SCENE SIMULATED WITH OPENGL AND DO NAVIGATION LIKE ZOOM,PAN AND ETC – Sepideh Abadpour Aug 29 '13 at 18:36
  • 1
    with this geForce you can do modern opengl programming... but since it is a mobile version do not expect great performance :) Good luck with the project. – fen Aug 29 '13 at 18:54
  • thanks @fen excuse me for asking so many questions but what do you mean by mobile version? mean it is for embeded systems but installed on my laptop? – Sepideh Abadpour Aug 29 '13 at 19:02