Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Feedback World space trail textures

Discussion in 'Particle System Previews' started by richardkettlewell, May 10, 2021.

  1. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,285
  2. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,524
    Thanks for making this available!
    I will test it out and let you know.
     
    richardkettlewell likes this.
  3. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,524
    Perhaps an idea for optionally making the trail project to a ground surface like decals do?
    This way we can use it for car tracks on the road surface.
     
  4. michalpiatek

    michalpiatek

    Joined:
    Feb 26, 2021
    Posts:
    81
    1. Line Renderer is missing World Space Texture Scale option
    2. If Texture Scale has been implemented for the World Space texture mode I strongly believe texture tiling should be implemented for all the other modes as well so that we can adjust tiling without having to make a new material copy and modify texture tiling there
    3. Texture Mode is called World Space and yet when I am scaling Line Renderer up/down texture tiling behaves as if it was generated in the local space of Line Renderer. I definitely think this is a good default behaviour but I also would like to see a param which defines how texture tiling behaves when object is scaled, similarly to Scaling Behaviour in the particle system. Should scaling affect positions of points only and keep the world space tiling or should it affect position of points but also keep the relative local space texture tiling, it could be an useful option to have. But it's a very low priority, at least for me.
    4. It's probably due to it being an early build but line renderer with Loop enabled stretches the texture in some segments image_2021-05-18_101445.png
    All in all I think this works quite well. True test will come once it's implemented for the Particle System but I am quite happy with how this early build works. Thanks!
     
    Last edited: May 18, 2021
    Lars-Steenhoff likes this.
  5. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,285
    Thanks for this feedback I really appreciate it!

    I've fixed 1,2 and 4. You're absolutely right that the scaling can work for all modes.

    For 3, i'm pondering whether it would be best to rename the new mode to Local Space, to clarify this, because you're right - this is more accurate based on how it works. We could look at adding scaling options later, but I think that would delay shipping this initial version unnecessarily.

    I'll muse over the name a bit more (opinions welcome!), then get the particle version done and provide a new build.
    Plus start some more thorough internal testing.
     
    michalpiatek and Lars-Steenhoff like this.
  6. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,285
    What if i called the new texture mode "Static", instead, to mean "Hey it's not going to move!" ?
     
    Lars-Steenhoff likes this.
  7. michalpiatek

    michalpiatek

    Joined:
    Feb 26, 2021
    Posts:
    81
    Just "Static" or "Local Space Static"? I think just "static" sounds as if it was not possible to animate it with a shader or something in that ballpark. World Space Static / Local Space Static might be a bit better?
     
  8. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,285
    I was suggesting "Static" it so i could get away from the world space/local space terminology, as it doesn't seem intuitive, and is imprecise.

    I'll keep thinking. FYI I'm about to publish a new build for testing, and it does have the "Static" rename in it for now.
     
  9. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,524
    What about "pinned" or "fixed" ?
    or maybe "solid"
     
    richardkettlewell likes this.
  10. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,285
    Lars-Steenhoff likes this.
  11. michalpiatek

    michalpiatek

    Joined:
    Feb 26, 2021
    Posts:
    81
    Oh God, you don't even know how excited and grateful I am for adding Texture Scale to the particle system. THANK YOU! It's such a massive workflow improvement!

    Would it be too much of a stretch to have separate U and V texture scale parameters?

    As for the Static texture functionality it works exactly as I imagined. I tested how it behaves with scale applied in the Transform and it also does behave as I'd expect. Great job!
     
  12. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,524
    Yes U/V separate will give more control, I would welcome this too
     
  13. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,285
    You're welcome :)

    Yes it should be easy.. depending on exactly how it should work ;-)

    So right now we just map 0->1 across the line. Let's say you set a V scale of 2, if i simply multiply that, we would be mapping 0->2 across the texture. And for a V scale of 0.5, we would map 0->0.5. Is it as simple as that?

    Or, does it need to scale around the mid-point? I.e. the center of the texture is always the centre of the line. For the above examples, this would result in:
    Scale 2: -0.5 -> 1.5
    Scale 0.5: 0.25 -> 0.75
     
  14. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,524
    I would say for my use case center is most of the time center of the line.

    For example here are some car tracks, I would cut one off them into a square and tile them on the line.

    Ideally I would like to have a seperate alpha texture so I can create some variety and break up the texture a bit, but I can also do it in a single texture if I make a long texture that is tilable.

    DE4D7C39-F3F5-4194-9F33-2215E2EA759D.jpeg
    B9BF5277-608F-4934-80FB-2A988222F6DE.jpeg
     
    richardkettlewell likes this.
  15. michalpiatek

    michalpiatek

    Joined:
    Feb 26, 2021
    Posts:
    81
    Centre point makes the most sense for me as well although you know, having actual scale aaand transform (scale and offset) controls can never hurt! But I don't know anything about cost implications so if this is too much then centre point would be the most reasonable thing to do I believe.
     
    Last edited: Jun 8, 2021
  16. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,285
    I've uploaded a new build here with U and V scaling: https://forum.unity.com/threads/world-space-trail-textures.1107389/

    No strong need from my side for you to provide feedback on this - it's pretty simple, works as you requested, and we are doing our own QA on it too ;-) But it's there if you want to try it out!

    Both good ideas.. but I think I gotta close this one out and ship it :) Perhaps we will look at adding some additional controls in a future update!

    We are pretty close to shipping this - the only bad news is that it will be coming in 2022.1, which I know is a very "far in the future build" compared to what you are probably currently working with! but at least it's coming :)

    Thanks for the feedback on this, it's been super useful!
     
    Lars-Steenhoff likes this.
  17. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,524
    Thanks for updating these tools!
    Its been a welcome addition and yes you can ship it and iterate more after shipping.

    I know it takes a while to land in a release build so I think it good to have it in there in 22.1 before the new features are locked.
     
    richardkettlewell likes this.
  18. caseyfarina

    caseyfarina

    Joined:
    Dec 22, 2016
    Posts:
    8
    @richardkettlewell Thank you so much! Is this feature in the most recent versions of 2021.2 that we can download via the hub?
    Thanks!
     
  19. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,285
    Hi, I forgot to say which version it landed in!
    It’s coming in 2022.1.0a6!

    I don’t think we have started public alphas of 2022 yet though.
     
  20. velksy

    velksy

    Joined:
    Oct 7, 2015
    Posts:
    1
    @richardkettlewell While this is working great on the Trail Renderer system, I've tried working with the static trails on particle system trails without any luck. In both 2022.1.0a13 and the specifically mentioned 2021.2.0a20, I seem to get the same behavior as DistributePerSegment. The Texture Scale field also doesn't seem to affect the scaling, no matter what texture Mode it is set to use.

    I've attached a gif to illustrate the difference I'm seeing. Perhaps I am setting something up incorrectly?

    Edit: I've figured out that this is a limitation of the ribbon type particle trail. This seems to function as expected with the particle type trail. If this is the expected/intended behavior you might consider hiding the static option, along with texture scale field when it's set to the ribbon type?
     

    Attached Files:

    Last edited: Nov 8, 2021
  21. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,285
    Thanks for the feedback. We struggled to figure out how to intuitively apply it to ribbon mode, because all the trail points might move around, there is no static point of reference.
     
  22. Lord-Megabite

    Lord-Megabite

    Joined:
    Feb 21, 2015
    Posts:
    8
    Thanks so much ! is exactly what i was looking for. I just have a question. I would like to fade out the last part of the trail renderer. When the trail starts to dissapear for example in a wheel trail, looks like too abrupt and i was thinking how i can achieve a fadeOut of the part of the trail that is going to dissapear. Can i achieve this effect in some way ? .
    Thanks in advance and really appreciate your work listening the community.
     
  23. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,285
    The color over trail Gradient setting should let you set the alpha at the end of the trail to fade it out.
     
    Lord-Megabite likes this.
  24. Lord-Megabite

    Lord-Megabite

    Joined:
    Feb 21, 2015
    Posts:
    8
    Thanks Richard, i putted the material in particles and now works like a charm. Now this tool become super useful thanks again !
     
    richardkettlewell likes this.