I’m exporting from SoftImage Mod Tool 7.5. All looks well in ambient light but if I add a directional or point, I get creases or inconsistent lighting on the triangles? Or something. Here is a pic:
Any idea how to fix this?
I’m exporting from SoftImage Mod Tool 7.5. All looks well in ambient light but if I add a directional or point, I get creases or inconsistent lighting on the triangles? Or something. Here is a pic:
Any idea how to fix this?
There are two ways to solve this:
Hmm. setShaderAuto() doesn’t seem to do anything? Is there anything specific on where to put it?
This is my code:
# Panda Render Window, this is the main thread
class PandaApp(ShowBase):
def __init__(self):
ShowBase.__init__(self)
#base.disableMouse() # turn off internal camera control
base.setBackgroundColor(0, 0, 0)
random.seed()
# set auto shader for pixel based lighting as opposed to vertex lighting
render.setShaderAuto()
# start wx control window in it's own thread
self.wxApplication = wxThread()
self.wxApplication.start()
# load dice models
self.LoadModels()
# fix the camera here
self.camera.setPos(0, -8, 1)
self.camera.setHpr(0, 0, 0)
# setup a directional light
dlight0 = DirectionalLight('dlight')
dlight0.setColor(VBase4(0.8, 0.8, 0.5, 1))
dlnp0 = render.attachNewNode(dlight0)
dlnp0.setHpr(0, -60, 0)
render.setLight(dlnp0)
Also, adding more polygons to the model just makes it worse.
Hmm, that sounds like trouble. I don’t have much experience with this in particular, sorry. Try regenerating the normals using egg-trans or something like that.
I think (I’m really careful saying this, because I have little experience) that it might also depend on the topology of the triangles, that perhaps a triangle fan-like topology would be more likely to cause these issues.
Using flat shading instead of smooth shading is probably the easiest way to solve this, but you might prefer smooth shading in this case. (smooth shading = vertex normals, flat shading = polygon normals.)
This is basically a modeling issue.
There are two ways to fix it:
THANKS! That fixed it