David Megginson wrote: > I'm struggling a bit with the best way to implement text for the new > (3D-capable) animation code in FlightGear. Plib's current approach > seems suboptimal -- it uses textured fonts (good), but instead of > adding the text directly to a scene graph, it requires a separate > drawing pass for it (bad). I wonder if the plib text is one of the > reasons that the old (2D-only) animation code could hurt the framerate > so badly.
What interface would you like? The Plib fnt library is an immediate mode kind of thing. If you want it to live in the scene graph, you need only write a node object that sets up the matrices appropriately. A fancy implementation of static text might precompile it into a set of textured quads instead of doing it at render time from the input string; but for static text you might as well use a static texture anyway. I'd suggest an interface where you specify a location for the lower left corner of the text, a "plane" in which it exists, and a "point size" in real world units. This stuff can compile down to a single matrix push, and the node object just calls the immediate mode fnt stuff inside of draw(). Honestly, I think you might be fooling yourself on the 2D/3D performance issues. There's no secret sauce in ssg that makes it faster; my guess is that the existing 3D cockpits are faster than the 2D ones because they use fewer and smaller textures, and do less animation of the layers. If you were to port the 2D panels to 3D model files with a 1:1 mapping, you probably wouldn't see any difference. Andy _______________________________________________ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel