Q: to those who use tweening with my shadow system

Blitz3D Forums/Blitz3D Programming/Q: to those who use tweening with my shadow system

Uh... SetAnimTime and Texture_Angle_Epsilon have nothing to do with eachother. :-) So you probably chnaged something else to fix your problem.

Texture_Angle_Epsilon is a value which defines how much the angle between the light and the shadow caster needs to change before the system re-renders the shadow texture.

Ie, a shadow rendered directly above and object, and a shadow rendered directly behind an object are seperated by 90 degrees.

Also, a shadow rendered from above an object, and a shadow rendered from above an object which has been pitched forward by 90 degrees, are also seperated by 90 degrees.

Add these two transforms, and you have a difference of 180 degrees.

0.5 here means half a degree of change total. So if the angle between light and object only changes by half a degree, meaning the outline the shadow represents hasn't changed much, then the shadow is not re-rendered that frame. But if the angle between them changes by 0.6 degrees, then it is re-rendered.

All entities that animate force their shadows to be re-rendered every frame. They cannot take advantage of those optimization. There is no way to know how much their outline has changed from one frame to the next.

...

Hm...

Something occurs to me though. If you do not set your entity to be animating, and only change it's animation frame with set anim time, assuming that works... Then the system may not know that the entity is animating, and it would only update the shadow when the angle between the light and caster has changed sufficiently. That would mean that if you just kept the entity in one spot with a static light source that is unmoving, unless you set epsilon to 0, the shadow would never match the animation.

But that ASSUMES that the Blitz animating() command will still return false if you have just changed the animtime, and that changing the animtime will work at all if if the entity is not animating. If you have the entity set to animate but set it's animtime every frame, then things should work. But if you ahve the entity not animating and set animtime every frame, assuming that works in Blitz, then you might have the problem you described with the shadow animation being "jerky".

So I guess episolon and setanimtime may have something to do with eachother after all. I never considered someone would animate an entity without actually turning on animation. Even with setanimtime.