Vertex lighting animated mesh

Blitz3D Forums/Blitz3D Programming/Vertex lighting animated mesh

Braneloc(Posted 2003) [#1]
Ok, how the heck do I set vertex lighting up on an ANIMATED mesh ? (Before you answer, check to see if the code works.. it's not as simple or obvious as it sounds)

(if it makes a difference, it's a rigid mesh keyframe animation exported from max as a .3ds)


jhocking(Posted 2003) [#2]
Could you perhaps explain what you have tried and why that isn't working? Actually, can you explain what you mean by "vertex lighting?" That's a pretty vague term which can refer to anything from the normal Garoud shading (in which case you don't have to do anything; it is automatic) to baking lighting information as vertex color using LightMesh.


Braneloc(Posted 2003) [#3]
...as in forced lighting that isn't from ambient light, or another DX light that may be pointing in the objects general direction.

Why isn't it working ? Ya got me. Objects come out black when EntityFX is applied. Everything works fine with normal meshes (ie, static, not animated)


jhocking(Posted 2003) [#4]
You described "vertex lighting" with the even more vague term "forced lighting." And you say you applied EntityFX; which effect? And why? As far as I can tell (and I am having trouble interpreting your post; the ", or" is especially unclear because I can't tell what the antecedent for "or" is, if you mean light from DX lights is included in the definition of "vertex lighting" or if that is also excluded from the definition of "vertex lighting") you don't need or want EntityFX because the normal DX Garoud shading happens automatically.

The fact that things work fine with static meshes is an important clue however. Especially since you say the animated mesh is a multi-object model exported to 3ds file format. In most cases problems with those are due to needing to apply the effect (eg. EntityFX) to all the children individually. There are some commands which will affect an entity's children automatically, and those only have to be called once on the root object, but most commands need to be applied directly to every child object. Thus you will need to create a simple recursive function which will use CountChildren and GetChild to loop through all the children and apply EntityFX to each.


Braneloc(Posted 2003) [#5]
Does non-dynamic lighting make sense ? Stored onto the vertex. Vertex colour. Changing FVF to include vertex lighting. Forced, precomputed whatever the heck you want to call it.

EntityFX <entity>, 2 (use vertex lighting)

I already tried looping through child entities before the first post, but with no useful effect - with a variety of commands. Some even caused blitz to bomb out completely. (ie, exit without warning) (trying to do a recursive lightmesh bombs)

I used a recursive entityFX, which worked since it turned all objects it was applied to black(which I hope is still the default vertexcolour, or something is up)

I have tried the following commands recursively, and non recursively, entitycolour, vertexcolor, lightmesh - but with no success.

Normal DX lighting is all fine, but I'm using dynamic effects for something else. I've either missed something very obvious or soemthing is seriously wrong somewhere.

....so, how the heck do I set vertex lighting up on an ANIMATED mesh ?


jhocking(Posted 2003) [#6]
Thanks for the additional info but there is still at least one thing you haven't addressed. So how exactly are you trying to apply the vertex colors? It sounds like you are using LightMesh, in which case please post sample code of what you are trying to do.