Hi Robert,

Thanks to your suggestion we came up with an other solution. Since we already 
were updating our slices with a shader we just added some constraints for the 
fragements close to the box to achieve soft clipping. 
Now it looks very good.

Thank you very much!

//AK and Lotta
  

-----Ursprungligt meddelande-----
Från: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] För Robert Osfield
Skickat: den 24 oktober 2006 10:00
Till: osg users
Ämne: Re: [osg-users] Get rid of sharp edges between transparent 
andsolidobjects?

Hi Charlotta,

Do the slices know the goemetry of the box?  If so then I'd tesselate the 
slices so that there is a border within it where you gradate the alpha value of 
the colour of the texture slice.  This needn't require shaders to do as it 
could be done with prep of the geometry of the slices.  Alternatively you could 
you multi-texturing to do a blend.

Things get more complicated of you when the alpha value to be related to the 
depth, such as doing a fog, using a depth texture would allow you to do this.

Robert.

On 10/24/06, Charlotta Wadman <[EMAIL PROTECTED]> wrote:
> Hi
>
> Here is a screenshot.
> http://www.student.itn.liu.se/~annca229/sharpedges.png
>
> We think we might have a solution that we found in a paper. The paper suggest 
> this:
> 1. Render all solid objects in the scene.
> 2. Copy the depth values from the frame buffer to a depth texture.
> 3. Render particles (or in our case transparent slices) back-to-front with a 
> pixel shader that reads the depth values from the depth texture.
>    The shader lowers the fragment's alpha as necessary value to achieve soft 
> clipping.
>
> Our problem is that we don't know how to do the second step.
> Any suggestions or other ideas?
>
> //AK and Lotta
>
> -----Ursprungligt meddelande-----
> Från: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] För Robert Osfield
> Skickat: den 23 oktober 2006 17:06
> Till: osg users
> Ämne: Re: [osg-users] Get rid of sharp edges between transparent and 
> solidobjects?
>
> Hi Charlotta,
>
> Could you post screenshot?
>
> Robert.
>
> On 10/18/06, Charlotta Wadman <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> > Hi!
> >
> > We have a blending problem with sharp edges between transparent 
> > textureslices and a solid box.
> > We use shaders for the textureslices. The blending mode for the 
> > slices is set to:
> >
> > osg::BlendFunc* bf = new osg::BlendFunc; bf -> 
> > setFunction(osg::BlendFunc::SRC_ALPHA,
> > osg::BlendFunc::ONE_MINUS_SRC_ALPHA);
> >
> > We have also set the renderingHint to transparent bin.
> >
> > The textureslices blends together correctly but how do we get rid of 
> > the edges between the textureslices and the box?
> >
> > Grateful for any help.
> >
> > //Lotta and AK
> > _______________________________________________
> > 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/

Reply via email to