Re: [osg-users] Precipitation effect coming too fast, and hiding on some areas

2008-12-19 Thread Robert Osfield
Hi Fred and Jefferson,

On Thu, Dec 18, 2008 at 8:39 AM,  fredlis...@free.fr wrote:
 Unfortunately, it doesn't seem to work ( at least for me ). I modified the 
 osgprecipitation example to add a simple clip plane, and although the model 
 is clipped, the rain continues to appear in the half space clipped.

 Attached the modified example.

I tested the modified example and it didn't function for a number of reasons..

First up the clipping plane has to be placed in eye coordinates and
osg::ClipNode didn't provide an option for placing it in an absolute
reference frame (an absolute/identity view matrix puts you in eye
coords) so I went ahead an added this to osg::ClipNode, so there now
is a ClipNode::setReferenceFrame(RefernceFrame) method along the same
lines as the same method in osg::LightSource, osg::TexGenNode and
osg::Camera (all instance have the same menaning.)

The next problem was that ClipNode was decorating the whole scene, not
just the precipitation effect so I restructed the example.  So it now
looks like (note the setReferenceFrame and CliPlane in eye coords) :

osg::ref_ptrosg::Group group = new osg::Group;

if (clipDistance!=0.0)
{
osg::ref_ptrosg::ClipNode clipNode = new osg::ClipNode;
clipNode-addClipPlane( new osg::ClipPlane( 0 ) );
clipNode-getClipPlane(0)-setClipPlane( 0.0, 0.0, -1.0,
-clipDistance );
clipNode-setReferenceFrame(osg::ClipNode::ABSOLUTE_RF);
clipNode-addChild(precipitationEffect.get());

group-addChild(clipNode.get());
}
else
{
group-addChild(precipitationEffect.get());
}

group-addChild(loadedModel.get());

The osgprecitpitation example also now has a --clip distance command
line option to allow us to enable the above optional code path.  Try
values like 10 or 20 when loading the standard test example lz.osg.

Once this was all in place the precipitation effect still wasn't being
clipped, so I investigated user defined clipping plane and GLSL and
found that we need to explicitly set the gl_ClipVertex variable the
vertex shader.  Adding this fixed the clipping problem and hey presto
we can clip the precipitation effect and not the scene.

All these changes are now checked into svn/trunk and will be part of
the up coming 2.7.8 dev release.

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


Re: [osg-users] Precipitation effect coming too fast, and hiding on some areas

2008-12-18 Thread fredlist01
Hi Robert  Jefferson,

- Jefferson Pinheiro a écrit :
 
 2) Use an osg::ClipPlane to clip the precipitation effect. Using a
 clip plan would also allow you to control angle of the clipping.
 
 I don't know how to use that (I'm a beginner). Fred, I would be
 grateful if you could share your code, if you do it.

Unfortunately, it doesn't seem to work ( at least for me ). I modified the 
osgprecipitation example to add a simple clip plane, and although the model is 
clipped, the rain continues to appear in the half space clipped.

Attached the modified example.

-Fred
/* OpenSceneGraph example, osgprecipitation.
*
*  Permission is hereby granted, free of charge, to any person obtaining a copy
*  of this software and associated documentation files (the Software), to deal
*  in the Software without restriction, including without limitation the rights
*  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
*  copies of the Software, and to permit persons to whom the Software is
*  furnished to do so, subject to the following conditions:
*
*  THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
*  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
*  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
*  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
*  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
*  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
*  THE SOFTWARE.
*/

#include osgDB/ReadFile
#include osgDB/FileUtils
#include osgUtil/Optimizer
#include osgUtil/CullVisitor
#include osgViewer/Viewer
#include osg/ClipNode

#include osg/MatrixTransform
#include osgUtil/TransformCallback
#include osgParticle/PrecipitationEffect

#include iostream

class MyGustCallback : public osg::NodeCallback
{

public:

MyGustCallback() {}

virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
{
osgParticle::PrecipitationEffect* pe = 
dynamic_castosgParticle::PrecipitationEffect*(node);

float value = sin(nv-getFrameStamp()-getSimulationTime());
if (value-0.5)
{
pe-snow(1.0);
}
else
{
pe-rain(0.5);
}

traverse(node, nv);
}
};


int main( int argc, char **argv )
{

// use an ArgumentParser object to manage the program arguments.
osg::ArgumentParser arguments(argc,argv);

// set up the usage document, in case we need to print out how to use this 
program.

arguments.getApplicationUsage()-setApplicationName(arguments.getApplicationName());

arguments.getApplicationUsage()-setDescription(arguments.getApplicationName()+
 example provides an interactive viewer for visualising point clouds..);

arguments.getApplicationUsage()-setCommandLineUsage(arguments.getApplicationName()+
 [options] filename ...);
arguments.getApplicationUsage()-addCommandLineOption(-h or 
--help,Display this information);
arguments.getApplicationUsage()-addCommandLineOption(--snow 
density,Set the snow with a density between 0 and 1.0);
arguments.getApplicationUsage()-addCommandLineOption(--rain 
density,);
arguments.getApplicationUsage()-addCommandLineOption(--particleSize 
size,);
arguments.getApplicationUsage()-addCommandLineOption(--particleColour 
red green blue alpha,);
arguments.getApplicationUsage()-addCommandLineOption(--wind x y 
z,Set the wind speed in model coordinates);
arguments.getApplicationUsage()-addCommandLineOption(--particleSpeed 
float,Set the particle speed);
arguments.getApplicationUsage()-addCommandLineOption(--nearTransition 
distance,Set the near transistion distance);
arguments.getApplicationUsage()-addCommandLineOption(--farTransition  
distance,Set the far transistion distance);
arguments.getApplicationUsage()-addCommandLineOption(--particleDensity 
density,Set the particle density);
arguments.getApplicationUsage()-addCommandLineOption(--cellSize x y 
z,Set the cell size in model coordinates);
arguments.getApplicationUsage()-addCommandLineOption(--fogDensity 
density,Set the fog density);
arguments.getApplicationUsage()-addCommandLineOption(--fogColour red 
green blue alpha,Set fog colour.);

arguments.getApplicationUsage()-addCommandLineOption(-useFarLineSegments,Switch
 on the use of line segments);


// construct the viewer.
osgViewer::Viewer viewer;

osg::ref_ptrosgParticle::PrecipitationEffect precipitationEffect = new 
osgParticle::PrecipitationEffect;

float intensity;
while (arguments.read(--snow, intensity)) 
precipitationEffect-snow(intensity);
while (arguments.read(--rain, intensity)) 
precipitationEffect-rain(intensity);

float value;
while (arguments.read(--particleSize, value)) 
precipitationEffect-setParticleSize(value);


Re: [osg-users] Precipitation effect coming too fast, and hiding on some areas

2008-12-17 Thread Jefferson Pinheiro
Hi Robert,

On Mon, Dec 15, 2008 at 7:55 AM, Robert Osfield robert.osfi...@gmail.comwrote:

 Hi Fred  Jefferson,

 On Sun, Dec 14, 2008 at 10:49 AM, Frederic Bouvier fredlis...@free.fr
 wrote:
  I have a patch to PrecipitationEffect that seems to work. I'll submit it
  to osg-submissions

 I've just done a review of these changes and don't feel that there are
 mostr straightforward and effecient way to implement what is
 effectively near plan clipping.  The code will make the vertex program
 slower, and not cut down on rasteristation and fill load.

 I feel a better route would be to either:

 1) use two Camera's to depth partition the scene as suggested earlier
 in this thread, as this would give you control over the worlds depth
 range where the precipitation exists


This one works!



 2) Use an osg::ClipPlane to clip the precipitation effect.  Using a
 clip plan would also allow you to control angle of the clipping.


I don't know how to use that (I'm a beginner). Fred, I would be grateful if
you could share your code, if you do it.



 Neither the above routes require any changes to the core OSG, and both
 would not affect the vertex program load, and would clip out fragment
 so would cut down the fragment program load so would be more efficient
 than the submitted fix.

 Could you test out the above suggestions?

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




-- 
Jefferson Pinheiro
(51) 9192 3535
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Precipitation effect coming too fast, and hiding on some areas

2008-12-15 Thread Robert Osfield
Hi Laurent,

On Mon, Dec 15, 2008 at 10:18 AM, Laurent Di Cesare
laurent.dices...@masagroup.net wrote:
 In my application, rain inside buildings is problematic if people enter the
 buildings (which they weren't supposed to do until recently). A clip plane
 method might work better than a near/far/depth partition.

Using the stencil buffer for non planer clipping of fragments would
work in the case of buildings.   Or just switch the effect off but
this would only be fine if you didn't look out of a window.

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


Re: [osg-users] Precipitation effect coming too fast, and hiding on some areas

2008-12-15 Thread fredlist01
Hi Robert,

- Robert Osfield a écrit :

 Hi Fred  Jefferson,
 
 On Sun, Dec 14, 2008 at 10:49 AM, Frederic Bouvier
 fredlis...@free.fr wrote:
  I have a patch to PrecipitationEffect that seems to work. I'll
 submit it
  to osg-submissions
 
 I've just done a review of these changes and don't feel that there
 are
 mostr straightforward and effecient way to implement what is
 effectively near plan clipping.  The code will make the vertex
 program
 slower, and not cut down on rasteristation and fill load.
 
 I feel a better route would be to either:
 
 1) use two Camera's to depth partition the scene as suggested earlier
 in this thread, as this would give you control over the worlds depth
 range where the precipitation exists
 
 2) Use an osg::ClipPlane to clip the precipitation effect.  Using a
 clip plan would also allow you to control angle of the clipping.
 
 Neither the above routes require any changes to the core OSG, and
 both
 would not affect the vertex program load, and would clip out fragment
 so would cut down the fragment program load so would be more
 efficient
 than the submitted fix.
 
 Could you test out the above suggestions?

I will test the osg::ClipPlane route. I don't feel confortable to take 
the depth partitioning route at this moment, and we already use this 
technique for other purpose in FlightGear, that may conflict with that.
For the moment, the transition distance between the near camera and the 
far camera is too far away to be useful for this purpose.

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


Re: [osg-users] Precipitation effect coming too fast, and hiding on some areas

2008-12-15 Thread Laurent Di Cesare

Robert Osfield wrote :

Hi Fred  Jefferson,

On Sun, Dec 14, 2008 at 10:49 AM, Frederic Bouvier fredlis...@free.fr wrote:
  

I have a patch to PrecipitationEffect that seems to work. I'll submit it
to osg-submissions



I've just done a review of these changes and don't feel that there are
mostr straightforward and effecient way to implement what is
effectively near plan clipping.  The code will make the vertex program
slower, and not cut down on rasteristation and fill load.

I feel a better route would be to either:

1) use two Camera's to depth partition the scene as suggested earlier
in this thread, as this would give you control over the worlds depth
range where the precipitation exists

2) Use an osg::ClipPlane to clip the precipitation effect.  Using a
clip plan would also allow you to control angle of the clipping.
  
In my application, rain inside buildings is problematic if people enter 
the buildings (which they weren't supposed to do until recently). A clip 
plane method might work better than a near/far/depth partition. However, 
even with such a solution, I'd still end up with rain visible in some 
buildings (depending on where the user places the camera).
I'm sorry I'm not being very productive, because I have little to 
provide in terms of solutions, but I want to point out that a partial 
solution to the issue which slows down the shader, as Robert says, 
doesn't look like a good solution.


Laurent.

Neither the above routes require any changes to the core OSG, and both
would not affect the vertex program load, and would clip out fragment
so would cut down the fragment program load so would be more efficient
than the submitted fix.

Could you test out the above suggestions?

Thanks,
Robert.
___
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] Precipitation effect coming too fast, and hiding on some areas

2008-12-15 Thread Robert Osfield
Hi Fred  Jefferson,

On Sun, Dec 14, 2008 at 10:49 AM, Frederic Bouvier fredlis...@free.fr wrote:
 I have a patch to PrecipitationEffect that seems to work. I'll submit it
 to osg-submissions

I've just done a review of these changes and don't feel that there are
mostr straightforward and effecient way to implement what is
effectively near plan clipping.  The code will make the vertex program
slower, and not cut down on rasteristation and fill load.

I feel a better route would be to either:

1) use two Camera's to depth partition the scene as suggested earlier
in this thread, as this would give you control over the worlds depth
range where the precipitation exists

2) Use an osg::ClipPlane to clip the precipitation effect.  Using a
clip plan would also allow you to control angle of the clipping.

Neither the above routes require any changes to the core OSG, and both
would not affect the vertex program load, and would clip out fragment
so would cut down the fragment program load so would be more efficient
than the submitted fix.

Could you test out the above suggestions?

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


Re: [osg-users] Precipitation effect coming too fast, and hiding on some areas

2008-12-14 Thread Joakim Simonsson


Hi Fred,

On Sat, 13 Dec 2008 17:02:38 +0100, Frederic Bouvier fredlis...@free.fr  
wrote:



If you want to see this funny effect in action, watch this video
http://www.vimeo.com/2511328 ( move forward to 5:00 )


Very nice vid. But besides from raining inside the plane, it seems that  
the rain particles are too vertical - like the particles have a  
transform that follows the camera. Hmm.. I don't know, but you would  
expect horizontal rain at high speeds. I managed to get horizontal rain  
with the osg's precepitation effect.


But maybe vertical rain is your intent?



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


Re: [osg-users] Precipitation effect coming too fast, and hiding on some areas

2008-12-14 Thread Robert Osfield
HI Joakim  Fred,

I noticed the same vertical rain artifact.
osgParticle::PreciptiationEffect will normally fall vertically but
when the camera moves it will appear with the correct motion, so it
looks like the effect is moving with the camera with this usage,
normally the effect would be move with the world, not the camera.

Robert.

On Sun, Dec 14, 2008 at 9:47 AM, Joakim Simonsson joa...@autosim.no wrote:

 Hi Fred,

 On Sat, 13 Dec 2008 17:02:38 +0100, Frederic Bouvier fredlis...@free.fr
 wrote:

 If you want to see this funny effect in action, watch this video
 http://www.vimeo.com/2511328 ( move forward to 5:00 )

 Very nice vid. But besides from raining inside the plane, it seems that the
 rain particles are too vertical - like the particles have a transform that
 follows the camera. Hmm.. I don't know, but you would expect horizontal rain
 at high speeds. I managed to get horizontal rain with the osg's
 precepitation effect.

 But maybe vertical rain is your intent?



 --
 Joakim Simonsson
 ___
 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] Precipitation effect coming too fast, and hiding on some areas

2008-12-14 Thread Frederic Bouvier
Hi Robert,

Robert Osfield a écrit :
 Hi Fred,

 On Sat, Dec 13, 2008 at 4:02 PM, Frederic Bouvier fredlis...@free.fr wrote:
   
 The same problem affect FlightGear too : it rains into the cockpit.
 Would it be possible to kill a particle when it comes under a certain
 distance from the viewer ?

 If you want to see this funny effect in action, watch this video
 http://www.vimeo.com/2511328 ( move forward to 5:00 )
 

 The particle positions are generated down in the vertex program, so to
 cull based on position them you'd need to add logic into the vertex
 program to modify the alpha value to 0.0 to make it disappear.   It's
 worth mentioning you can't cull vertices and associated primitives
 with a vertex program as it's strictly one vertex one vertex out.  You
 could use a geometry shader to cull, or a fragment shader.
   

Thank you for pointing out the direction to take.

 A simpler route would be to use the stencil buffer to clip out the
 fragment where you don't want rain.
   

I don't think it will work because we want to see rain through the
windshield but we don't want to see droplets or
snowflakes in front of it.

 Another route would be to drawn the scene in two passes, first draw
 the terrain and precipitation effect, then draw the cockpit.   Using
 such an approach would allow you to depth partition the scene and get
 better depth precision for the two parts of the scene.  Personally
 this would be the route I'd take.
   

Same problem here. Snowflakes in front of the windshield will not be erased.

I have a patch to PrecipitationEffect that seems to work. I'll submit it
to osg-submissions

-Fred

-- 
Frédéric Bouvier
http://my.fotolia.com/frfoto/   Photo gallery
http://fgsd.sourceforge.net/FlightGear Scenery Designer

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


Re: [osg-users] Precipitation effect coming too fast, and hiding on some areas

2008-12-13 Thread Frederic Bouvier
Jumping into the thread,

Robert Osfield a écrit :
 Second question
 It also rains inside my car. I tried adding a node mask for that, but it
 didn't seem to work. Is it possible not to make it rain inside the cars
 (which are on a separete osg::Group)?
 

 PrecipitationEffect doesn't have an support itself for constraining
 the effect to appear inside/outside specified geometries.

 The best thing you could do would be to either try using the stencil
 buffer to prevent the fragments of the effect being rendered where you
 don't want them.
   

The same problem affect FlightGear too : it rains into the cockpit.
Would it be possible to kill a particle when it comes under a certain
distance from the viewer ?

If you want to see this funny effect in action, watch this video
http://www.vimeo.com/2511328 ( move forward to 5:00 )

-Fred

-- 
Frédéric Bouvier
http://my.fotolia.com/frfoto/   Photo gallery
http://fgsd.sourceforge.net/FlightGear Scenery Designer

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


Re: [osg-users] Precipitation effect coming too fast, and hiding on some areas

2008-12-13 Thread Ümit Uzun
I think there is a big hole somewhere on the cocpit's ceiling :P

2008/12/13 Frederic Bouvier fredlis...@free.fr

 Jumping into the thread,

 Robert Osfield a écrit :
  Second question
  It also rains inside my car. I tried adding a node mask for that, but it
  didn't seem to work. Is it possible not to make it rain inside the cars
  (which are on a separete osg::Group)?
 
 
  PrecipitationEffect doesn't have an support itself for constraining
  the effect to appear inside/outside specified geometries.
 
  The best thing you could do would be to either try using the stencil
  buffer to prevent the fragments of the effect being rendered where you
  don't want them.
 

 The same problem affect FlightGear too : it rains into the cockpit.
 Would it be possible to kill a particle when it comes under a certain
 distance from the viewer ?

 If you want to see this funny effect in action, watch this video
 http://www.vimeo.com/2511328 ( move forward to 5:00 )

 -Fred

 --
 Frédéric Bouvier
 http://my.fotolia.com/frfoto/   Photo gallery
 http://fgsd.sourceforge.net/FlightGear Scenery Designer

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




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


Re: [osg-users] Precipitation effect coming too fast, and hiding on some areas

2008-12-13 Thread Robert Osfield
Hi Fred,

On Sat, Dec 13, 2008 at 4:02 PM, Frederic Bouvier fredlis...@free.fr wrote:
 The same problem affect FlightGear too : it rains into the cockpit.
 Would it be possible to kill a particle when it comes under a certain
 distance from the viewer ?

 If you want to see this funny effect in action, watch this video
 http://www.vimeo.com/2511328 ( move forward to 5:00 )

The particle positions are generated down in the vertex program, so to
cull based on position them you'd need to add logic into the vertex
program to modify the alpha value to 0.0 to make it disappear.   It's
worth mentioning you can't cull vertices and associated primitives
with a vertex program as it's strictly one vertex one vertex out.  You
could use a geometry shader to cull, or a fragment shader.

A simpler route would be to use the stencil buffer to clip out the
fragment where you don't want rain.

Another route would be to drawn the scene in two passes, first draw
the terrain and precipitation effect, then draw the cockpit.   Using
such an approach would allow you to depth partition the scene and get
better depth precision for the two parts of the scene.  Personally
this would be the route I'd take.

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


[osg-users] Precipitation effect coming too fast, and hiding on some areas

2008-12-12 Thread Jefferson Pinheiro
I'm working on a driving project on OSG, and now I am making it rain. I
added a precipitation effect for that. My scale is 1 unit = 1 cm.

*First question:*
When my car runs just a bit (say, 5 km/h), the rain comes at my face as
though I was running at 200 km/h. And if I run faster than 20 km/h or so,
the rain bacomes glitchy (looks like it's snowing, too).

How do I change the speed at which the rain comes?

*Second question*
It also rains inside my car. I tried adding a node mask for that, but it
didn't seem to work. Is it possible not to make it rain inside the cars
(which are on a separete osg::Group)?

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


Re: [osg-users] Precipitation effect coming too fast, and hiding on some areas

2008-12-12 Thread Jefferson Pinheiro
Hi Robert,

On Fri, Dec 12, 2008 at 2:26 PM, Robert Osfield robert.osfi...@gmail.comwrote:

 Hi Jefferson,

 On Fri, Dec 12, 2008 at 3:56 PM, Jefferson Pinheiro
 jeffersonmpinhe...@gmail.com wrote:
  I'm working on a driving project on OSG, and now I am making it rain. I
  added a precipitation effect for that. My scale is 1 unit = 1 cm.
 
  First question:
  When my car runs just a bit (say, 5 km/h), the rain comes at my face as
  though I was running at 200 km/h. And if I run faster than 20 km/h or so,
  the rain bacomes glitchy (looks like it's snowing, too).

 Shudder.  Why or why would you have such a scale?  Can't you just have
 a sensible scale like 1 unit = 1m?


Even so,  my colleague's project is on that scale and the same thing
happens.



 I you really must have such as scale then try putting a scale above
 the PrecipitationEffect.


setParticleSize? I tried increasing that, and big values causes the rain to
look like snow; lower values makes it look normal or too small.
Or adding a matrix transform and scale matrix? That didn't seem to work,
either.



  How do I change the speed at which the rain comes?

 Have you looked at the API?


I tried several combinations of setParticleSpeed, wind and cell size, the
problem persisting.

Is it possible to just disable the effect of rain coming at your face when
the camera moves forward?



  Second question
  It also rains inside my car. I tried adding a node mask for that, but it
  didn't seem to work. Is it possible not to make it rain inside the cars
  (which are on a separete osg::Group)?

 PrecipitationEffect doesn't have an support itself for constraining
 the effect to appear inside/outside specified geometries.

 The best thing you could do would be to either try using the stencil
 buffer to prevent the fragments of the effect being rendered where you
 don't want them.


Thanks, I'll take a look at that.



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




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