Re: [Plib-users] SSG for 3ds and ASE
Brought to you by:
sjbaker
|
From: Steve B. <sjb...@ai...> - 2000-08-11 06:42:16
|
> Dave McClurg wrote:
>
> > Can you detect when you get an old-style file and generate
> > normals like ssgLoadAC does? (AC3D files *never* contain
> > normals).
>
> ssgLoadAC doesn't generate normals. That happens in ssgOptimiser
> (void OptVertexList::makeNormals()). This code crashes when it runs
> on an ASE model. What is worse is that ASE models create indexed
> ssgVtxArrays and shared verticies imply shared normals.
> ssgOptimiser creates face normals instead of vertex normals.
> This means a shared vertex may require two *different* normals
> and the indexed ssgVtxArray would have to be rebuilt. ugh.
Yikes! You understand this unholy mess better than I do!
We really need to stop and think about "Loader Service Routines" before
we go too much further down the loader writing curve.
I'd expect nearly any loader to benefit from:
* Polygon decimation to triangles.
* Optimal Tristrip creation.
* Parser support.
* Callbacks for applications that need to extend the
file format via comment fields, etc.
* Callbacks for applications that need to build their
own ssgStates.
* Surface normal generation.
* Degenerate triangle/vertex removal.
* Flattening (multiplying out the matrices in ssgTransform
nodes and doing a one-time transform of vertices in the
leaf node)
* Degenerate group removal (eg deleting ssgBranch nodes with
either one or zero children - but only if the node isn't
known to the application - or a derived class of ssgBranch).
* ssgState sharing between leaf nodes.
* Texture coordinate size reduction.
...and probably a lot more.
Back when it looked like AC3D and maybe one other might be the only
loaders there would ever be, I didn't take too much time to modularize
this stuff. But with the likelyhood that we could end up with a dozen
or more loaders eventually (especially since the advent of PPE), we need
to seriously look into this.
--
Steve Baker HomeEmail: <sjb...@ai...>
WorkEmail: <sj...@li...>
HomePage : http://web2.airmail.net/sjbaker1
Projects : http://plib.sourceforge.net
http://tuxaqfh.sourceforge.net
http://tuxkart.sourceforge.net
http://prettypoly.sourceforge.net
|