Thanks for your replying, Radu, Robert. This is exactly what I want, except mine are a little bit more complicated. My target is: 1. Calculate the depth and normal in the first pass. 2. Do the lighting (separating the lighting from the first pass, because I may want to apply different lighting models according to user choice) 3. Do the anti-aliasing (sampling) or draw the silhouette. ( separating this from the previous, because this pass need to communicate with the neighbor pixels ) If I want to do the "first render to FBO" thing or "use the anti-aliasing at the driver level", which example can I use as a reference? BTW, is it possible to communicate with the neighbor pixels in GLSL I'm new to OSG and GLSL, and sorry for my poor English. And Thanks again. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Radu Mihai Sent: 2006?12?8? 0:35 To: osg users Subject: Re: [osg-users] mutipass shaders Hi Xiaoshuxing, Robert If I understand your intention, the sequence would be this: 1. render scene w/ lighting shader 2. re-render with aliasing shader In OSG you can get the result like this: 1. render scene w/ lighting shader : render to FBO with same resolution as the window 2. render to window with ortho projection onto a full-window quad, using the texture(FBO) results ( use anti-aliasing shader as an image processing shader) You can look at osgprerender, but instead of a flag, you use a simple quad (like in osghud). My opinion is to follow Robert's advice and use the anti-aliasing at the driver level, unless you want to do some custom operations, not just super[multi]sampling. The driver-based methods have the advantage of being heavily optimized by the driver developers, and no coding required :) -------------------------- Radu Mihai [EMAIL PROTECTED] On 7-Dec-06, at 8:01 AM, Robert Osfield wrote: > Hi Xiaoshuxing, > > Modern graphics hardware supports anti-aliasing without the need to do > it manually, you just need to set up the appropriate frame buffer > resources. Again there is no such thing as multi-pass shaders, there > are high level multi-pass techniques, but these are totally orthogonal > to shaders. > > Robert. > > On 12/7/06, xiaoshuxing <[EMAIL PROTECTED]> wrote: >> Thanks for your replying, Robert? >> I want to do the lighting in the first pass shader, and do the >> anti-aliasing in the second pass, since the anti-aliasing pass >> need to >> communicate with the neighbor pixels, so the anti-aliasing must be >> done in >> another pass after all the lighting have been done. >> >> "GLSL can have multiple shaders making up a single vertex/ >> fragment program >> but this isn't multi-pass shaders.", how do those multiple shaders >> in one >> program work together? They're working in the same pass? They are >> working >> parallel or one after another? >> >> Which of the examples in the OSG source code is about this >> topic? or where >> I can get any reference? >> >> Thanks in advance. >> >> -----Original Message----- >> From: [EMAIL PROTECTED] >> [mailto:[EMAIL PROTECTED] On Behalf Of Robert >> Osfield >> Sent: 2006?12?7? 17:40 >> To: osg users >> Subject: Re: [osg-users] mutipass shaders >> >> Hi Xiaoshuxing, >> >> What exactly do you mean by multi-pass shaders? >> >> The OSG support multi-pass, multi-stage rendering, and its support >> GLSL fully. GLSL can have multiple shaders making up a single >> vertex/fragment program but this isn't multi-pass shaders. >> >> Robert. >> >> On 12/7/06, xiaoshuxing <[EMAIL PROTECTED]> wrote: >> > >> > >> > >> > >> > Hi, everyone: >> > >> > Is there anyone here has used mutipass shaders in osg? >> > >> > Which of the osg examples has been talking about this? Or is >> there any >> else >> > examples about this? >> > >> > thanks >> > _______________________________________________ >> > osg-users mailing list >> > [email protected] >> > http://openscenegraph.net/mailman/listinfo/osg-users >> > http://www.openscenegraph.org/ >> > >> > >> _______________________________________________ >> osg-users mailing list >> [email protected] >> http://openscenegraph.net/mailman/listinfo/osg-users >> http://www.openscenegraph.org/ >> >> _______________________________________________ >> osg-users mailing list >> [email protected] >> http://openscenegraph.net/mailman/listinfo/osg-users >> http://www.openscenegraph.org/ >> > _______________________________________________ > osg-users mailing list > [email protected] > http://openscenegraph.net/mailman/listinfo/osg-users > http://www.openscenegraph.org/ _______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
_______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
