[Plib-devel] SSG bux fixes for untextured .3ds objects
Brought to you by:
sjbaker
From: Dan G. <dg...@hp...> - 2000-08-14 17:32:21
|
Last week I posted on plib-users about problems I was having with .3ds objects that were not textured. I figured out a couple changes that solved the problems for me, and I'm assuming this is the right place to post them. 1. Non-textured objects show up as white when textured objects drawn before them. I started with the tux ssg example program. One of the textured objects drawn sets the GL_EMISSION material values to 1.0,1.0,1.0. When the .3ds objects are drawn without textures it sets the ambient, diffuse, and specular material properties, but doesn't set the emissive back to 0.0. I added a line to ssgSimpleState::apply to set it to 0.0 if it isn't specified. I don't know if this is the correct place or not. 2. First non-textured object always shows up as white in scene with or without textures I believe this was happening because glDisable(GL_COLOR_MATERIAL) is called AFTER the glMaterial calls in ssgSimpleState::apply. This causes the glMaterial calls to be ignored for the first object, but work for subsequent objects. I think that is what happens. My workaround was to move the ssgDisableTable call to before the glMaterial calls. I don't know if either of these is the proper solution, or if they would break other areas. They seemed to work for me though. Dan |