Mesh versus animMesh
Blitz3D Forums/Blitz3D Programming/Mesh versus animMesh
| ||
Hello guys i've noticed something strange: When I load a mesh with loadanimMesh, it loads and works fine and is correctly lit , when I load the same mesh using loadMesh, it appears unlit (dark) and isn't reacting to the ambientlight command. How can you explain that? [edited : correction] |
| ||
Your question needs some work. I assume you mean LoadAnimMesh has the lighting problem. LoadAnimMesh preserves the object hierarchy and gives you an entity for each object. If the objects are fullbright that may have something to do with it. Just guessing though. Test it and see. |
| ||
you have to light all the children manually. |
| ||
Ambienlight is global. It should not be neccesary to "light all children manually". |
| ||
Are you using the UpdateNormals() command on the mesh? |
| ||
now, you MAY need to use UpdateNormals() on all of the children :) |
| ||
ah ambient light, i didn't read this properly.. manually lighting is only for non ambient lighting... you're right cygnus |
| ||
Oh I realized my first post was wrong. What I meant is that loadAnimMesh works fine, but loadMesh gives a mesh that isn't lit by ambient light. I'll make some tests with the ideas you have posted and post the results... |
| ||
Okay I found the problem. Turns out I was doing an entitycolor on the mesh later and it was overriding the ambientcolor.(the difference in behaviour between animMesh and mesh was because I didn't do the entityColor on the animMesh children). It's intersting to know that entitycolor colorizes the texture but overrides the ambientLight. |