Search Unity

Trail that doesn't drag the texture with it

Discussion in 'General Graphics' started by Cactus_on_Fire, Oct 6, 2016.

  1. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    675
    Hello.

    I'm trying to make particles leave a static smoke trail but it keeps moving the texture with the particle itself. Is there a way to set up the trail so it doesn't pull the trail texture with the particle or game object?

    Thanks
     
  2. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,285
    In the 5.5 beta there is a new texture mode in the trail renderer to achieve this.

    Pre 5.5, I believe you can drive the material tiling values from script to achieve the same thing but it would be cumbersome
     
  3. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    675
    I tried beta 5.5.0b5, it tiles but drags the texture anyway.
     
  4. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,285
    Ah, I think we just need to generate the UVs starting from the tail instead of the head, to achieve this effect. I have added it to our roadmap but I don't think you can easily achieve this effect in with the current TrailRenderer functionality.

    An alternative might be to use a particle system with a birth sub-emitter attached to it. But maybe it's not appropriate for your use-case.

    Sorry I can't be more helpful!
     
    Martin_H likes this.
  5. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    675
    No probs, thanks for making use of community feedback :)
     
  6. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    675
    I tried that, the problem is about what Richard mentioned.
     
  7. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    675
    Hey Richard. Is there any chance we can see the trail we discussed here in the upcoming beta releases ?
     
  8. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,285
    We've not had chance to look at it yet. Maybe 5.7 will be realistic, sorry!
     
  9. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    675
    Ah ok. I'll check back later.
     
  10. AlcoleponeHome

    AlcoleponeHome

    Joined:
    Jun 9, 2018
    Posts:
    47
    Did this ever get any progress?
     
  11. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    675
    I don't think so. New Unity doesn't have that option as far as I can see.
     
  12. mitaywalle

    mitaywalle

    Joined:
    Jul 1, 2013
    Posts:
    247
    bump, really important thing for shooters. Only way now to achieve this is make UV-tiling at 1.
     
  13. AlcoleponeHome

    AlcoleponeHome

    Joined:
    Jun 9, 2018
    Posts:
    47
    still waiting on this : /
     
  14. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    675
    It's a really easy thing to add and really useful. Even the ancient Source engine had it :rolleyes:
     
  15. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,285
    For anyone who isn’t aware of the duplicate post here I’ll repost (https://realtimevfx.com/t/unity-trail-render/2664/23)

    ————

    Hey, apologies that we still haven’t done this. The Particle System, Trail Renderer and Line Renderer are mostly is “maintenance mode” now, which means they are only receiving bugfixes and very small improvements. This is due to the development of the Visual Effect Graph, which aims to supercede these features.

    I did pass this much-requested feature along to the Visual Effect Graph team some time ago, but my understanding is that the first version of trails in that tool won’t support this either.

    Sorry that I don’t have any good news on this for you.
     
    mitaywalle likes this.
  16. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,285
    You are welcome to share a c# script demonstrating how it could work, if you want to hurry us along with this. Right now it simply hasn’t bubbled high enough up our priority list to be looked at.
     
    mitaywalle likes this.
  17. tspk91

    tspk91

    Joined:
    Nov 19, 2014
    Posts:
    131
    I think it is as simple as not updating the uv's of the vertices? Having them drag along with the particle seems like more work, though maybe I'm wrong.
     
  18. tspk91

    tspk91

    Joined:
    Nov 19, 2014
    Posts:
    131
    With the texture mode set to repeat-per-segment, you can use any integer number to tile it. By doing that, you can even use texture sheets. Get rid of the ever increasing UVs by writing some code in the shader to the tune of: texcoord.x = frac(texcoord.x), that gives you nice UVs repeating from 0 to 1.

    Still, that does not solve the stretching textures on the leading vertex, as the new vertex maintains it's UV coordinate as it moves.
     
  19. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,526
    Man I wish this was added in 2016 before the maintenance mode came into effect, now I still can't use the trails for car tracks.
     
  20. NorthStar79

    NorthStar79

    Joined:
    May 8, 2015
    Posts:
    88
    this is known since 2016 and no improvements yet. dissapointing
     
  21. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,285
    You're totally right. We should have sorted this out a long time ago.
    I've made a prototype build of the feature here, please try it out and let us know if it is what you need: https://forum.unity.com/threads/world-space-trail-textures.1107389/
     
  22. Lord-Megabite

    Lord-Megabite

    Joined:
    Feb 21, 2015
    Posts:
    8
    This would be very useful for making car track trails. Is the prototype would be in the engine anytime soon ? Thanks
     
  23. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,526
    Last edited: Jan 22, 2022
  24. fleity

    fleity

    Joined:
    Oct 13, 2015
    Posts:
    345
    Any chance of somehow backporting this into 2021? :eek:
     
  25. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,285
    None - sorry! 2022.1.0a6 is the first version it's available in.
     
  26. fleity

    fleity

    Joined:
    Oct 13, 2015
    Posts:
    345
    Oh well in that case we will just need to write our own version. Thanks for the quick reply though :)
     
    richardkettlewell likes this.
  27. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    675
    Just wanted to say thanks for implementing for this long awaited feature. No more awkwardly dragging smoke trails!