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.

Also as far as I understand, using 'discard' on a lot of GLES2 hardware
is not recommended so it may even end up slower than the stencil buffer.

Regards,
- Neil

-- 
To unsubscribe send a mail to clutter+unsubscr...@o-hand.com

Reply via email to