Hi Robert, Robert Osfield a écrit : > Hi Fred, > > On Sat, Dec 13, 2008 at 4:02 PM, Frederic Bouvier <[email protected]> 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 [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

