Decals with projected textures again??

New Message Reply Date view Thread view Subject view Author view

Robert Webb (robertw++at++wormald.COM.AU)
Wed, 19 Jul 1995 16:24:10 +1000 (EST)


Hello again,

I am following up my own posting because I have found out what the problem
was, but I still don't know how to fix it.

I wrote:

> I have been working on something that uses a projected texture type of idea
> for quite a while now. It requires pfDraw() to be called twice in each
> frame. Now I've got it all kind of working except for co-planar polygons
> (and multiprocessing because changing the draw-mask doesn't seem to be
> having any effect, but that's another problem!).
>
> The first call to pfDraw() is really just there to get the zbuffer right,
> and the second call is done using zfunction(ZF_EQUAL). Now for geometry
> drawn with pfDecal() I have a problem.
>
> If I use PFDECAL_BASE_DISPLACE, then the laters do not appear at all. What
> I would expect to be happening is this:
>
> - First call to pfDraw():
> - Base geometry is drawn, with z=1 say.
> - displacepolygon() is called.
> - Layer geometry is draw, with z=1, but displacepolygon() offsets
> this and makes it, say, z=2 instead (this avoids "Z-flickering").
> - zfunction(ZF_EQUAL) is called.
> - Second call to pfDraw():
> - Base geometry is drawn, with z=1, exactly overwriting what was
> there before, but leaving blank the sections where the layer
> geometry was drawn (since here z==2).
> - displacepolygon() is called.
> - Layer geometry is draw, with z=1, but displacepolygon() offsets
> this and makes it z=2 instead, exactly overwriting what was
> previously rendered by the layer geometry.
>
> However this is not what happens, since I do not see my layers at all. In
> fact the base is rendered as if the layers were never drawn.

Using gldebug, I have discovered that the decal layers in a pfLayer node are
drawn using zwritemask(0x0). This is usually fine, but makes it impossible
to do what I wanted to do above (or the standard projected texture
algorithm) as the ZF_EQUAL pass will fail for this geometry. All I need to
do now is stop the call to zwritemask(0x0), but HOW? There is no way to
pfOverride it.

The only solution I can think of (which I DON'T like the idea of), is to
change all the pfLayer nodes to pfGroup nodes and add call-backs to handle
the decaling myself. There must be a better way!?!?!?

Rob :-/

------------------------------------------------------------------------------
 _
|_) _ |_ _ ._ _|_ \ / _ |_ |_ robertw++at++wormald.com.au
| \(_)|_)(/_| |_ \/\/ (/_|_)|_)o

"Informer, you no say daddy me Snow me I'll go blame, a licky boom boom down"
                                                                - Snow.

------------------------------------------------------------------------------


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:51:41 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.