Ok, I will try to exclude some bricks when I am in a tunnel for testing, thank 
you Robert.


-----Message d'origine-----
De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la part de Robert Osfield
Envoyé : lundi 6 octobre 2008 12:08
À : OpenSceneGraph Users
Objet : Re: [osg-users] PrecipitationEffect how to catch and modifyparticles

Hi Matthieu,

Switching the effect off under terrain is not straight forward as the
effect is achieved by creating a repeating regular grid of bricks of
particles.  Each brick is actually just a single geometry that the
shader uses coord data to position in its final place.  This technique
provides the means for an effectively infinite number of particles.
The draw back is that you can't easily tailor the pattern of
precipitation.

Possible routes for tailoring the precipitation pattern would be to
modify the technique so that is only placed bricks where you wanted
them, or excluded them for regions you define.   This could provide a
course grained exclusion, further on from this you could possible come
up with individually sculpted bricks that have the particle line
segment end at a desired position.  This is not a trivial
modification, but should be possible.

The other route you could possible take is to just switch off the
precipitiation effect completely when the viewpoint goes inside the
tunnel.

Finally you might be able to use the stencil buffer to switch off the
writing of particle fragments inside the region of interest.

Robert.





On Mon, Oct 6, 2008 at 10:41 AM, Matthieu DIRRENBERGER
<[EMAIL PROTECTED]> wrote:
> Hello,
>
>
>
> I am using osgParticle::PrecipitationEffect to add snow or rain on my scene.
>
> I am looking at a way to determine for each particle, if z position is under
> the terrain or not.
>
> The objective is, when a particle is under an object or in a tunnel it
> should not be visible...
>
>
>
> In a first time I saw ParticleSystemUpdater but I don't know if it can work
> with PrecipitationEffect...
>
> I thought about a shader to do that, but I think I can do that simply with
> the accept/traverse methods.
>
> I suppose I must implement a callback method, called by the visitor, but I
> don't understand how to implement that visitor with PrecipitationEffect.
>
>
>
> Can you give me some help?
>
>
>
> Thanks a lot.
>
>
>
> Regards,
>
> Matthieu.
>
>
>
> _______________________________________________
> 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
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to