I'm trying to make this "fading trail effect".. I draw a rectangle and in each frame, I create another rectangle in the previous position with a lower opacity. I do so continuously and each time I diminish somewhat the opacity of the "rectangles created children". My question is: is it possible to do it differently without having to create more rectangles?
In other engines it achieved this by deleting the screen with a low opacity, but it did not achieve such an effect in love2d
fading trail effect
Re: fading trail effect
There are several possible ways, but yours is the most general. It will work on any background and without having to worry about anything else. It will work for opacity changes and also for size changes. I'm not sure if the opacity change will allow auto-batching, probably not, but if the number of trails is reasonably low (say, about 100 or so) that won't be a problem.
Re: fading trail effect
I made the similar trail using just pixels in my demo of a retro game:
https://dusoft.itch.io/captain-bradley- ... itius-demo
But you can use any shape. Maybe particles could work as well, not sure.
https://dusoft.itch.io/captain-bradley- ... itius-demo
But you can use any shape. Maybe particles could work as well, not sure.
My boat driving game demo: https://dusoft.itch.io/captain-bradley- ... itius-demo
Re: fading trail effect
If I understand what you want correctly, then I might have posted a relevant example here:oscaradalid wrote: ↑Mon Jul 22, 2024 4:42 pmIn other engines it achieved this by deleting the screen with a low opacity, but it did not achieve such an effect in love2d
viewtopic.php?p=259476#p259476
Re: fading trail effect
Yeah, that's nice.
My boat driving game demo: https://dusoft.itch.io/captain-bradley- ... itius-demo
Re: fading trail effect
I just have a table with x, y, alpha values. The alpha value is reduced each dt and removed when it is below zero.
Last project:
https://togfox.itch.io/hwarang
A card game that brings sword fighting to life.
Current project:
Idle gridiron. Set team orders then idle and watch: https://togfox.itch.io/idle-gridiron
https://togfox.itch.io/hwarang
A card game that brings sword fighting to life.
Current project:
Idle gridiron. Set team orders then idle and watch: https://togfox.itch.io/idle-gridiron
Who is online
Users browsing this forum: No registered users and 14 guests