When using motionStreak if it changes direction suddenly, there are ugly lines appearing like if it overlaped weirdly. It happens even in the test.
Is there no way to fix this?
MotionStreak not looking good
(4 posts) (3 voices)-
Posted 1 year ago #
-
If the direction radically changes, you'll get this effect no matter what you do, because the ribbon will cross over itself. If your direction change is less radical you can tweak the parameters to avoid this problem. Another option would be to add point merging to the current code, making it more tolerant (but it still wouldn't handle changes in direction over 90 degrees).
If you want a motion steak like effect that does not suffer from overlap regardless of the motion, then you'll have to use a render to texture technique instead. This is a lot more work and much slower, but can achieve the desired effect. If you need the fadeout, that's even more work. In essence (with fadeout), you need two buffers to render into, and you'd do something like this:
- Render buffer 1 into buffer 2 at 95% opacity
- Render the streak object into buffer 2 at 100% opacity
- Render buffer 2 to the screen at 50% opacity
- Swap buffer 1 and 2You'd also have the render the object several times if you wanted smooth sub-frame motions. Changing the opacity of the first stage will increase or decrease the fade out time.
Posted 1 year ago # -
ok, since someone started a thread like this...
is there any way to clear a Ribbon ? Say you teleport the emitter from one place to another (or restart level and move player to the starting point) and you don't want the streak to follow this "movement" ? I couldnt find anything for that in the class...
Posted 1 year ago # -
@slipster216: Thanks, i feared so... Right now i am using many sprites to simulate the ribbon, but obviously in a much intense game this would kill the fps since in a given step i am adding an sprite and applying an action to it that waits, fades, scales and removes the sprite.
@mikesz: As far as i know there is no off the shelve way to do it. I remember a lot ago doing what you need myself but i can't find it.
Posted 1 year ago #
Reply
You must log in to post.