PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

C-buffer

MirekCz forgot his pass.. · 17 Sep 2003, 14:21 UTC
Ok I have read a lot about it and.. looks nice

So I draw my world front to back and use c-buffer for z-buffering and clipping polygons to what's already drawn.. so I end up with no overdraw, quite fast rendering engine... but...
What to do with semi-transparent polygons? How do I put them into this scheme? It seems pretty much impossible for me to do it without losing the advantage c-buffer gives me...?:(
Any clues how to solve it? or maybe c-buffer is a no-no if you put alpha-blended polygons on screen?

Thanks for hints.
Thinking out loud:

How about deferring any spans that need alpha-blending to a post-processing stage? I.e. don't use them to clip spans behind them but flag a span as being "blended" - just shove them into a stack somewhere and deal with them after everything else has been plotted.

Because you're using the stack, the alpha pixels the furthest away will be processed first, which should give the desired result?
C-spans are used to determine how much of / if a poly span is visible. That's the important part. As refractor said, just clip your alpha spans to the c-spans then queue them for rendering after opaque spans. Don't forget that the alpha span should not modify the c-spans, since you want to render what is behind that span.

Dan East
MirekCz forgot his pass.. · 17 Sep 2003, 21:06 UTC
thnx for this help, looks pretty fine... althrought slow with larger amouns of transparent polygons...

PS.Dan, did you look at IE5.0 CODE problems already? thanks...
Not yet. I need to upload a test version to dexplor.com and see if that works. If it does then the problem is in the code wrapper and not the syntactic coloring.

Dan East
If you want full z-buffer emulation, use an s-buffer. Paul Nettle has a document on it somewhere (the s-buffer faq). Inserting spans is more expensive, but you don't have to pass them sorted to the buffer. This also means you draw the contents of the buffer once you have fed it all the spans.

BTW, completely off-topic, I just ordered a brand new 1915. My 3630 has a stuck key (cola rust), dust under the screen, the stylus doesn't stay in it's spot, the adapter is broken so I use a (too light) replacement adapter, the battery works for 30 minutes or so AND my new laptop does not have a parallel connector so I could use IR only. :) Does anyone know how much a collectors item like this device is worth on eBay? ;)
MirekCz forgot his pass.. · 18 Sep 2003, 18:21 UTC
yes I know about s-buffers, althrough tit looks pretty expensive and painfull at times. (small polys)

but one more question, what about the active edge solution used in quake1?
I have read some documents on them, althrought understood little from first reading, but it looks promising... anyone tryed?
My scene is partially similar to quakes as I can have a lot of back to front or front to back ordered polygons (possibly with z-write only) and then only animated objects are put on scene with z-check... it looks promisingly fast especially when used with a mixed color/z-buffer like the Pocketgl library does...
MirekCz, you're going to have to remember your password soon, because I talked to Chris and we're going to turn off anonymous posting for this forum.

Dan East
Mirez, download the "Games programming black book" by Michael Abrash - it was released as freeware in PDF format (or look for his other Quake related DDJ articles). That explains the process he went through implementing the Quake engine.

I think that the main "issue" he dealt with was that the polygons in the scene must be abutting (i.e. they must not interpenetrate).

If you can't find the pdfs online, give me a yell and I'll dig out and mail you the relevant chapters.
refractor wrote:
I think that the main "issue" he dealt with was that the polygons in the scene must be abutting (i.e. they must not interpenetrate).


...which you are guaranteed if you use a planar bsp. However entity polys are a whole different issue.

Dan East