On Tue, Sep 1, 2009 at 8:22 PM, Robert Bragg <[email protected]> wrote:

> On Tue, 2009-09-01 at 12:18 +0100, Neil Roberts wrote:
> > On Tue, 2009-09-01 at 01:01 +0000, jiangwei zhou wrote:
> >
> > >    we know that at present  the clutter's clipping is implemented in
> > > clip plane/stencil  buffer/Scissor.
> > >
> > >    using stencil buffer, we can implement  arbitrarily ploygonous
> > > clipping. it is one very common way to do the clipping in gles.
> > >
> > >    but now ,we have a new demand to implement the clipping without
> > > stencil buffer . because in our target the clipping based on stencil
> > > buffer is very slow, unacceptable.
> > >
> > >    we consider two ways. i hope other guys can give me some suggestion
> > > or new idear.
> > >
> > >     1. if  only rect clipping is considered,can i clip the actor in
> > > fragment shader?
> > >
> > >         the clip arear is in object coordinates, can i in fragment
> > > shader , convert the fragment coord point from clip coordinates to
> > > object coordiantes ,then using rect including algorthim to discard
> > > those not in the area?
> >
> > If the clip region is a rectangle, Cogl should already automatically use
> > glScissor (if possible) or the clip planes if it is not a screen
> > rectangle. I think the clip planes and scissor rect should be quite fast
> > so there probably isn't any benefit to using a fragment shader in this
> > case.
> To say a bit more here; it's not only cogl_clip_push_window_rect() that
> will use glScissor. Even if you use cogl_clip_push() cogl will look at
> the modelview matrix to see if it represents an axis aligned rectangle
> and use glScissor when possible. Multiple rectangular clip regions may
> be pushed on to the clip stack, and the glScissor rectangle will
> correspond to their intersection.
>
> regards,
> - Robert
>
> --
> Robert Bragg, Intel Open Source Technology Center
>
>

hi, robert.
thanks.
glScissor is used for  window clipping, but i know it is only used for 2D
clipping.
just to restrict render in one screen rect .
but when the actor rotate in 3D space, it seems not correct,right?
when the actor rotate in 3D space, even the clipping is rect, but in sceen
coordinate , it cannot be clipped by
glScissor.

i just want to find other solution to do clipping without stencil buffer.


regards.










> --
> To unsubscribe send a mail to 
> [email protected]<clutter%[email protected]>
>
>

Reply via email to