hi I am using dglopengl unit in my work and I'm using delphi 7.0, and I have a problem with glTexImage3DEXT, when I try to 3d textures of 512*512*512(width*height*depth) about 256 MB , using glTexImage3DEXT I got an Opengl error GL_OUT_OF_MEMORY, although my hardware specs are very high 2GBs of Ram, Geforce 7900 512MB.
When I wrote a separate project using C++ I works fine. So can you please help me
Registriert: Do Dez 05, 2002 10:35 Beiträge: 4234 Wohnort: Dortmund
What is the format of your texture? With an size of 512^3 @ 256 MB you only can use an format with max 16 Bits. Like LuminanceAlpha or Luminance_16 or something else. OpenGL could store the texture in his memory in an other format. For example then R5G6B5 format will stored internally in RGBA8. But the most Formats should be be stored as the input format.
Make sure that you are using the same settings and the same parameters for the texture in delphi and in c++. When they are the same then check for other applications. You can say that GDI Bitmap should be stored in graphic memory. Things like this also use graphic memory and so it is possible that you dosnt have enough memory when one application is running. Maybe it could be an sideeffect with other programs. Last but not least dont forget the size and format of your Framebuffer (Doublebuffering, Color, Depth, Stencil, etc) and the Resolution of your desktop (also double buffered). All these buffers will be stored in the graphic memory.
[edit] i deleted the double post but the newer title sounds better.
here's the function as I use it inside the code:
glTexImage3DExt( GL_TEXTURE_3D, 0, GL_Luminance16, _Width, _Height,_Depth, 0, GL_Luminance,
GL_UNSIGNED_Short, _data);
the format of the textures is 16-bit and it works fine in delphi when the no. of textures(depth) is 256 or 128 picture. when the depth=512 I got the error from glGetError()= GL OUT OF MEMORY and from nVidia's glexpert debug console = (NOT ENOUGH MEMORY TO EXCUTE THE COMMAND) . The term "Memory here refers of course to the PC's Memory?". I could see just before executing gltextimage3dext that I've 1 GB byte free in system memory and about 500MB free in the Graphics adapter memory. my calculation is that 512*512*512*2(2 bytes) gives 256MB, I've checked it with the cases of 128 and 256 pictures.
Registriert: Do Dez 05, 2002 10:35 Beiträge: 4234 Wohnort: Dortmund
Since OpenGL Version 1.2 then Functionallity of 3D Texture where in the OpenGL Core. So it can be that the extension GL_Texture3D isnt supported but 3D Textures are supported becouse the OpenGL Version is 1.2 and above. Ati makes this with an other Extension in OpenGL 2.0. But its only an info not important.
And to the Problem. Im confused. It should work. 256 MB is right and the parameters are also right. I cant see an problem with that code. For 8 bit luminance i do the same. I dont know where the problem could be. So i must guess and you should test all possible combinations.
Do you have tried it without delphi? Compile it, close Delphi and run it. Maybe its an sideeffect with some applications.
Its an really really really large texture. Dont forget this. Whats your plan with the texture? Maybe there is an other way without allocating a 256 MB texture.
You can try to allocate 512 2D textures with an resolution of 512x512. They should use the same size of Memory.
One thing that it also could be. Maybe you have enough graphics memory. But what could happens when the graphics memory is fragmented? Some Application uses Memory an other application uses memory and then the first memory is freed. So you get holes. The free memory maybe around 450 or 500 MB but the maximal block of free memory are only 240-250 MB large. Just an idea who flashes in my brain.
I've finally managed to figure it out, the problem wasn't with the big no. of textures, rather it was with the memory management . Delphi couldn't allocate memory without causing fragmentation to the memory, and unfortunately the opengldriver couldn't allocate the buffer, so I solved this problem by using Fastmm4 unit and I used tha flag of overhtan 2GB of Memory.
that's it .[/b]
Mitglieder in diesem Forum: 0 Mitglieder und 1 Gast
Du darfst keine neuen Themen in diesem Forum erstellen. Du darfst keine Antworten zu Themen in diesem Forum erstellen. Du darfst deine Beiträge in diesem Forum nicht ändern. Du darfst deine Beiträge in diesem Forum nicht löschen. Du darfst keine Dateianhänge in diesem Forum erstellen.