Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!ucbvax!comanche.omni.co!rpaul From: rpaul@comanche.omni.co (Rodian Paul) Newsgroups: comp.sys.sgi Subject: Re: bitplane planeing Message-ID: <9104291037.AA05539@comanche.omni.co> Date: 29 Apr 91 10:37:57 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 47 Dan Karron writes: > Is there any way to control the allocation of bit planes into OVERDRAW > mode ? I want to draw an intricate picture into the NORMALDRAW bitplanes, > then draw various processed pixels from that image on top of it into the > OVERDRAW mode bitplanes. I need at least as many bitplanes as in the > NORMALDRAW bitplanes (24 bits for my application). > > I want to be able to show how an image processing algorithm (a variant > edge detection) draws line with respect to its base image. > I'm pretty sure that the maximum no. of overlay planes on a VGX is 8 bits, and only 2 on a personal (but I may be wrong). However, I have some old code kicking around somewhere, where I was able to draw a 24bit picture into the Z-buffer of a personal, and still have 24bits left over for an image in NORMALDRAW planes. So in effect you can use the zbuffer planes for some kind of stencil (has Quantel got it's greedy paws on the "Alpha-Plane" in the US yet?) or matte. A couple of other considerations are in order when it comes to using the overlay planes. The first is that if your window is passed a REDRAW token you will call reshapeviewport(), and probably do a clear() and redraw your window. Normally the window manager takes care of cleaning up the position where your old window was located, however it doesn't handle the overlay planes. You just end up with junk in the overlay planes where your window used to be. A quick fix is to go into overdraw()/fullscrn() mode and perform a clear() and then reset the viewport afterwards. This isn't too considerate if more than 1 application is using the overlay planes. A more elegant approach is to set the scrnmask() to where your old window was when you enter fullscrn() mode, that way you are less likely to trash another application's overlay planes. Another trick that helps is to queue INPUTCHANGE and clear the overlay planes when the user moves out of your window, but that can have a disconcerting effect visually, depending on what you're drawing. Anyway, if you want a copy of the "zpic" code, gimme a yell and I'll dig it out. Cheers. ------------------------------------------------------------------------------- rpaul%crow@ccut.cc.u-tokyo.ac.jp phone: +81 (3) 5706-8357 ccut.cc.u-tokyo.ac.jp!crow!rpaul FAX: +81 (3) 5706-8437