Bugs in pfflt11

New Message Reply Date view Thread view Subject view Author view

Ran Yakir (rany++at++bvr.co.il)
Sun, 31 Jul 1994 10:21:21 +0000


Hi All,

More bugs in pfflt11.
If you tried to use LoadFlt11 from libpfsgi, you might have noticed that
polygons with RGBA or INTA textures, tend not to be drawn, Thought the texture
is loaded with exactly the same params as in the FLT12 and FLT14 loaders.
It turns out that the old pfflt11 source does not set alpha value for polygons
that have no material attached and use color per primitive. when the texture is
RGB or INT, Performer will turn transparency off before entering the Geo-Set,
so the GL couldn;t care less. However, when the texture is RGBA or INTA,
Performer will turn transparency on before the Geo-Set is drawn. Because the
alpha value is not set for the polygon(s), it is most likely to be defaulted to
0.0 (or worse - another random value), and the whole thing will not be drawn.
Ofcourse, yo get better fill performance that way ....
To fix - go to the function AddPoly11 in pfflt_geom.c in libpfsgi.
Toward the end of the function you will find code that does :

    switch (vertType & ~MG_VERT_TEX) {
            case MG_VERT_ABS:
                polygon.nbind = PFGS_OFF;
                polygon.cbind = PFGS_PER_PRIM;
                MG2PF_COLOR3(polygon.colors[0], mgPoly->color1);
                break;

        ...
        ... and so on.

After each appearance of MG2PF_COLOR3 you should add :

        polygon.colors[0][3] = 1.0f;

At the upper part of the function there is another MG2PF_COLOR3 for
per-vertex-colored polygons. I suppose it should be fixed there too.

Performer guys :

I hope this bug, along with the previous one (empty polygon at the end of an
object) will be fixed for the next release. This version of the Flight loader
is an important one, since its the only one with the source supplied.

Regards,

Ran Yakir

-- 
 __                                  | Ran Yakir
 /_)  _  __   \  / _   / o __        | Graphics App. Chief Engineer
/ )_ (_(_) )   \/ (_(_/<_(_)(        | BVR Technologies Ltd.
              _/                     |   
-------------------------------------+--------------------------------
Phone :                              | E-mail : rany++at++bvr.co.il
  Work : 972-3-5715671               |
  Res. : 972-3-6995364               |
Fax    : 972-3-5715668               |

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:50:25 PDT

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