Mesh versus animMesh

Blitz3D Forums/Blitz3D Programming/Mesh versus animMesh

cyberyoyo(Posted 2006) [#1]
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]


DJWoodgate(Posted 2006) [#2]
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.


t3K|Mac(Posted 2006) [#3]
you have to light all the children manually.


Damien Sturdy(Posted 2006) [#4]
Ambienlight is global. It should not be neccesary to "light all children manually".


Shambler(Posted 2006) [#5]
Are you using the UpdateNormals() command on the mesh?


Damien Sturdy(Posted 2006) [#6]
now, you MAY need to use UpdateNormals() on all of the children :)


t3K|Mac(Posted 2006) [#7]
ah ambient light, i didn't read this properly.. manually lighting is only for non ambient lighting... you're right cygnus


cyberyoyo(Posted 2006) [#8]
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...


cyberyoyo(Posted 2006) [#9]
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.