Re: [osg-users] how to improve frame rate of my scene with lots of cubes and cylinders?

2009-10-20 Thread Maurizio Lodo
Hi,
Should this be done within VertexShader using GLSL? I tried to create a light 
following the osglight example, but it did not make any difference.
Cheers,
Maurizio

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=18417#18417





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] how to improve frame rate of my scene with lots of cubes and cylinders?

2009-10-19 Thread Peter Hrenka

Hi Maurizio,

Maurizio Lodo schrieb:

Hi,
Thanks Peter for your very helpful reply. I have sorted that issue thank to 
your pointers.
Now I have only one more question then I promise I won't bother you anymore. It 
seems that when I generate my model using the simple geometries I created and 
using VertexShader, the resulting cube, for example, has a very flat uniform 
colour, where it is impossible to distinguish the various faces. This does not 
happen when using the shapeDrawable cube or cylinder and so on. Would any of 
you mind pointing me in the right direction of how to resolve this?


You need to provide normals to your geometry and enable light
to achive the effect you desire.



Thank you!

Cheers,
Maurizio


Cheers,
Peter
--
Vorstand/Board of Management:
Dr. Bernd Finkbeiner, Dr. Roland Niemeier, 
Dr. Arno Steitz, Dr. Ingrid Zech

Vorsitzender des Aufsichtsrats/
Chairman of the Supervisory Board:
Michel Lepert
Sitz/Registered Office: Tuebingen
Registergericht/Registration Court: Stuttgart
Registernummer/Commercial Register No.: HRB 382196 



___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] how to improve frame rate of my scene with lots of cubes and cylinders?

2009-10-18 Thread Maurizio Lodo
Hi,
Thanks Peter for your very helpful reply. I have sorted that issue thank to 
your pointers.
Now I have only one more question then I promise I won't bother you anymore. It 
seems that when I generate my model using the simple geometries I created and 
using VertexShader, the resulting cube, for example, has a very flat uniform 
colour, where it is impossible to distinguish the various faces. This does not 
happen when using the shapeDrawable cube or cylinder and so on. Would any of 
you mind pointing me in the right direction of how to resolve this?


Thank you!

Cheers,
Maurizio

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=18364#18364





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] how to improve frame rate of my scene with lots of cubes and cylinders?

2009-10-14 Thread Maurizio Lodo
Hi all,
Finally I found some time to play with this. Thanks to your words of wisdom, I 
have decided to create my cylinder geometry. I used the drawinstanced example 
as a template and I managed to generate the cylinders, translate them and 
rotate them as I want.
However I notice that when I get closer to these cylinders, they disappear, 
while ojects created using ShapeDrawable do not disappear. I do not know 
anything about GLSL (or OpenGL or OpenSceneGraph for that matter) and I was 
wondering if anyone could tell me why this is happening, if there is a way to 
fix it and if that would affect performance.

Thank you very much!

Cheers,
Maurizio

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=18248#18248





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] how to improve frame rate of my scene with lots of cubes and cylinders?

2009-10-14 Thread Gordon Tomlinson
The problem is likely your code .


But we are not clairvoyant and as you do not provide the code you have used
its nearly impossible to say what is wrong



One shot in to the dark would be bad bounding boxes and spheres





__
Gordon Tomlinson 

gor...@gordontomlinson.com
IM: gordon3db...@3dscenegraph.com
www.vis-sim.com www.gordontomlinson.com 

__

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Maurizio
Lodo
Sent: Wednesday, October 14, 2009 3:09 AM
To: osg-users@lists.openscenegraph.org
Subject: Re: [osg-users] how to improve frame rate of my scene with lots of
cubes and cylinders?

Hi all,
Finally I found some time to play with this. Thanks to your words of wisdom,
I have decided to create my cylinder geometry. I used the drawinstanced
example as a template and I managed to generate the cylinders, translate
them and rotate them as I want.
However I notice that when I get closer to these cylinders, they disappear,
while ojects created using ShapeDrawable do not disappear. I do not know
anything about GLSL (or OpenGL or OpenSceneGraph for that matter) and I was
wondering if anyone could tell me why this is happening, if there is a way
to fix it and if that would affect performance.

Thank you very much!

Cheers,
Maurizio

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=18248#18248





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] how to improve frame rate of my scene with lots of cubes and cylinders?

2009-10-02 Thread Maurizio Lodo
Thanks for your replies!! I have been reading through this forum and googled a 
lot and it seems the best solution for my problem would be to create a 
simplified cylinder geometry (which I have done), divide all the cylinders into 
bins (by diameter, as they will have all the same length), and use geometry 
instancing to create several instances of the representative cylinder for each 
bin, translatated and rotated so that they would appear in the correct position 
in the scene. Would this sound sensible to you?
Unfortunately this is were the learning curve gets a little steep though. I 
cannot seem to figure out how to use geometry instancing just by reading the 
drawinstanced example. Is there any tutorial around? or any other examples that 
would be helpful.

Thanks again,
Maurizio

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=17786#17786





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] how to improve frame rate of my scene with lots of cubes and cylinders?

2009-09-29 Thread Andrew Burnett-Thompson
Hi there, this is a quick response as i'm on my pda

If you look in the implementation of shapedrawable, drawcylinder
function, i believe the vertex locations for cylinders are calculated
on each draw, using sin and cos!

Also note the matrices for  positionattitudetransforms are computed per frame

You may be better off creating your own cylinder object with the
vertices pre calculated

Cheers, andrew

On 9/29/09, Maurizio Lodo maurimaur...@msn.com wrote:
 Hi,
 I suppose you get many messages like this, so I apologise in advance.
 My scene is made of cubes and cylinders generated using ShapeDrawable.
 First I generate a large cell made of 1000 large cubes and up to 3000
 cylinders and then a smaller cell  made of the same number of elements,
 just smaller. Then I use osg::PositionAttitudeTransform to place several (16
 to 64) of these smaller cells inside one of the cubes of the larger cell.
 Unfortunately this seems to cause the frame rate to drop to about 8 - 9,
 while the scene runs at about 120fps when section with the small cells goes
 out of the screen. I followed a suggestion I read on this forum and I tried
 to remove the use of osg::PositionAttitudeTransform and draw all the
 elements of the several smaller cells but this only makes the program take
 longer to load, but once it's loaded it still runs at about the same frame
 rate.
 I am just a beginner and I was wondering if any of you clever people can
 give me a pointer in the right direction or indicate some useful documents
 that my help me make this run a little faster.

 Thank you very much in advance!

 Cheers,
 Maurizio

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=17696#17696





 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org