Dissolve Effect in Unity Shader Graph

Поділитися
Вставка
  • Опубліковано 3 жов 2024

КОМЕНТАРІ • 74

  • @MarcWithaC-BlenderAndGameDev
    @MarcWithaC-BlenderAndGameDev Рік тому +55

    If anyone's trying to figure this out in 2023 (2021.3.16f1), here are my notes on what appears to have changed since this video was posted:
    PBR graph is now Create->Shader Graph->URP->Lit Shader Graph
    -Select graph inspector window
    -Select Graph Settings tab
    -Set surface Type to transparent (Makes the Alpha property show up in Fragment)
    Properties now show up in a separate window called Graph Inspector, not directly below the items in the shader graph
    Albedo is now Base color
    Vector1 is now Float
    Instead of selecting 2 sided rendering
    -Select Graph inspector
    -Select graph settings tab
    -Set 'Render face' to _Both_ in 'Graph Inspector'
    Main Preview sometimes shows all teal until you drag it and then it refreshes (at least for me it does).

    • @danielilett
      @danielilett  Рік тому +5

      This is a good summary of what's changed since I posted this video, thanks! Lots of small changes happened to Shader Graph over the years.

    • @billmolloy2264
      @billmolloy2264 6 місяців тому

      Please pin Marc's comment @@danielilett

  • @mikemiller5543
    @mikemiller5543 4 роки тому +58

    You only took 4.5 minutes to explain what other people take a full hour to explain. This is exactly how tutorials should be made. Great job!!

  • @johnes2337
    @johnes2337 4 роки тому +9

    I really hope this channel blows up!

    • @johnes2337
      @johnes2337 4 роки тому +3

      It appears that it has!

  • @camelmotion2685
    @camelmotion2685 4 місяці тому +1

    Thank you, straight to the point, everything works even on complicated geometry

  • @kickcreator_dev
    @kickcreator_dev 2 роки тому +1

    Yes, yes, yes, YESSSS!
    Thank you, random person of the internet, in unity 2021 its quite a bit diferent to make following your tutorial... BUT FINALLY!! (after 3 days) i learned how to add this cool efect on my game, thanks soooo much dude😁👍

  • @NickM-dw2zc
    @NickM-dw2zc Рік тому +4

    Love the tutorial! Some feedback though- might be a little easier to use if, at the end, you quickly zoomed out and showed the whole graph & expanded all the parameter tabs to show the default values. That way, if a viewer missed a step they wont have to dig back through the entire thing to be able to fix it.

  • @kang9517
    @kang9517 Місяць тому

    For anyone who doesnt have emission outline(i got it in HDRP)
    You gotta add Emission Node by yourself, connect Multiply Out to Emission Node (Color and Intensity), then the output connect to Emission property in Fragment section

  • @TheKarchi
    @TheKarchi 2 роки тому +1

    Short and informative. Great job!

  • @archmagesalamar1377
    @archmagesalamar1377 3 роки тому +1

    Just found you and immediately subscribed. Excellent tutorial. Thanks

  • @VyvyanTheGreat
    @VyvyanTheGreat 3 роки тому +3

    This was super helpful, thank you!

  • @someonesomewhere1975
    @someonesomewhere1975 2 роки тому +1

    Short and on point. Would be nice to have an updated version for this for the new unity versions/shader graphs/

    • @danielilett
      @danielilett  2 роки тому

      A lot of my older videos were made just before Unity changed how Shader Graph works a bit, so I definitely agree. There are many ways to do a dissolve effect so I'd probably try to do something a bit different, or at least add to this effect somehow!

  • @ramkillnani8293
    @ramkillnani8293 3 роки тому +4

    Doesn't work in HDRP. Can't seem to get the outline colour to pop up. It dissolves without any outline or edge colour.

  • @mk3suprafy
    @mk3suprafy 4 роки тому +1

    If you have trouble with transparency, the alpha clip also get set to .5 from 0.

  • @xcrimson4017
    @xcrimson4017 3 роки тому +1

    wow good video i found out late! keep it up!

  • @xsoniq344
    @xsoniq344 2 роки тому

    thanks dude!! useful lesson

  • @Kalahee
    @Kalahee 3 роки тому +2

    Main issue here I have with this is position node in World mode if object moves above Cutoff Height it also gets dissolved. Changing to Object mode, Cutoff Height is on pixel's local position and somewhat goes from +height/2 to -height/2, but not perfect due to Edge width and Noise strength. Anyway, I've at least managed to add a customizable direction to this.

    • @pixitales5017
      @pixitales5017 2 роки тому

      Im getting the same issue too, how did u add your customizable direction?

  • @AMVWORLDYT
    @AMVWORLDYT 3 роки тому +2

    Hi Daniel, is there any way to rotate the shader? if i rotate the object, the shader continue applying the effect in vertical

    • @danielilett
      @danielilett  3 роки тому +2

      Yes! You'll notice I used the world position when defining where the cutoff point is. If you instead use the object position, then the dissolve effect will rotate with the object. You might need to tweak the values you use for the cutoff point though.

    • @AMVWORLDYT
      @AMVWORLDYT 3 роки тому +1

      @@danielilett We got it!! thanks man, works really good, you have new active sub ^^

    • @AMVWORLDYT
      @AMVWORLDYT 3 роки тому

      Hey Daniel, can I ask you another question?
      I implemented this on a 2D Project URP, but the material is not shining as your video,
      I did the post processing as well but not shine.
      Any idea?
      Thanks a lot

    • @danielilett
      @danielilett  3 роки тому

      You should be able to add Bloom to your post processing effect list to make the material shine. But you're saying this is in 2D? I'm not sure how that will effect things. What does your post processing setup look like?

    • @AMVWORLDYT
      @AMVWORLDYT 3 роки тому

      @@danielilett same as your proyect
      Maybe I need to have a look to my light settings or check the post processing again
      No problem, thanks ❤

  • @2ksp235
    @2ksp235 2 роки тому +1

    Great video thx. Can you pls make an example with code like on trigger this dissolve effect happens? i am learning to code and also unity

  • @Coolkidstan
    @Coolkidstan 4 місяці тому

    For me the emission either goes in the gaps where the alpha is or when i flip the last step node it will go in the opaque parts but not have an edge between the 2 layers

  • @anferrr
    @anferrr 3 роки тому

    Hey, I have a question, first of great lesson. I spent all night looking up shader stuff and this is by far my favorite video. Second, how would one go about using an ellipse as a mask instead of a height value. I've had ideas but that addition of noise + y value gets me confused ^^'

  • @yuriaugusto1084
    @yuriaugusto1084 4 роки тому +1

    I'm trying for almost 4h to make this shader work but everthing he does it's dissolve when my Y is above or underneath 0 maybe unity changed something and that's why don't work... great tutorial however.

  • @GameGourmand
    @GameGourmand 3 роки тому +1

    I was trying to use this for soldiers but I don't want to keep them transparent because their materials and shadows are glitching. Is there any suggestion? I don't want to replace after dissolve animation end it doesn't look good.

    • @GameGourmand
      @GameGourmand 3 роки тому

      If someone wonder about the solution I fixed it by using AlphaTreshold and kept the material Opaque, for more information check Brackey's Dissolve example on UA-cam.

  • @sunnykwan5630
    @sunnykwan5630 Рік тому

    Another question: how to make the character not dissolve at the start?

  • @gctk24
    @gctk24 3 роки тому +1

    I even cloned your project to find out what I did wrong. but for some reason the shader turns the Object invisible in scene. but is working in shadergraph and the material preview. any help ?

    • @gctk24
      @gctk24 3 роки тому +1

      Found out what the problem was. I did not UV map my model

  • @StickyLabDev
    @StickyLabDev 6 місяців тому

    the problem is , material have texture

  • @WaiHanLim
    @WaiHanLim Рік тому

    how to disable the dissolve keep repeating? I just want to dissolve once then stop

  • @beecee793
    @beecee793 3 роки тому

    Is there a way to dynamically create the remap values so that they do not need to be edited based on the noise map if/when it is changed?

  • @blackjackmack4709
    @blackjackmack4709 4 роки тому +1

    I came here because of dani i hope your subscriber army sky rockets

  • @DRT-81
    @DRT-81 2 роки тому

    I am using dissolve in a 2d project and the base player sprite & animation is a ghost when i add the dissolve material , any help would be appreciated to get the base sprite to appear correctly , i have the effect on script spacebar key .

  • @stylie473joker5
    @stylie473joker5 Рік тому

    For some reason the object i add this shader to becomes invisible
    Edit: I had to change Position from world space to Object space for it to work due to How Urp has changed

  • @SBRSR.
    @SBRSR. 2 роки тому +1

    Hi Thanks for this Tutorial, Super cool. But I do not have PBR graph in my 2020 Unity version. Could you please help how to get that please.

    • @danielilett
      @danielilett  2 роки тому +3

      Later versions renamed some things. The equivalent to PBR Graph is Lit Graph, which both URP and HDRP should have. The outputs of the graph will look a bit different, but ultimately everything in the tutorial should work pretty much the same!

    • @SBRSR.
      @SBRSR. 2 роки тому

      @@danielilett Thank you so much Daniel. I appreciate your support.

  • @salihcakmak1391
    @salihcakmak1391 4 роки тому

    will not appear when the game starts. It will appear when I go to it. how can i do that please help

  • @tinytea3323
    @tinytea3323 3 роки тому

    Sorry I tried using the lit shader graph with URP but there is no option to set the shader to opaque and alpha. I tried using transparent and alpha instead but the shadow does not seem to change with the noise. Any idea how to fix this?

  • @Vundeq
    @Vundeq Рік тому

    i get a visible seam at the back of the sphere. how can i eliminate this?

    • @TheWolfProd
      @TheWolfProd 11 місяців тому

      You need to deselect "Preserve Specular Lighting" in Graph Inspector.

  • @toysinjammies1613
    @toysinjammies1613 2 роки тому

    the new? shader graph only gives me the option to start a blank shader, not PBR. Is there a package I can download that has the other options?

    • @danielilett
      @danielilett  2 роки тому

      The options changed after this tutorial was published! Now you should see a Universal Render Pipeline drop-down alongside the option for Blank Shader Graph. In that drop-down, pick 'Lit Shader Graph' - that's the new name for PBR Graph. Hope that helps!

  • @sunnykwan5630
    @sunnykwan5630 Рік тому

    I want to add this dissolve effect to the enemy, how can I keep the base color of the material? The character is from other asset and the color is already set up. Right now, when I apply this shader to the original material of the character, my character becomes transparent. How to solve this? Thank you.
    ps: I using URP and the original shade is URP/Lit.

    • @sunnykwan5630
      @sunnykwan5630 Рік тому

      OK. I figured out. For anyone with same problem. You need to add a texture 2d node and add your texture of original material. Then link to a "Sample texture 2d" and link to the base color.

  • @koniipinka7923
    @koniipinka7923 3 роки тому

    Can i add that in 3d text?

  • @ng1048
    @ng1048 3 роки тому

    Can you share the shader? Huge thanks

  • @shirokatake3285
    @shirokatake3285 4 роки тому

    The caveat of this is it doesn't work for multiple objects separately. How would you make it so we can change the "dissolve amount" for each assigned object differently?

    • @danielilett
      @danielilett  4 роки тому +1

      If you want to use a different dissolve amount per object, you can either assign separate materials to each object and tweak their properties accordingly, or use a single material and change the values on each instance through scripting, something like this:
      var material = GetComponent().material;
      material.SetFloat("_CutoffHeight", height);
      where 'height' is some variable you change per object. Hope that helps!

    • @xXYannuschXx
      @xXYannuschXx Рік тому

      @@danielilett Doesnt this need to be done using a MaterialPropertyBlock, or else it will also just edit the material for all instances using the same one?

  • @jonahblack2000
    @jonahblack2000 2 роки тому

    Hey, how can I make the undisolved part be semi transparent? I guess that there has to be some part of the code where you can change how intense the undisolved parts are, but maybe I am mistaken. Thanks

    • @jonahblack2000
      @jonahblack2000 2 роки тому

      Nevermind, I figured it out, you just multiply the output from the maps and then output that into the alpha

    • @jonahblack2000
      @jonahblack2000 2 роки тому

      well that is actually not it yet, but better than nothing, as that will also make the edge emission transparent too

    • @jonahblack2000
      @jonahblack2000 2 роки тому +1

      Ok.. figured out how to do it. It is a bit more complicated but not really:
      1) After we've created both the "edge map" and the "main body map" we multiply those to get a "only/true edge map".
      2) After that we multiply the "main body map" by a vector1 "_alpha" (min 0; max 1) which is editable. That will create a "see-through main body map"
      3) After we have that we add the "true edge map" and the "see-through main body map", which will ensure that the edge is always visible, while the rest of the body will be see through.
      4) At long last we put that output into the alpha node.

  • @hotsauce7124
    @hotsauce7124 3 роки тому

    Can this PBR shader be triggered in Timeline?

    • @danielilett
      @danielilett  3 роки тому

      I think so. I've not used Timeline before so I don't know if you can directly change the properties of a material using it, but you can certainly change materials in an animation clip, then use that clip in Timeline!

  • @PauloHF18
    @PauloHF18 3 роки тому

    I'm trying to do this on Shader Graph 10.2.2, but there's no 'PBR' anymore, the best I did was with 'Sprite Lit Shader Graph', but there's no Emission and Albedo Input.
    Someone know how to do it?

    • @danielilett
      @danielilett  3 роки тому +3

      I'm super late, but on later versions of Shader Graph you can add new shader outputs directly to the Fragment stage by right-clicking. You'll probably want to start with a Lit Shader Graph rather than Sprite Lit - Albedo is now just called "Base Color", and you can add Emission yourself!

    • @PauloHF18
      @PauloHF18 3 роки тому

      @@danielilett Finally it's working perfectly, thanks 🎉

    • @risingmermo
      @risingmermo 2 роки тому

      @@PauloHF18 how did you get it to work? I did everything on shader graph but the material isn't even showing on the object

    • @PauloHF18
      @PauloHF18 2 роки тому

      @@risingmermo I just did what Daniel said, I'm not the best person to help you, but in my case, what Daniel said to do, solved my problem.

    • @risingmermo
      @risingmermo 2 роки тому

      @@PauloHF18 nvm, I managed to fix it.

  • @gameplay_factory
    @gameplay_factory 3 роки тому

    Is this works for URP ?

    • @danielilett
      @danielilett  2 роки тому

      Yep! This shader was designed specifically for URP, so it should work.

  • @JuanPablodelaTorre
    @JuanPablodelaTorre 4 роки тому +1

    This is witchcraft