Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Can I re-sort the preperty of custom shader in Output Context

Discussion in 'Visual Effect Graph' started by shibi2017, Mar 30, 2022.

  1. shibi2017

    shibi2017

    Joined:
    Jan 18, 2018
    Posts:
    153
    When I work with my own vfxshader, the vfx output always become a mass:
    upload_2022-3-30_15-54-29.png
    I can re-sort the property in shader graph editor but can not sort them in vfx. Is there anyways to achieve it?
     
  2. Qriva

    Qriva

    Joined:
    Jun 30, 2019
    Posts:
    1,296
    I mentioned that problem in my feedback thread and sadly properties inside VFX graph are not categorized and not ordered in the same way as in shader graph, instead they are ordered by creation time.

    I was very curious if I can fix that manually by editing the serialized asset and this is possible.
    However you do it at your own risk - I have no clue if this is safe and not going to break anything later.

    When you open serialized shader graph file in text editor you can find array
    m_Properties
    close to
    UnityEditor.ShaderGraph.GraphData
    , im my case literally first 10 lines in the file. Looks like this array of id is responsible for the order of properties and if you change order here it should change in VFX graph too.
    If you want to know what is what, you can search id in the file and there will by somewhere definition of property with display name and other settings.
     
  3. Vita-

    Vita-

    Unity Technologies

    Joined:
    Jul 2, 2019
    Posts:
    121
    Hi, indeed we weren't able to reorder Shader Graph properties in the past, but it changed now! We recently improved Shader Graph property re-ordering workflow in VFX Graph. We are still lacking category UI, but it is now possible to reorder properties, categories and properties within the same category. This fix is available in 22.1 and above and is going to be improved in the future.

    Cheers!

    Unity_7jbbYaFzOV.gif
     
    Qriva likes this.
  4. shibi2017

    shibi2017

    Joined:
    Jan 18, 2018
    Posts:
    153
    wow! Exciting news! Love you! thank you for you work!!
     
  5. shibi2017

    shibi2017

    Joined:
    Jan 18, 2018
    Posts:
    153
    Thanks for your reply and really helpful! And check the answer from unity under your answer! its a good news! at least we can re-sort them!
     
    Qriva likes this.
  6. Qriva

    Qriva

    Joined:
    Jun 30, 2019
    Posts:
    1,296
    Nice! Good to see it's implemented, nevertheless at this moment Unity 2022 is in quite early in development, plus someone might need to ship the project in lower version. The question is: Is it safe to edit property order manually?
     
  7. Vita-

    Vita-

    Unity Technologies

    Joined:
    Jul 2, 2019
    Posts:
    121
    Good question! The thing is that we aren't able to reorder properties by just reordering property ids in serialized ShaderGraph file. And to answer your question, no it is never safe to change a file by using a text editor, this can lead to unexpected behavior really quickly. Let's say that we are able to reorder properties this way, but if you are not careful enough this could quickly lead to unlinked slot in VFX that is tied with SG exposed properties, for example.
     
    Qriva likes this.
  8. Azeew

    Azeew

    Joined:
    Jul 11, 2021
    Posts:
    49
    Are these changes eventually gonna make their way into Unity 2021?
    From what I understand, we are highly recommended to stay in LTS versions of Unity... so even if this is already fixed, are we effectively going to stay for over a year without this change until 2022 LTS comes out?
    Sorry if this is obvious, I'm a bit unfamiliar with how Unity versions are handled.
     
    Vita- likes this.
  9. Vita-

    Vita-

    Unity Technologies

    Joined:
    Jul 2, 2019
    Posts:
    121
    @Azeew If fix cannot be backported to 21.2, I am afraid but this will be available only from 22.1 and above. Let me double check with the team if there's a possibility to backport it to 21.2. :)

    Cheers
     
    Azeew likes this.
  10. Vita-

    Vita-

    Unity Technologies

    Joined:
    Jul 2, 2019
    Posts:
    121
    Hi all! Backport to 2021.3 has been approved and awaiting to be merged. :)
     
    Azeew and Qriva like this.
  11. Azeew

    Azeew

    Joined:
    Jul 11, 2021
    Posts:
    49
    That's amazing!! Thanks a lot :)