Smooth Shading

Is there anyway to set smooth shading on a model in Panda like you can do in Blender?



The idea behind smooth shading is to use vertex normals instead of polygon normals. If you configure smooth shading in Blender and export it to Panda, then you should get smooth shading in Panda too.

Oh, okay. Thanks.

So you can’t override that setting on the geom level in Panda with a call like setSmoothShading() and setFlatShading()?

Uh, perhaps there’s a way somewhere to generate new normals.

maybe … odelAttrib

That attribute refers to the interpretation of the normals in the geometry. You can’t just change the attribute on an arbitrary model and expect it to change from per-polygon to per-vertex shading, though, at least not in any meaningful way. You need to compute the normals properly on your model.

There’s nothing built into Panda to recompute the normals on already-loaded geometry, but you can do it easily on an egg file. For instance, egg-trans can generate either polygon or vertex normals. You can also make the appropriate runtime calls on an EggData to do this to a loaded egg image.