strange flicker

Blitz3D Forums/Blitz3D Programming/strange flicker

Jager(Posted 2003) [#1]
I'm getting some weird flickering when moving a 3D Mesh.

I have a warrior type object containg 3 animated meshes, 1 for long distance away from the camera (low pol), 1 for medium distance (average detail) and the other close up (high detail). The idea being I hide 2 and show 1 depending on distance from the camera. This works fine when I move the camera but when I try to move the warrior, I get a strange flichering effect when it's changing from low-to med, or med to high pol etc. (All meshes, hidden and showing are moved at the same time.)

The flickering entails showing the warrior in a very old location for one frame only then back to the correct postion, for the next frame. This only appears to happen when swapping meshes (ie hidding one and showing another) while moving.

If I remove the distance calculation, ie showing one mesh continually, it doesn't happen. It appears Showentity might be showing the mesh in the wrong location for the first frame??????

It's not screen tearing, ie flip false, as I've removed that.

Any hints? I've checked and re-checked my code but cannot find anything wrong.


Rob(Posted 2003) [#2]
Checklist of possible causes:

1) you are using tweening and when you unhide and move, the mesh jumps causing the artifact.

2) you do not move all three meshes (including hidden ones each frame)

3) you have parented all 3 meshes to a pivot or one mesh; hideentity has issues with parented hierarchies. Try without parenting.

4) try any of the above techniques, avoiding hideentity and using entityalpha 0 instead. Alpha 0 entities are *not* rendered to the screen in any way, however collisions may still be active.


Jager(Posted 2003) [#3]
alphaentity caused frame rate to crash to 2, I'll have to use hideentity.... I'll remove tweening and see what happens.

If not, then as a test I might remove hideentity entirely just see if that is the cause.


Rob(Posted 2003) [#4]
EntityAlpha ent,0 should *improve* framerate.


Jager(Posted 2003) [#5]
Removing tweening and setting it to 1.0 solved the problem, why? I don't know except ..

"A tween value of 0 will render entities at their captured position, a tween value of 1 will render entities at their current position."

Implies that "captured position", whatever that means, is the problem?


Rob(Posted 2003) [#6]
Are you moving your hidden entities all the time?


Jager(Posted 2003) [#7]
.. and I forgot to add, thanks! for putting me on the right track.


Jager(Posted 2003) [#8]
yes, hidden and shown all move together .. to my knowledge - Moveentity doesn't return anything for me to test.

I removed hideentity on one unit to test. It didn't flicker, so Hideentity and tween#ing seems to be the problem?


Rob(Posted 2003) [#9]
The problem could be parenting.

Try performing Position/moventity on all 3 LOD objects with *no* parenting between them and see if hideentity still artifacts.


Jager(Posted 2003) [#10]
There has never been any parenting.

I tried that early on but found altering a parent, effected all the children, which wasn't what I was looking for.


Rob(Posted 2003) [#11]
I can't help further until you post a small bit of code which perhaps isolates this problem, sorry.


Jager(Posted 2003) [#12]
Problem is solved, as 7 posts up, hideEntity and Tweening seems to have a problem. I'll use Tween 1.0.

Thanks again.