Re: [osg-users] How to getting the number of vertices

2013-12-02 Thread Robert Osfield
Hi Kim,

Have a look at the osgUtil::StatsVisitor, you'll find it in the
include/osgUtil/Statistics header.

Robert.


On 2 December 2013 06:49, Kim JongBum osgfo...@tevs.eu wrote:

 Hi,

 i would like to know the number of vertices in the scene.

 i know how to see the value of vertices as i press 's'button.

 but i wanna know how can i get the value
 (ex_for storing into variable)

 Thank you!

 Cheers,
 Kim

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





 ___
 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] [osgOcean] Regulate the Ocean Reflection intensity.

2013-12-02 Thread Dario Minieri
Hi,

Nice, I've seen now the mod, I'll try them as soon


Thank you!

Cheers,
Dario

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





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


Re: [osg-users] [osgOcean] Regulate the Ocean Reflection intensity.

2013-12-02 Thread Dario Minieri
Hi,

Looking the patch, I've seen that this is the same mod that I've tried but 
doesn't looks good to me...I'm using the trunk version, so the patch is 
different because some stuffs are moved in Technique file, but the mod is the 
same and I'm not really able to tone down (mean: add a lower reflection 
intensity) the reflection. Playing with fresnel mul and reflection mul don't 
move to me along a right final effect.

Have you tried some other parameters combination?  Have you a snapshot to see 
your result?

Thank you!

Cheers,
Dario

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





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


[osg-users] rendering millions of spheres

2013-12-02 Thread Trajce Nikolov NICK
Hi Community,

I remember someone has faced this problem and I think with some solution.
Anyone knowing some pointers willing to share some hints, techniques?

Thanks a bunch

Nick

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


Re: [osg-users] rendering millions of spheres

2013-12-02 Thread Robert Osfield
Hi Nick,

On 2 December 2013 13:49, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com
 wrote:

 I remember someone has faced this problem and I think with some solution.
 Anyone knowing some pointers willing to share some hints, techniques?


What approach you want to take depends upon what you want in terms of the
visual, how close you plan to allow users to get the spheres, do you need
them to be lit etc.

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


Re: [osg-users] rendering millions of spheres

2013-12-02 Thread Alistair Baxter
In order to render a large amount of identical primitives, you probably want to 
use either instancing or geometry shaders. If your target hardware supports 
OpenGl 3.x features, then the latter is better. You can use arrays of 
per-vertex data to specify the differences between your spheres (radius, colour 
etc), create your osg::geometry as a list of points and have your geometry 
shader expand that into spheres.

For the spheres themselves, it's far quicker to create them as camera-facing 
impostors, and have your fragment shader just draw spheres for each of them 
(various examples are available on the web), which can be lit as needs be. The 
trouble is that they will be flat, which might not be ideal if many of your 
spheres intersect. You could at least save some triangles by generating 
camera-facing hemispheres. I'm not sure what the effect would be if you changed 
the z-values in the fragment shader, but I am advised that's not a good idea, 
because it means z-buffer-testing can't be done before your fragment shader is 
run.

If you're stuck with older or mobile hardware, then (extensions permitting) you 
can use shader instancing to do the same thing. Create a single sphere (or 
hemisphere or quad, for an impostor) , put your per-instance data into a 
texture, and sample that texture in your vertex shader (ensure you set your 
texture filtering modes appropriately).  There is an example osgdrawinstanced 
supplied with the OpenSceneGraph distribution that shows you basically how that 
is done.

If you don't have the instancing extension available (MESA software rendering, 
some older mobile OpenGLES 2 chipsets, VERY old desktop hardware) you need to 
just make sure you render them in large batches of vertices, which means making 
1, or only a few Geometries containing multiple spheres (or quads if you can 
still use a vertex shader to orient them).

Quite a lot of ideas there for things to try, I think, apologies if any of that 
is a bit confusing.


Alistair Baxter
Software Engineer

Have you downloaded your FREE copy of FieldMove Clino?
Find out more about our app for iPhone and Android smartphones:  
http://news.mve.com/fieldmoveclino
Midland Valley Exploration Ltd.
144 West George Street
Glasgow G2 2HG
United Kingdom
Tel: +44 (0) 141 332 2681
Fax:+44 (0) 141 332 6792
The structural geology experts

From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Trajce Nikolov 
NICK
Sent: 02 December 2013 13:50
To: OpenSceneGraph Users
Subject: [osg-users] rendering millions of spheres

Hi Community,

I remember someone has faced this problem and I think with some solution. 
Anyone knowing some pointers willing to share some hints, techniques?

Thanks a bunch

Nick

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


Re: [osg-users] rendering millions of spheres

2013-12-02 Thread Trajce Nikolov NICK
Thanks Robert, and Alistair for the detailed info. I have done this in the
past as you mentioned with geometry shaders by passing the centers and
radiuses as vertex array and attribs and expanding them into spheres in a
geometry shader. Can not use it now though. So your another hint was the
sample from the osg repo. I will have a look at it.

I have to model rain drops on wind shield, and not aligned to screen but in
3d. I have set of rain drop models from Modo and looking around for the
best approach to get these models randomly placed in 3D on a geometry (the
wind shield) as many as possible.

Thanks a bunch again for the hints.

Nick


On Mon, Dec 2, 2013 at 5:44 PM, Alistair Baxter alist...@mve.com wrote:

  In order to render a large amount of identical primitives, you probably
 want to use either instancing or geometry shaders. If your target hardware
 supports OpenGl 3.x features, then the latter is better. You can use arrays
 of per-vertex data to specify the differences between your spheres (radius,
 colour etc), create your osg::geometry as a list of points and have your
 geometry shader expand that into spheres.



 For the spheres themselves, it’s far quicker to create them as
 camera-facing impostors, and have your fragment shader just draw spheres
 for each of them (various examples are available on the web), which can be
 lit as needs be. The trouble is that they will be flat, which might not be
 ideal if many of your spheres intersect. You could at least save some
 triangles by generating camera-facing hemispheres. I’m not sure what the
 effect would be if you changed the z-values in the fragment shader, but I
 am advised that’s not a good idea, because it means z-buffer-testing can’t
 be done before your fragment shader is run.



 If you’re stuck with older or mobile hardware, then (extensions
 permitting) you can use shader instancing to do the same thing. Create a
 single sphere (or hemisphere or quad, for an impostor) , put your
 per-instance data into a texture, and sample that texture in your vertex
 shader (ensure you set your texture filtering modes appropriately).  There
 is an example osgdrawinstanced supplied with the OpenSceneGraph
 distribution that shows you basically how that is done.



 If you don’t have the instancing extension available (MESA software
 rendering, some older mobile OpenGLES 2 chipsets, VERY old desktop
 hardware) you need to just make sure you render them in large batches of
 vertices, which means making 1, or only a few Geometries containing
 multiple spheres (or quads if you can still use a vertex shader to orient
 them).



 Quite a lot of ideas there for things to try, I think, apologies if any of
 that is a bit confusing.





 Alistair Baxter
 Software Engineer
 
 Have you downloaded your FREE copy of
 *FieldMove Clino? *Find out more about our app for iPhone and Android
 smartphones:  http://news.mve.com/fieldmoveclino

 Midland Valley Exploration Ltd.
 144 West George Street
 Glasgow G2 2HG
 United Kingdom

 Tel: +44 (0) 141 332 2681
 Fax:+44 (0) 141 332 6792

 The structural geology experts



 *From:* osg-users-boun...@lists.openscenegraph.org [mailto:
 osg-users-boun...@lists.openscenegraph.org] *On Behalf Of *Trajce Nikolov
 NICK
 *Sent:* 02 December 2013 13:50
 *To:* OpenSceneGraph Users
 *Subject:* [osg-users] rendering millions of spheres



 Hi Community,



 I remember someone has faced this problem and I think with some solution.
 Anyone knowing some pointers willing to share some hints, techniques?



 Thanks a bunch



 Nick



 --
 trajce nikolov nick

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




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


Re: [osg-users] rendering millions of spheres

2013-12-02 Thread Robert Osfield
Hi Nick,

On 2 December 2013 15:18, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com
 wrote:

 I have to model rain drops on wind shield, and not aligned to screen but
 in 3d. I have set of rain drop models from Modo and looking around for
 the best approach to get these models randomly placed in 3D on a geometry
 (the wind shield) as many as possible.


I wouldn't personally render rain drops with traditional geometry, rather
I'd try and create quads that are textured and using pixel shaders that do
motion blur and refraction effects that are required.  On the wind shield
rain drops are only briefly round and will quickly coalesce with other
drops and then run across the screen with gravity and wind effects, here
sphere's wouldn't appropriate at all.

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


Re: [osg-users] rendering millions of spheres

2013-12-02 Thread Trajce Nikolov NICK
Hi Robert,

you are right, and probably that is the best approach. How would you
approach the coalescing of drops? I am aware of papers of properly doing
it as well. However, I took the fastest approach :-) ... Tried that in Modo
based on some modeling tutorial and now trying to mimic it into real-time.
Don't care about the physic that much, and to make it accurate, just to
make it as soon as possible with some good visual.

In Modo it works in a way you model few drops and you morph them as they
run across the screen, and also the models are fired on the screen with
particle effect choosing random models and positions. This is what I am
trying to mimic. The results visually are great, and I can agree with you
it is not the best approach, but let see how far I get. At the moment I am
worrying only about performance. So for the first run I am to learn about
the techniques of instancing etc. that's why I have asked for the simple
case of rendering spheres, At the end I am not going to have spheres but
some other geometries, maybe even your suggested textured quads.

also want to ask the community, specially those with advanced GLSL skills,
if someone can rewrite the vertex program into GLSL example, please email me

Nick


On Mon, Dec 2, 2013 at 7:02 PM, Robert Osfield robert.osfi...@gmail.comwrote:

 Hi Nick,

 On 2 December 2013 15:18, Trajce Nikolov NICK 
 trajce.nikolov.n...@gmail.com wrote:

 I have to model rain drops on wind shield, and not aligned to screen but
 in 3d. I have set of rain drop models from Modo and looking around for
 the best approach to get these models randomly placed in 3D on a geometry
 (the wind shield) as many as possible.


 I wouldn't personally render rain drops with traditional geometry, rather
 I'd try and create quads that are textured and using pixel shaders that do
 motion blur and refraction effects that are required.  On the wind shield
 rain drops are only briefly round and will quickly coalesce with other
 drops and then run across the screen with gravity and wind effects, here
 sphere's wouldn't appropriate at all.

 Robert.

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




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


Re: [osg-users] rendering millions of spheres

2013-12-02 Thread Trajce Nikolov NICK
the vertex program from osgvertexprogram sample ;-) .. forgot to mention

Nick


On Mon, Dec 2, 2013 at 7:21 PM, Trajce Nikolov NICK 
trajce.nikolov.n...@gmail.com wrote:

 Hi Robert,

 you are right, and probably that is the best approach. How would you
 approach the coalescing of drops? I am aware of papers of properly doing
 it as well. However, I took the fastest approach :-) ... Tried that in Modo
 based on some modeling tutorial and now trying to mimic it into real-time.
 Don't care about the physic that much, and to make it accurate, just to
 make it as soon as possible with some good visual.

 In Modo it works in a way you model few drops and you morph them as they
 run across the screen, and also the models are fired on the screen with
 particle effect choosing random models and positions. This is what I am
 trying to mimic. The results visually are great, and I can agree with you
 it is not the best approach, but let see how far I get. At the moment I am
 worrying only about performance. So for the first run I am to learn about
 the techniques of instancing etc. that's why I have asked for the simple
 case of rendering spheres, At the end I am not going to have spheres but
 some other geometries, maybe even your suggested textured quads.

 also want to ask the community, specially those with advanced GLSL skills,
 if someone can rewrite the vertex program into GLSL example, please email me

 Nick


 On Mon, Dec 2, 2013 at 7:02 PM, Robert Osfield 
 robert.osfi...@gmail.comwrote:

 Hi Nick,

 On 2 December 2013 15:18, Trajce Nikolov NICK 
 trajce.nikolov.n...@gmail.com wrote:

 I have to model rain drops on wind shield, and not aligned to screen but
 in 3d. I have set of rain drop models from Modo and looking around for
 the best approach to get these models randomly placed in 3D on a geometry
 (the wind shield) as many as possible.


 I wouldn't personally render rain drops with traditional geometry, rather
 I'd try and create quads that are textured and using pixel shaders that do
 motion blur and refraction effects that are required.  On the wind shield
 rain drops are only briefly round and will quickly coalesce with other
 drops and then run across the screen with gravity and wind effects, here
 sphere's wouldn't appropriate at all.

 Robert.

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




 --
 trajce nikolov nick




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


Re: [osg-users] Compile error, DDS plugin, GL_RG_SNORM and GL_RED_SNORM

2013-12-02 Thread Paul Martz
Hey Robert -- If no one else has any strong feelings on this, then I'll
request you proceed to apply my Fixes for GL3 build as posted to
osg-submissions. (As time allows, of course.) Thanks!
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Compile error, DDS plugin, GL_RG_SNORM and GL_RED_SNORM

2013-12-02 Thread Robert Osfield
Hi Paul


On 2 December 2013 17:49, Paul Martz skewmat...@gmail.com wrote:

 Hey Robert -- If no one else has any strong feelings on this, then I'll
 request you proceed to apply my Fixes for GL3 build as posted to
 osg-submissions. (As time allows, of course.) Thanks!


I haven't had a chance to review your submission yet so will defer specific
comments for when I do the review.  For general information the symbols are
related to the texture_snorm extension:

  https://www.opengl.org/registry/specs/EXT/texture_snorm.txt

Like other extensions it should just be a case of adding a #ifndef #define
#endif block to the appropriate header and extension check on passing to
OpenGL.

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