Search Unity

Question Multiply node previewing as a square? And shader not saving?

Discussion in 'Shader Graph' started by Yoreki, Sep 2, 2019.

  1. Yoreki

    Yoreki

    Joined:
    Apr 10, 2019
    Posts:
    2,605
    Hi everyone,
    i just had my first look at the Shader Graph and ran into problems. To get a feel for it, i was trying to create very simple shaders for learning purposes. According to images / videos i saw online, when connecting for example the multiply node to an effect, like fresnel, then the preview in the multiply node should also be this "material-sphere". For me it's just a black box. Or rather a very zoomed in square preview, since i can see some changes when adjusting the fresnel effect to extreme levels.

    multiplySquare.png

    As you can see in the main preview the changes still get applied to the master. I'd just like the multiply node to show a similar preview to the fresnel effect or main preview, which is what i saw in videos. As it is now it kind of feels absolutely useless and i'm not sure what i'm doing wrong.

    Also; is there a save button i'm missing? Because even after pressing ctrl+s, when i close Unity and start it again the shader graph is back to being empty.

    More-or-less-solved Edit: While ctrl+s did not work, saving with the hard to spot button at the top left of the window works.
    As for the multiply preview, in some videos, like below, it's shown as the material preview, while in others it's just a square.
    If anybody knows why it's sometimes a square and sometimes the material preview, i'd still love to know that. I believe i'm doing pretty much the same here. Was it changed in a recent version? I believe the material preview was way nicer if that's the case:
     
    Last edited: Sep 2, 2019
  2. alexandral_unity

    alexandral_unity

    Unity Technologies

    Joined:
    Jun 18, 2018
    Posts:
    163
    There was a bug in some versions where the preview was broken. The intended behavior is that some nodes are 2d squares by default and some are 3d objects, and the 2d preview nodes should inherit the 3d object if a 3d preview is upstream. Some versions don't have that behavior, but it should be fixed in the latest available versions in 2019.x editor versions.
     
  3. Yoreki

    Yoreki

    Joined:
    Apr 10, 2019
    Posts:
    2,605
    I'm using the 2019.1.8f1 version, which is where the problem occured. I originally worked on an older project (but with the 2019.1.8f1 editor) which is where the above problem occured. I then created a new project with the LWRP preset and it worked better, even tho it was still a 2D-representation on the multiply node. If i remember correctly tho, i believe it was at least not fully black using the same shader graph.
     
  4. arcitek

    arcitek

    Joined:
    Nov 5, 2019
    Posts:
    18
    Trying to learn some Unity Shader creation after working with Unreal for awhile. I am using 2019.2.11 and this issue of no preview that Yoreki mentioned is still occurring which is getting frustrating. It appears we were working on the same tutorial.
     
  5. ThreeRing

    ThreeRing

    Joined:
    Aug 24, 2016
    Posts:
    15
    Any news on this issue? I'm facing the same problem as well...
     
  6. bjarkeck

    bjarkeck

    Joined:
    Oct 26, 2014
    Posts:
    301
    I have a Custom Function node, ported it to a subgraph where all node previews are 2d, however when I use the subgraph as a node, it shows the preview as a sphere. Is there any way I change that to show a 2d preview?

    I'm on the latest ShaderGraph package and latest Unity 2019.3.0f3
     
    Last edited: Jan 10, 2020
    PlayCreatively likes this.
  7. alexandral_unity

    alexandral_unity

    Unity Technologies

    Joined:
    Jun 18, 2018
    Posts:
    163
    Subgraphs will always use the 3d preview by default and there's no current exposed way to change that. It's been asked for before and we hope to address it in the future but we've got some other things in the pipeline taking a higher priority at the moment. c:
     
    Bennicus likes this.
  8. alexanderameye

    alexanderameye

    Joined:
    Nov 27, 2013
    Posts:
    1,383
    You can change it in Editor>Data>Nodes>Utility>SubGraphNode (In the shadergraph package folder) on line 153 as a workaround for now if you really need it.
     
    ArkyonVeil likes this.
  9. s7887177

    s7887177

    Joined:
    Dec 21, 2019
    Posts:
    5
    How to change it? I really want to know!!
     
  10. alexandral_unity

    alexandral_unity

    Unity Technologies

    Joined:
    Jun 18, 2018
    Posts:
    163
    The workaround suggested by Alexander requires you to make a custom local copy of the Shader Graph package with modifications, which will put it into an unsupported state for upgrades. Please use it with caution.
     
    alexanderameye likes this.
  11. DrViJ

    DrViJ

    Joined:
    Feb 9, 2013
    Posts:
    163
    We really need this option to be editable. Please add a checkbox to choose what to see. It is very difficult to preview subgraphs on spheres. alexanderameye thank you for temporal (I hope it is temporal) workaround
     
    mikeustwo and ArkyonVeil like this.
  12. alexanderameye

    alexanderameye

    Joined:
    Nov 27, 2013
    Posts:
    1,383
    The workaround doesn't seem to work anymore for me on Unity 2020.1. Not having a 2D preview on my graphs really makes working with them hard for some of my shaders. I hope this toggle gets added soon :)
     
    mikeustwo likes this.
  13. Bennicus

    Bennicus

    Joined:
    Dec 20, 2013
    Posts:
    1
    Another vote for being able to choose a 2d preview for subgraphs, or at least providing it as an option on the preview node! Especially when you start nesting subgraphs, I'm basically unable to see what I'm doing at anything except the lowest level.
     
    mikeustwo and kai303 like this.
  14. alexandral_unity

    alexandral_unity

    Unity Technologies

    Joined:
    Jun 18, 2018
    Posts:
    163
    Please see our public roadmap if you would like to vote on potential new features. We can't properly track requests on the forums very well, but if you vote on our roadmap it's hard numbers that we can reference when prioritizing tasks. c:
     
    DrViJ and chrismarch like this.
  15. gabrielgonzalez89

    gabrielgonzalez89

    Joined:
    Sep 16, 2019
    Posts:
    22
    Dang , that was something That I'd love to have , it would make it much easier to be able to have a custom mesh on some of that nodes to test things like vertex color and such...
     
  16. alexanderameye

    alexanderameye

    Joined:
    Nov 27, 2013
    Posts:
    1,383
    gabrielgonzalez89 likes this.