On Thu, 9 Mar 2000 [EMAIL PROTECTED] wrote:
> Hi !
>
> > > 2. a Z-Buffer, stencil-buffer or windowID-buffer. That is with 2. you can
> > > decide for every pixel, if it can be drawn to or not.
> >
> > 3. Alpha/Colorkey/transparency. You can decide for every pixel, but based
> > on pixel value, not coordinates.
>
> This is basically equivalent when being used for clipping purposes.
> There are two possible modes of operation for it:
> a) the key value is associated with the pixels that are already present in
> Video RAM. In that case, you can just treat it like an ordinary stencil buffer.
> b) the key value is associated with the pixels that are to be blitted. In
> that case it resembles the "backbuffer" method I outline below.
Yes, this is correct.
> > You should define functions to establish clipping settings,
> > however they may be defined, and let the target code decide how to
> > accelerate the clipping operations.
>
> Can you give an example for these functions ?
SetClipRegion(vis, clip_region_descriptior)?
> I can see need for:
> - rectangles (simple windowing)
> - multiple rectangles (stacked windows)
> - free shapes (shaped windows etc.)
Probably all these can be handled by assuming a 1bpp stencil mask
which can be associated with a visual in memory. This can be software
accelerated with or without a DirectBuffer mapping, or it can be logically
decomposed into a representational form suitable for any type of hardware
acceleration. Higher-level linked lists of pointers to the per-visual
stencil mask buffers could be build for use by e.g. LibGWT, and all you
have to do is construct the logical intersection of all the stencil masks
according to whatever rules you want (transparency, zheight, etc). Also
easy to hardware accelerate, since LibGWT can retarget directly to a
STREAMS window ID or SGI hardware viewports.
> I am not convinced, that polygons or worse curved borders of clipping regions
> are used much, and thus I propose to handle them using the free-shapes method.
Any clipping shapes at all can be handled with a 1bpp stencil
mask.
> And due to common availability in hardware, I'd even consider that method for
> multiple rectangles.
Any type of hardware clipping can be efficiently accelerated by
the stenclim mask method.
> This is of course another story for 3D, where something like a 3D stencilbuffer
> is infeasible.
GL supports at least six 3D clipping planes, which allow you to
clip to any volume. And you can use a z buffer to clip by writing values
into it directly, although not on all hardware.
Jon
---
'Cloning and the reprogramming of DNA is the first serious step in
becoming one with God.'
- Scientist G. Richard Seed