Angus Dorbie (angus++at++division.demon.co.uk)
Thu, 16 Feb 1995 16:16:14 +0000
There is a zbuffering decal technique which can be used on machines without
stencil planes or the displace polygon facility. It could work with your roads
provided your database is suitably constructed. This is another trick from an
ancient issue of IRIS Universe, I forget the issue and author, again. I think
it was called "Zbuffer Magic", or something.
3 simple steps for zbuffer decals:
1) draw the ground polygons of interest to the framebuffer with a complete
zbuffer mask applied so that depth isn't written to the zbuffer. Remember that
you are still performing a zbuffer test against existing scene geometry.
2) draw the road (the decal) with or without zbuffer writes enabled, it makes
little difference. You still have to keep zbuffer testing enabled.
3) redraw the ground polygons with zbuffer writes enabled but with colour
buffer writes disabled. Again, zbuffer testing is on.
Hey presto!
There is an obvious performance penalty but the other disadvantage is that you
have to be selective about the ground polygons you decal to, both for
performance reasons and because you may want some parts of the ground to
occlude the road. Appart from these caveats this technique should work
perfectly in zbuffered scenes irrespective of when it is used. Various bits of
decaled ground even occlude each other correctly if you draw them separately.
Obviously this trick isn't limited to terrain & roads.
Have fun,
-- Angus Dorbie Division Ltd, Software Engineer 19 Apex Court, Tel: (01454)615554 Woodlands, Fax: (01454)615532 Bristol BS12 4JT, angus++at++division.demon.co.uk UK
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:50:57 PDT