Re: [Plib-devel] LoadASE problem.
Brought to you by:
sjbaker
From: Steve B. <sjb...@ai...> - 2000-02-23 20:07:30
|
Dave McClurg wrote: > > Christian wrote: > > >I tried to compile a new plib checkout, but MSVC complaind about a few > >parts in the ASE load/save routines > > Thanks for checking this out. I added the fixed to other changes i'm making. > I noticed the plib.dsw/dsp in CVS is missing the new files and ssgContext.cxx. > i'll send Steve the changes for a commit later today Yes - I don't posess a single byte of Microsoft software - so I can't maintain the MSVC build setup...or any other non-Makefile-based scheme for that matter. However, if someone wants to send me those project files, I'll be happy to commit them. > >Using the save.cxx SSG example with loading the tuxedo.ac and saving it > >then as tuxedo.ase I get > > > >*MATERIAL_AMBIENT -431602080.000000 -431602080.000000 -431602080.000000 > >*MATERIAL_DIFFUSE -431602080.000000 -431602080.000000 -431602080.000000 > > > >in all materials. This doesn't lok right (it looks like some unitialized > >floats). Is that correct? > > > > correct. AC format specifies rgb,amb,emis,and spec where as ASE specifies amb,diff,spec. Emission isn't used much anyway - most of the time it's just easier to disable GL_LIGHTING - which has much the same effect. > ssgLoadAC does this: > > st -> setMaterial ( GL_SPECULAR, mat -> spec ) ; > st -> setMaterial ( GL_EMISSION, mat -> emis ) ; > > and ssgLoadASE does this: > > st -> setMaterial ( GL_AMBIENT, mat -> amb ) ; > st -> setMaterial ( GL_DIFFUSE, mat -> diff ) ; > st -> setMaterial ( GL_SPECULAR, mat -> spec ) ; > > therefore, when you load AC and save ASE you get undefined amb and diff. > before i fix this, i'd like to understand it more fully. anyone want to comment on > how the state should be initialized for unknown properties? It's messy because of glColorMaterial. Personally, my application software sets glColorMaterial to pick up the diffuse/ambient colours from the glColor() call and I totally ignore the emission/specular from the file - forcing them to black and white respectively. Added to which, I code the entire ssgSimpleState into the application and use the texture map name from the model file to find the material in the application. This means that I can't just pick up any random model off the web and toss it (unmodified) into my game - but that's a pretty silly thing to expect anyway. Games have to manage how much texture they consume and stuff like that - so anything more complex than the very simplest game will need to do something similar to this. -- Steve Baker http://web2.airmail.net/sjbaker1 sjb...@ai... (home) http://www.woodsoup.org/~sbaker sj...@ht... (work) |