Hello Mailing List,

I am having an issue with my TextureLoader. For a Project I am using 3D 
Textures with a resolution of 1024*1024*96 pixel at 3 Channels.

This Texture should result into roughly 288mb in memory as I deactivated 
mipmapping.

I outlined the important code here:

                                TextureObjChunkRecPtr tex1;
                                OSG::ImageRecPtr image;
                                image = Image::create();
                                image->set(Image::OSG_RGB_PF, w, h, z, 1, 1, 
0.0, 0, image::OSG_UINT8_IMAGEDATA);
                                char* imageData=(char*)image->editData();
                                file.read(imageData,image->getSize());
                                TextureObjChunkRecPtr tex1;
                                tex1 = TextureObjChunk::create();
                                tex1->setImage( image );
                                tex1->setMinFilter( GL_LINEAR );
                                tex1->setMagFilter( GL_LINEAR );
                                tex1->setWrapS( GL_REPEAT );
                                tex1->setWrapT( GL_REPEAT );
                                tex1->setWrapR( GL_CLAMP_TO_EDGE );

The ChunkMaterials internal containers are first deleted and then recreated.

                                while( cmat1->getMFChunks()->size() )
                                                
cmat1->subChunk(cmat1->getChunk(0));

                                cmat1->addChunk(tex1,0);
                                cmat1->addChunk(shl1,1);

The problem is, that I get an error when loading this texture.

                WARN  OSGUtility.cpp(2217) [] OpenSG WARNING: 
(..\..\..\build\Source\System\Stat
                e\Base\OSGTextureObjChunk.cpp,1321): 
TextureObjChunk::initialize image failed: o
                ut of memory (0x505)

The program continues to run but tex1 is now null and the object is rendered in 
black as my shaders get no data.
This error does not always occur. Sometimes it loads sometimes it doesn't.
During my search for a fix I discovered that I can bypass this by reducing the 
memory reserved in the graphic-card memory below a threshold of 200mb.
After loading the texture this way I can load the texture without any warnings 
and I can render my scene without further problems.

I am using a 670gtx with 1,2gb ram which should be more than enough.

Are big textures not supported the way I try to use them?
Are there obvious mistakes I did?

Regards,
Erik
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk
_______________________________________________
Opensg-users mailing list
Opensg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to