Re: [osg-users] Render-To-Texture GLSL program question

2013-11-19 Thread Sebastian Messerschmidt
Hi Ethan, Thanks, that makes sense that it would just be rendering a quad and that the original scene geometry would be lost. However, the GLSL geometry shader only accepts primitives of the type point, line, or triangle-is it perhaps rendering two triangles to the geometry shader to make

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

2013-11-19 Thread John Moore
Hi, In my app I am using 2 textures of size 4096x2048. I have a serious problem of memory usage. Code: osg::ref_ptrosg::Texture2D texture = new osg::Texture2D; texture-setDataVariance(osg::Object::STATIC); texture-setFilter(osg::Texture::MIN_FILTER,

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] Render-To-Texture GLSL program question

2013-11-19 Thread Ethan Fahy
Thanks Sebastian, I have in fact looked through every geometry shader tutorial I could find and have tried to implement a simple pass-through sahder identical to the one you posted, but when I add the geometry shader I just get a black screen with no OpenGL error messages, and if I remove the

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] Render-To-Texture GLSL program question

2013-11-19 Thread Sebastian Messerschmidt
Hi Ethan Thanks Sebastian, I have in fact looked through every geometry shader tutorial I could find and have tried to implement a simple pass-through sahder identical to the one you posted, but when I add the geometry shader I just get a black screen with no OpenGL error messages, and if I

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] Render-To-Texture GLSL program question

2013-11-19 Thread Ethan Fahy
Thanks again, it looks like I need to get up to speed with using in and out vs attribute and varying since I cut my teeth on older tutorials and apparently attribute and varying are officially deprecated and are supported through compatibility mode. I'm not used to needing historical context

[osg-users] util::Smoother not working with 2.9.12 while its working with 3.0.1

2013-11-19 Thread Abhishek Bansal
Hi, I am trying to develop a plugin which loads IGES file. I am getting Indexed triangle list using OpenCascade. I am using osgUtil::smoother to calculate normals. on final mesh. My problem is that i get proper normals in OSG 3.0.1. But in OpenSceneGraph 2.9.12 i dont get any normals (i cant

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] OpenThreads::Mutex doesn't work the same on win32 and linux/pthreads

2013-11-19 Thread Mattias Helsing
Hi all (again) Upping this thread as Robert want some windows developer input before he merges a submission of mine. The lack of responses suggests that no-one ever used the OpenThreads::Mutex on win32 like i did (or actually how I used it on linux and then expected the same behavior on win32),

Re: [osg-users] util::Smoother not working with 2.9.12 while its working with 3.0.1

2013-11-19 Thread Alberto Luaces
Abhishek Bansal writes: Hi, I am trying to develop a plugin which loads IGES file. I am getting Indexed triangle list using OpenCascade. I am using osgUtil::smoother to calculate normals. on final mesh. My problem is that i get proper normals in OSG 3.0.1. But in OpenSceneGraph 2.9.12 i

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] OpenThreads::Mutex doesn't work the same on win32 and linux/pthreads

2013-11-19 Thread Mattias Helsing
Posting the submission here as well... On Tue, Nov 19, 2013 at 3:57 PM, Mattias Helsing helsin...@gmail.com wrote: Hi all (again) Upping this thread as Robert want some windows developer input before he merges a submission of mine. The lack of responses suggests that no-one ever used the

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] util::Smoother not working with 2.9.12 while its working with 3.0.1

2013-11-19 Thread Abhishek Bansal
Hi, Thank You for your reply ! But the issue is thst I am creating a plugin for one proprietary SDK based on OSG. I dont have access to source code of OSG they are using. I built my plugin with binaries provided by them and OSG 3.0.1. What could be the bug if you have any idea ? Thank you!

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

2013-11-19 Thread Alistair Baxter
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 with the right type of GPU support it. I don't believe there are any desktop or laptop graphics cards that support it directly, but

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] util::Smoother not working with 2.9.12 while its working with 3.0.1

2013-11-19 Thread Alberto Luaces
Abhishek Bansal writes: Hi, Thank You for your reply ! But the issue is thst I am creating a plugin for one proprietary SDK based on OSG. I dont have access to source code of OSG they are using. I built my plugin with binaries provided by them and OSG 3.0.1. Then you can copy the

Re: [osg-users] util::Smoother not working with 2.9.12 while its working with 3.0.1

2013-11-19 Thread Abhishek Bansal
Then you can copy the SmoothingVisitor source code from 3.0.1 into your plugin in order to use that non-faulty code. Yes ! I will try to do that and let you know of the results. But as i said I also tried with manual normal calculations they are also not working. Thank You -Abhishek

Re: [osg-users] util::Smoother not working with 2.9.12 while its working with 3.0.1

2013-11-19 Thread Alberto Luaces
Abhishek Bansal writes: Then you can copy the SmoothingVisitor source code from 3.0.1 into your plugin in order to use that non-faulty code. Yes ! I will try to do that and let you know of the results. But as i said I also tried with manual normal calculations they are also not

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

Re: [osg-users] util::Smoother not working with 2.9.12 while its working with 3.0.1

2013-11-19 Thread Abhishek Bansal
Hi, Ok !! I found a rather strange solution. If I add _SECURE_SCL=0 to preprocessor definitions in VS2008 it works fine for osg 2.9.12 also. I dont understand the problem :( Thank you! Cheers, Abhishek -- Read this topic online here:

Re: [osg-users] util::Smoother not working with 2.9.12 while its working with 3.0.1

2013-11-19 Thread Alberto Luaces
Abhishek Bansal writes: If I add _SECURE_SCL=0 to preprocessor definitions in VS2008 it works fine for osg 2.9.12 also. I dont understand the problem :( This sounds like a mix of release and debug versions of the library, or different runtimes from different compiler versions... definitely

Re: [osg-users] Render-To-Texture GLSL program question

2013-11-19 Thread Ethan Fahy
Hello Sebastian, I read up on the differences between glsl 1.2 and 1.5 and then scimmed through the official GLSL 1.5 specification document. I then grepped the osg src and examples directories to see if I could find any #version 150 shaders (I could not). Are there any reference/example

Re: [osg-users] Render-To-Texture GLSL program question

2013-11-19 Thread Sebastian Messerschmidt
Hi Ethan, Hello Sebastian, I read up on the differences between glsl 1.2 and 1.5 and then scimmed through the official GLSL 1.5 specification document. I then grepped the osg src and examples directories to see if I could find any #version 150 shaders (I could not). Are there any

Re: [osg-users] Render-To-Texture GLSL program question

2013-11-19 Thread Ethan Fahy
If I use #version 150 compatibility, do I still have to explicitly do the in out specifications, such as declaring out gl_FragColor in the frag shader? SMesserschmidt wrote: Hi Ethan, Hello Sebastian, I read up on the differences between glsl 1.2 and 1.5 and then scimmed through the

Re: [osg-users] Render-To-Texture GLSL program question

2013-11-19 Thread Ethan Fahy
Also, is there any good reason to use #version 150 compatibility vs using #version 120 and using the extension required to use geometry shaders other than using #version 150 compatibility is more forward looking syntactically? -- Read this topic online here:

[osg-users] Crash from loading assets in worker thread

2013-11-19 Thread Bradley Baker Searles
Hello, Summary: Since upgrading to OSG 3.2, our application will crash during render while loading a legacy .OSG file on a worker thread. The legacy/deprecated OSG code will load objects that are put into the object cache, but then use takeImage to get a raw pointer to a ref-counted object.

Re: [osg-users] PagedLOD and IntersectionVisitor

2013-11-19 Thread Olivier Tournaire
Hi all, Sorry for the noise, but, as I did not receive any answer, I am interested if someone has an idea on the topic. Regards, Olivier 2013/11/15 Olivier Tournaire olit...@gmail.com Hi, I am currently trying to retrieve some specific triangles in a PagedLOD model. To do so, I use a

[osg-users] [vpb] Virtual Planet Builder for Windows

2013-11-19 Thread Maia Randria
Hi, I have the OSG 3 Cookbook of Rui Wang and I am trying to use Virtual Planet Builder as explained in the book. I have OSG 3.0.1 pre-built binaries from Alphapixel (Windows 32 bits, Visual C++ 2008). As explained in the book, VPB needs GDAL and I installed it from binaries as provided by the

[osg-users] [osgText] Visual Studio 2013 (VS11) compatibility

2013-11-19 Thread Judson Weissert
Hello, I was wondering if anyone has compiled OSG on Visual Studio 2013 yet? I am compiling OSG 3.2.1 on Visual Studio 2013, and encountered a build error in src/osgText/Glyph.cpp. It appears that std::min() and std::max() are not defined because the algorithm header was not included. See

Re: [osg-users] Render-To-Texture GLSL program question

2013-11-19 Thread Sebastian Messerschmidt
Sorry Ethan, Personally I try to take the profile which doesn't require the extension. Simply go ahead an try. Concerning your other question: Please check the web for answers. The OpenGL/GLSL Specification is freely available and there might be some tutorials for this. For reference I use:

Re: [osg-users] Render-To-Texture GLSL program question

2013-11-19 Thread Sebastian Messerschmidt
If I use #version 150 compatibility, do I still have to explicitly do the in out specifications, such as declaring out gl_FragColor in the frag shader? No, as I already said: You can use the old syntax and mix it with the new one. You absolutely don't have to use the layout, in, out things in