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

Feature Request A Way To Expose Uv Channel So You Can Change It In The Inspector

Discussion in 'Shader Graph' started by CosmosBear, Apr 12, 2019.

  1. CosmosBear

    CosmosBear

    Joined:
    Aug 2, 2012
    Posts:
    67
    Hi,

    I noticed that there is no easy way to expose the UV channel (UV1 to UV4) from property to the inspector so you can change it without having to modify the shader.
     
    awesomedata and Horus_Sungod42 like this.
  2. alexandral_unity

    alexandral_unity

    Unity Technologies

    Joined:
    Jun 18, 2018
    Posts:
    163
    We can take a look at exposing this, but no promised timeline on implementation. c:
     
    enhawk and awesomedata like this.
  3. alexandre-fiset

    alexandre-fiset

    Joined:
    Mar 19, 2012
    Posts:
    714
    It would be nice if we could have everything in hands to (at least) replicate the standard Lit shader provided by Unity with the Shader Graph.

    It would even be nicer if these standard shaders were actually shader graphs so we could tweak them out of the box instead of having to recreate them blindfolded and with limitations such as unexeposable parameters.
     
  4. enhawk

    enhawk

    Joined:
    Aug 22, 2013
    Posts:
    833
    One definite use case is putting custom oculusion maps that don’t share UV0 layout on art assets.

    Would be a welcome feature
     
  5. Why485

    Why485

    Joined:
    Jun 30, 2013
    Posts:
    45
    @alexandral_unity Was there any update to this? I need a way to change between UV channels at runtime, and exposing the channel as an option that can be selected in the Inspector would be the easiest way.
     
  6. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,329
    Can be implemented now using a Keyword Enum.
     
  7. Why485

    Why485

    Joined:
    Jun 30, 2013
    Posts:
    45
    Can you give an example? I tried messing with it this morning, but there's no way to feed anything into the UV channel select input.
     
  8. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,329
    You need to have multiple UV nodes set to different UV sets and use Keyword nodes to select between their outputs.
     
  9. Why485

    Why485

    Joined:
    Jun 30, 2013
    Posts:
    45
    I'm still not clear on how the enum node is meant to be used, but I managed to get what I needed through a lerp between the two channels instead. I don't need more than two channels.

     
    Riva3000 likes this.
  10. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,329
    That works, though you might be better off using a Boolean property and a Branch node.

    The Keyword Enum based approach looks like this:
    upload_2020-4-16_11-0-37.png
     
    Rumbleball, Dre0Dru, sipon and 2 others like this.
  11. Rumbleball

    Rumbleball

    Joined:
    Feb 25, 2022
    Posts:
    5
    Thanks, works like a charm
     
  12. VicLi2023

    VicLi2023

    Joined:
    May 23, 2023
    Posts:
    1
    Thanks a lot .This is exactly what I want .
    But I have a new problem now .
    I try to expose the options for UV channel and RGBA channel forDiffuse ,Normal and Metallic using the same method .
    It shows I passed the keyword limit and I have already set to 1024 .
    Any solution ? Thanks