Re: [osg-users] Optimizing memory usage by Texture of size 4096x2048

2014-04-01 Thread John Moore
Sorry I missed the answers because of my email settings. However they are still useful. Thank you very much. John -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=58768#58768 ___ osg-users mailing

Re: [osg-users] Optimizing memory usage by Texture of size 4096x2048

2013-11-21 Thread Robert Osfield
Hi John, I'll add some general comments as others have already provide quite a few responses. In OpenGL when you create a texture object you first have the memory for the imagery in the applications main memory, when you (via osg::Texture2D) pass that image data to OpenGL fifo, then afterwards

Re: [osg-users] Optimizing memory usage by Texture of size 4096x2048

2013-11-19 Thread Ulrich Hertlein
Hi John, Quoting John Moore kahar...@gmail.com: In my app I am using 2 textures of size 4096x2048. I have a serious problem of memory usage. ... using this code my app jumps from 20 MB of memory to 250 MB of memory usage Since I am developing on mobile platform this is a huge waste of

Re: [osg-users] Optimizing memory usage by Texture of size 4096x2048

2013-11-19 Thread Glenn Waldron
What's the data type of your image? Show the code where you allocate the image data. You can also call this, which will free the CPU memory once the texture gets to the GPU: texture-setUnRefImageDataAfterApply(true); Glenn Waldron / @glennwaldron On Tue, Nov 19, 2013 at 8:11 AM, John

Re: [osg-users] Optimizing memory usage by Texture of size 4096x2048

2013-11-19 Thread John Moore
Thank you Gwaldron, that line of code saved me 40MB. Better than nothing. Now the memory usage is around 110 MB. The format of the image is JPG. I tried to use PVR but I can't load the image. This is the complete function (updated with your suggestion) that I use to create a sphere with 2

Re: [osg-users] Optimizing memory usage by Texture of size 4096x2048

2013-11-19 Thread Glenn Waldron
110MB -- CPU or GPU memory? For the entire app or just your textures? Quick math: 2 * 4096 * 2048 * 4 * 1.3 = 87MB. (4 = RGBA, 1.3 = mipmaps) Glenn Waldron / @glennwaldron On Tue, Nov 19, 2013 at 9:18 AM, John Moore kahar...@gmail.com wrote: Thank you Gwaldron, that line of code saved me

Re: [osg-users] Optimizing memory usage by Texture of size 4096x2048

2013-11-19 Thread John Moore
Memory usage is for the entire app. However memory usage of the same scene if I don’t load the texture is 20 MB. So I can safely assume the rest is consumed by the fact the textures are applied to the sphere. gwaldron wrote: 110MB -- CPU or GPU memory? For the entire app or just your

Re: [osg-users] Optimizing memory usage by Texture of size 4096x2048

2013-11-19 Thread Glenn Waldron
Your only further recourse would be to take Luc's advice and DXT-compress the data on disk (using NVTT e.g.); that will give you 4:1 savings. Ref: http://en.wikipedia.org/wiki/S3_Texture_Compression#S3TC_Format_Comparison Glenn Waldron / @glennwaldron On Tue, Nov 19, 2013 at 9:51 AM, John

Re: [osg-users] Optimizing memory usage by Texture of size 4096x2048

2013-11-19 Thread John Moore
I am not very concerned about disk usage. I am more concerned about RAM. Will be there any advantages using this kind of compression? If yes how can I compress and then load the data in a osg::Image? I am asking because I tried to do the compression with PVR (using PVRTexToolGUI) but I was not

Re: [osg-users] Optimizing memory usage by Texture of size 4096x2048

2013-11-19 Thread Glenn Waldron
It stays compressed in memory (CPU and GPU), so you get 4:1 compression in the app, not just on disk. No experience with PVR; is it Apple only? Glenn Waldron / @glennwaldron On Tue, Nov 19, 2013 at 10:25 AM, John Moore kahar...@gmail.com wrote: I am not very concerned about disk usage. I am

Re: [osg-users] Optimizing memory usage by Texture of size 4096x2048

2013-11-19 Thread John Moore
Cool, how can use it? PVR is not Apple. It's by PowerVR GRaphics. It's optimized for the Power VR GPUs that are mounted on most of the mobile devices like iPhone or iPad. However I can't understand how to use it in OpenSceneGRaph. gwaldron wrote: It stays compressed in memory (CPU and GPU),

Re: [osg-users] Optimizing memory usage by Texture of size 4096x2048

2013-11-19 Thread Alistair Baxter
15:32 To: OpenSceneGraph Users Subject: Re: [osg-users] Optimizing memory usage by Texture of size 4096x2048 It stays compressed in memory (CPU and GPU), so you get 4:1 compression in the app, not just on disk. No experience with PVR; is it Apple only? Glenn Waldron / @glennwaldron On Tue, Nov

Re: [osg-users] Optimizing memory usage by Texture of size 4096x2048

2013-11-19 Thread John Moore
I think I found the osg plugin to decompress PVR but I don't know how to use it. Do you have any idea? Alistair Baxter wrote: PVRTC is exclusive to Imagination technology’s PowerVR chipsets. All iDevices use those chipsets, so it’s in common use on iOS, but only certain Android devices

Re: [osg-users] Optimizing memory usage by Texture of size 4096x2048

2013-11-19 Thread Alistair Baxter
-Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of John Moore I think I found the osg plugin to decompress PVR but I don't know how to use it. Do you have any idea? OK, a brief look at the definitions