# Hyper Trails - customizable trail effect

**URL:** <https://forum.defold.com/t/hyper-trails-customizable-trail-effect/48986>\
**Category:** The Defoldmine\
**Created:** [April 11, 2019, 6:55am UTC](https://forum.defold.com/t/hyper-trails-customizable-trail-effect/48986 "2019-04-11T06:55:21Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![aglitchman](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/aglitchman/32/19432_2.png) [@aglitchman](https://forum.defold.com/u/aglitchman)\
**Post date:** [April 11, 2019, 6:55am UTC](https://forum.defold.com/t/hyper-trails-customizable-trail-effect/48986/1 "2019-04-11T06:55:21Z")

</div>

![Hyper_Trails_50](https://defold-forum-bucket.nbg1.your-objectstorage.com/original/2X/2/2be5e2fbd04970940339a30511669c98d51d8af5.gif)

_Hyper Trails_ is easy to use and customizable trail effect for the Defold game engine.

## Installation and usage

Using it in your 2D game is simple:

1. Add .zip as a [Defold library dependency](http://www.defold.com/manuals/libraries/).
2. Copy `trail_maker.script` and `trail_model.model` from `/hyper_trails/hyper_trail_16.go` into your collection in your game object.
3. Run your game and move the game object. Enjoy!

## Sources and documentation

[https://github.com/indiesoftby/defold-hyper-trails](https://github.com/indiesoftby/defold-hyper-trails)

## Example App

[Play online - https://indiesoftby.github.io/defold-hyper-trails/](https://indiesoftby.github.io/defold-hyper-trails/)

## Roadmap

- More examples
- Support of variable dt
- Interpolation using splines

## Feedback

I’d appreciate any feedback! I want to understand use cases and improve the extension.

---

<div class="post-metadata">

**Author:** ![Pawel](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/pawel/32/24623_2.png) [@Pawel](https://forum.defold.com/u/Pawel)\
**Post date:** [April 11, 2019, 7:02am UTC](https://forum.defold.com/t/hyper-trails-customizable-trail-effect/48986/2 "2019-04-11T07:02:21Z")

</div>

Wow 😃 it’s an amazing asset, must dive in, but I’m already astonished 😃 Do you mind creating an [asset page](https://www.defold.com/community/assets/) for this? 😉

---

<div class="post-metadata">

**Author:** ![aglitchman](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/aglitchman/32/19432_2.png) [@aglitchman](https://forum.defold.com/u/aglitchman)\
**Post date:** [April 11, 2019, 7:05am UTC](https://forum.defold.com/t/hyper-trails-customizable-trail-effect/48986/3 "2019-04-11T07:05:17Z")

</div>

@Pawel Thanks! Yeah, I’ll add asset page a bit later.

Also I need help from the community and the Defold team. I tested the extension on a lot of devices, but on two cases, there are hurtful glitches that I don’t know how to fix.

1. Two PCs with Windows 10 and Geforce GTX 1080 Ti, latest drivers. Trails shake in random occurrence. It looks as if the data texture is not immediately sent to the GPU (using `resource.set_texture(path, table, buffer)`), but in other frames: [video](https://imgur.com/a/gbWwoxF). If you run it in your browser, it works properly. (because of DirectX via ANGLE, probably)

2. Amazon Fire TV Stick (W87CUN). No uniform attributes sent (only in Hyper Trails demo app!) and so it looks like: [photo](https://imgur.com/QjS4b6v).

---

<div class="post-metadata">

**Author:** ![sven](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/sven/32/1086_2.png) [@sven](https://forum.defold.com/u/sven)\
**Post date:** [April 11, 2019, 12:19pm UTC](https://forum.defold.com/t/hyper-trails-customizable-trail-effect/48986/4 "2019-04-11T12:19:56Z")

</div>

Amazing work!! 😃

Would it be possible to publish a playable web example as well?

Regarding point 1 above, the jittery/shaking bug, could it possibly be due to some precision in the shaders?

---

<div class="post-metadata">

**Author:** ![aglitchman](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/aglitchman/32/19432_2.png) [@aglitchman](https://forum.defold.com/u/aglitchman)\
**Post date:** [April 11, 2019, 12:35pm UTC](https://forum.defold.com/t/hyper-trails-customizable-trail-effect/48986/5 "2019-04-11T12:35:21Z")

</div>

OK, [published web example](https://indiesoftby.github.io/defold-hyper-trails/).  
Also added to the [Asset Portal](https://www.defold.com/community/projects/139910/).

---

<div class="post-metadata">

**Author:** ![ianshk](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/ianshk/32/13302_2.png) [@ianshk](https://forum.defold.com/u/ianshk)\
**Post date:** [April 11, 2019, 12:43pm UTC](https://forum.defold.com/t/hyper-trails-customizable-trail-effect/48986/6 "2019-04-11T12:43:07Z")

</div>

This is really cool.

---

<div class="post-metadata">

**Author:** ![aglitchman](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/aglitchman/32/19432_2.png) [@aglitchman](https://forum.defold.com/u/aglitchman)\
**Post date:** [April 11, 2019, 12:51pm UTC](https://forum.defold.com/t/hyper-trails-customizable-trail-effect/48986/7 "2019-04-11T12:51:39Z")

</div>

> [@sven](#):
>
> Regarding point 1 above, the jittery/shaking bug, could it possibly be due to some precision in the shaders?

Looks like it’s not. I’ve been trying to figure out the reason all week.. But so far I’ve been unsuccessful. I’ll make a simple project to try to catch this bug on it.

---

<div class="post-metadata">

**Author:** ![ianshk](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/ianshk/32/13302_2.png) [@ianshk](https://forum.defold.com/u/ianshk)\
**Post date:** [April 11, 2019, 1:33pm UTC](https://forum.defold.com/t/hyper-trails-customizable-trail-effect/48986/8 "2019-04-11T13:33:06Z")

</div>

Maybe added trail on and off feature could be good.

---

<div class="post-metadata">

**Author:** ![TheKing0x9](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/theking0x9/32/13588_2.png) [@TheKing0x9](https://forum.defold.com/u/TheKing0x9)\
**Post date:** [April 11, 2019, 3:05pm UTC](https://forum.defold.com/t/hyper-trails-customizable-trail-effect/48986/9 "2019-04-11T15:05:20Z")

</div>

Great Asset!!

---

<div class="post-metadata">

**Author:** ![aglitchman](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/aglitchman/32/19432_2.png) [@aglitchman](https://forum.defold.com/u/aglitchman)\
**Post date:** [April 15, 2019, 1:16pm UTC](https://forum.defold.com/t/hyper-trails-customizable-trail-effect/48986/10 "2019-04-15T13:16:39Z")

</div>

As an example, I replaced the trail effect 💫 in @britzl’s GB Rausers with Hyper Trails: [play online](https://aglitchman.github.io/defold-hyper-gbrausers/), [sources](https://github.com/aglitchman/defold-hyper-gbrausers).

---

<div class="post-metadata">

**Author:** ![mrduneit](https://forum-defold.b-cdn.net/letter_avatar_proxy/v4/letter/m/7bcc69/32.png) [@mrduneit](https://forum.defold.com/u/mrduneit)\
**Post date:** [May 2, 2019, 1:00pm UTC](https://forum.defold.com/t/hyper-trails-customizable-trail-effect/48986/11 "2019-05-02T13:00:15Z")

</div>

Hi, I downloaded from Github  
**[defold-hyper-gbrausers](https://github.com/aglitchman/defold-hyper-gbrausers)**  
but when I build it with Defold there are 2 errors:

1. /assets/font/smallest\_pixel-7.font  
The file ‘/assets/font/pixelfont.material’ could not be loaded.

2. /game/player.collection  
The file ‘/assets/trail/trail.material’ could not be loaded.

Instead, when I build the original GB Rausers, there is no error.

Do you have any idea about the rerason?  
Thanks, Marco

---

<div class="post-metadata">

**Author:** ![aglitchman](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/aglitchman/32/19432_2.png) [@aglitchman](https://forum.defold.com/u/aglitchman)\
**Post date:** [May 2, 2019, 3:16pm UTC](https://forum.defold.com/t/hyper-trails-customizable-trail-effect/48986/12 "2019-05-02T15:16:36Z")

</div>

@mrduneit, сan you please download the project and try to build it again? Because I checked it, [set up the CI](https://travis-ci.com/aglitchman/defold-hyper-gbrausers/jobs/197199403) and the project builds fine.

---

<div class="post-metadata">

**Author:** ![mrduneit](https://forum-defold.b-cdn.net/letter_avatar_proxy/v4/letter/m/7bcc69/32.png) [@mrduneit](https://forum.defold.com/u/mrduneit)\
**Post date:** [May 2, 2019, 4:35pm UTC](https://forum.defold.com/t/hyper-trails-customizable-trail-effect/48986/13 "2019-05-02T16:35:56Z")

</div>

Now it works, thanks!

---

<div class="post-metadata">

**Author:** ![bluespheal](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/bluespheal/32/15634_2.png) [@bluespheal](https://forum.defold.com/u/bluespheal)\
**Post date:** [October 29, 2019, 3:57pm UTC](https://forum.defold.com/t/hyper-trails-customizable-trail-effect/48986/14 "2019-10-29T15:57:05Z")

</div>

I have a question, when making trails for objects made out of a factory, how can I properly do it? right now I have a pre-existing object with a trail and whenever a new object with a trail gets created, both objects end up with the same trail.

---

<div class="post-metadata">

**Author:** ![aglitchman](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/aglitchman/32/19432_2.png) [@aglitchman](https://forum.defold.com/u/aglitchman)\
**Post date:** [October 30, 2019, 10:49am UTC](https://forum.defold.com/t/hyper-trails-customizable-trail-effect/48986/15 "2019-10-30T10:49:56Z")

</div>

Hyper Trails uses a texture as an array of data. So each `trail_model` instance should have its own texture..

---

<div class="post-metadata">

**Author:** ![indoor\_keith](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/indoor_keith/32/20650_2.png) [@indoor\_keith](https://forum.defold.com/u/indoor_keith)\
**Post date:** [May 10, 2020, 4:29pm UTC](https://forum.defold.com/t/hyper-trails-customizable-trail-effect/48986/16 "2020-05-10T16:29:47Z")

</div>

When I try to implement a trail onto an object, the trail seems to offset from the object even when the location is centered on the object, and is quite thin. And increasing the width increases the offset it has.

I downloaded the demo from github and mulled over everything and I can’t find any differences between the demo and what I have aside from one. I’m currently using the orthographic camera asset, and I can only assume it has something to do with that. Does this sound like anything anyone has run into before?

---

<div class="post-metadata">

**Author:** ![indoor\_keith](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/indoor_keith/32/20650_2.png) [@indoor\_keith](https://forum.defold.com/u/indoor_keith)\
**Post date:** [May 10, 2020, 5:36pm UTC](https://forum.defold.com/t/hyper-trails-customizable-trail-effect/48986/17 "2020-05-10T17:36:15Z")

</div>

So I switched to using Rendercam instead of the orthographic cam asset. This seems to have fixed the issue, however, I’d love to know what was causing the issue with orthographic cam as I feel like it would be a good learning point for me at the very least. Thanks!

---

<div class="post-metadata">

**Author:** ![totebo](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/totebo/32/36087_2.png) [@totebo](https://forum.defold.com/u/totebo)\
**Post date:** [February 1, 2021, 5:36pm UTC](https://forum.defold.com/t/hyper-trails-customizable-trail-effect/48986/18 "2021-02-01T17:36:44Z")

</div>

Is there a way to render these trails on top of models?

---

<div class="post-metadata">

**Author:** ![Pkeod](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/pkeod/32/606_2.png) [@Pkeod](https://forum.defold.com/u/Pkeod)\
**Post date:** [February 1, 2021, 7:39pm UTC](https://forum.defold.com/t/hyper-trails-customizable-trail-effect/48986/19 "2021-02-01T19:39:29Z")

</div>

> [@totebo](#):
>
> render these trails on top of models?

Most likely add another material / render predicate tag / assign that to the trails you want to be above models / then draw that tag after models?

---

<div class="post-metadata">

**Author:** ![totebo](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/totebo/32/36087_2.png) [@totebo](https://forum.defold.com/u/totebo)\
**Post date:** [February 1, 2021, 7:52pm UTC](https://forum.defold.com/t/hyper-trails-customizable-trail-effect/48986/20 "2021-02-01T19:52:12Z")

</div>

I actually meant drawn in the same pass as the current models, so could (in theory) pass “through” a model. I guess they’re drawn in a magical way now, because they always end up underneath the models in the game.

[Next page](https://forum.defold.com/t/hyper-trails-customizable-trail-effect/48986.md?page=2)
