Model Issues

Okay, I have a 3D Studio Max soccer ball that has vertex coloring (I believe that's right) for the black and white patches on it.  I dropped  it into a scene without lighting and it shows up completely white.  I tried turning the LightState to OFF but that didn't help.  After I add lighting it shows exactly like it should, but I figured this was a bug that should be taken care of?  It's not a big deal for me as I want lighting in my scene, I just hadn't added it yet.



darkfrog

probably because it's not vertex coloring but material settings?

edit:



|:(

So check to see if it has a colorbuffer (getColorBuffer != null) or a MaterialState (getRenderState(RenderState.RS_MATERIAL) != null) before you add it to the scene.



hopefully not saying something silly this time

Perhaps it is materials, not sure exactly.  I've tried disabling the lightstate as well as turning the light combine mode to none to no avail.  It stays white until the lights come on and then it looks fine. :o



darkfrog

Then it's probably materials, not vertex colors.

Where do I getColorBuffer from?  I call getRenderState(RenderState.RS_MATERIAL) and it is null, but with lighting it still shows up exactly like it should…could it be an underlying part of the main model's Node that has the material on it?



darkfrog

Directly from the Geometry. The same goes for the MaterialState… (if it's used, it ofcourse has to be different for each seperate color surface)



Just get a child from the Node. Keep in mind the childeren themselves could also be a Node (you'll need a Geometry).



If it turns out to be a MaterialState (and no colorbuffer) then you'll need lighting. Maybe you can use setGlobalAmbient in LightState then, that should give you about the same effect as using color buffers. Also keep in mind Lights are sometimes already included in the model (though it doesn't seem to be the case now).