Search Unity

► Advanced Dissolve ◄

Discussion in 'Assets and Asset Store' started by Arkhivrag, Feb 13, 2018.

  1. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,984
    pcg, Emile97 and DrOcto like this.
  2. Necka_

    Necka_

    Joined:
    Jan 22, 2018
    Posts:
    488
    Hello,

    I was wondering if you would have an idea on how to use your shader as a see through tool, a bit like in Divinity Original Sin 2

    Applying the shader to the environment isn't an issue, I'm wondering how to apply the effect dynamically when the player is obstructed and that it dissolves only where the player is obstructed. Would you have an idea on how you'd do that?
     
    Last edited: Sep 2, 2018
    TeagansDad likes this.
  3. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,984
    Try:

    1. All meshes you need to see through assign Advanced Dissolve shader with Cylinder mask type and select Mask Only Global Control inside material editor.
    Mask Only enabled Global Control will help you to control mask properties on all materials at once.

    2. In the scene use one instance of Controller_Mask_Cylinder_Alt.cs script and enable Update Global checkbox.
    Inside script update cylinder1 parameters:
    Position - this is your camera position.
    Normal - Camera's forward vector. This is look at direction from camera to your character.
    Height - Distance from camera to the character (this value may be slightly bigger).

    3. If you need to disable 'see through', just make Height parameter minimal, like zero.

    4. You can control dissolve edge color and noise globally too.


    VacuumShaders - Facebook Twitter YouTube
     
    TeagansDad likes this.
  4. Necka_

    Necka_

    Joined:
    Jan 22, 2018
    Posts:
    488
    Terrific! I wasn't aware of this alt script which makes things a little bit simpler here. It's not yet all good but now I've got what I need to fine tune that, and it looks promising!

    Just got one more question regarding the mask controller, is there any already built-in script that would gather automatically all the materials that has the dissolve shader in "start" or should input them manually (or by my own script of course). ?

    thanks a lot for this
     
  5. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,984
    Demo scene includes CollectDissolveMaterials script.



    VacuumShaders - Facebook Twitter YouTube
     
    Necka_ likes this.
  6. graphsynergie

    graphsynergie

    Joined:
    Sep 19, 2016
    Posts:
    2
    Hi, It may sound a little bit stupid, but how do you turn off a plane mask effect? Disabling the controller script or the plane mask don't stop the masking. I have read the documentation but I can't find anything about that.
    Thank you! (Great plugin btw :) )
     
  7. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,984
    You can just move plane mask object far away and then disable controller script or disable mask keyword for each material from custom script:
    Code (CSharp):
    1. material.DisableKeyword("_DISSOLVEMASK_PLANE");


    VacuumShaders - Facebook Twitter YouTube
     
  8. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,984
    Advanced Dissolve now is compatible with Lightweight Render Pipeline.
    Dissolve_LWRP.gif

    Note, included LWRP shaders are temporarily bonus and will be released as a separate package after they leave preview mode.



    VacuumShaders - Facebook Twitter YouTube
     
    Last edited: Sep 28, 2018
    Rowlan likes this.
  9. tayhig

    tayhig

    Joined:
    Aug 4, 2017
    Posts:
    2
    Hi there, how does one recreate this, it is awesome, been trying but can't figure it out, please help, I would like to create it with a box mask.
     
    Last edited: Sep 17, 2018
  10. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,984
    All materials use Sphere mask (in this case) and one Sphere object to control mask on all materials.
    Scene contains two instances of the Controller_Mask_Sphere scripts reading data from that Sphere object, but one script has Invert option enabled.
    Now you just decide objects you want to be inside or outside of Sphere mask and assign there materials to the one of the Controller_Mask_Sphere scripts materials array.

    Check attached package, it contains example scene (build using Unity 2018.2.5)



    VacuumShaders - Facebook Twitter YouTube
     

    Attached Files:

  11. tayhig

    tayhig

    Joined:
    Aug 4, 2017
    Posts:
    2
    awesome stuff ! thanks very much !
     
  12. HidingGlass

    HidingGlass

    Joined:
    Apr 29, 2015
    Posts:
    25
    We've really enjoyed using your shader so far. Unfortunately we're recognizing an issue with it that's more evident on mobile. We're using the shader to transition on models in an AR experience (running on iPad Pro). The models dissolve on perfectly and performance is fine when the entire model is in view. However, when we use the ipad to get in close to the model (like you were going to look closer at the details), there is a massive GPU spike that kills our frame rate.

    From the Profiler, we can see that Mesh.Render has fewer draw calls closer up, but is taking almost 2 times as long to render a frame. We are using Advanced Dissolve/Standard/Metalic and we've narrowed the issue down to your shader because when we change all the materials into normal Standard/Metalic shaders, we do not get this performance hit.

    I was wondering if you had any ideas as to why the shader is eating so much GPU and only when the camera is closer to it. After the model dissolves in, we basically just need it to act like a normal Standard shader so is there something we can disable once the transition is complete so we get the same performance as a normal Standard Shader?

    I purchaced and downloaded the asset on 8/22/18 and I believe there is a newer version that has been released. Do you know if updating would fix this issue?

    Unity 2018.2.3
    iPad Pro
    All baked shadows (dynamic shadows off)

    Thank you!
     
  13. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,984
    Standard/Metalic is an opaque shader and it will be rendered fast.
    What about enabling Cutout in the Rendering Mode? How is the performance with it?
    upload_2018-9-21_18-54-59.png

    Some mobile GPU's are very slow doing AlphaTest in the shaders. Same problem is here.



    VacuumShaders - Facebook Twitter YouTube
     
  14. HidingGlass

    HidingGlass

    Joined:
    Apr 29, 2015
    Posts:
    25
    Thanks for getting to this so quickly.
    OK I see. Does the Dissolve/Standard shader always act like a Cutout even if its Rendering Mode is set to Opaque?

    Here are the results of some different combinations, testing with one material on all meshes:

    Dissolve/Standard/Metalic - OPAQUE - 40FPS
    Dissolve/Standard/Metalic - CUTOUT - 34FPS
    Standard/Metalic - OPAQUE - 60FPS
    Standard/Metalic - CUTOUT - 48FPS

    If AlphaTest is the problem, is it possible to enable that during the transition and disable it in the shader after the objects are finished building? Or do I need to swap the Dissolve Shader for a default standard shader after it's built? (There are about 20 materials per object so best case scenario is the former).
     
  15. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,984
    Advanced Dissolve shader always is CUTOUT.

    Difference between Opaque and Cutout options inside material editor is:
    1) Opaque - Only Advanced Dissolve effect is cutoff.
    2) Cutout - Additional to Advanced Dissolve cutoff effect, MainMap's (Albedo) alpha channel is also cutoff. Such shaders are good for dissolving for example Trees, Grass or Foliage type objects and contain two AlphaTest operators respectively. If those shaders are heavy for mobile, I can advice:
    1) Replace Standard shaders on mobile with VertexLit or One Directional Light shaders.
    2) Do not use Cutout dissolve shaders, but instead inside Advanvanced Dissolve Cutout Source use Two Custom Maps option if possible.
    3) Make sure Emission is not enabled. Global Illumination is not for mobiles.
    4) Avoid Triplanar mapping, it will be heavy for mobiles.



    VacuumShaders - Facebook Twitter YouTube
     
    Lorrak likes this.
  16. HidingGlass

    HidingGlass

    Joined:
    Apr 29, 2015
    Posts:
    25
    OK awesome. My profiler results make a lot more sense now. Those are all great suggestions but unfortunately I don't think a lot apply currently.

    1)Unfortunately these materials rely heavily on PBR workflow.
    2)I am using Opaque Dissolve Shaders
    3)Emission is disabled
    4)I am using Mask>Type>XYZ Axis, Cutout>Mapping>Normal

    Do you know if there is any way at run-time to disable the AdvancedDissolve AlphaTest so I can toggle it off when it is not dissolving and it just acts like the stock Standard Shader? I'm not great at HLSL but if you point me to the right section I can try to get it working. Otherwise it seems like I'll need to swap the materials after the dissolve.
     
  17. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,984
    It is not possible to disable AlphaTest, unfortunately.
    In your case you will have to swap materials.



    VacuumShaders - Facebook Twitter YouTube
     
  18. HidingGlass

    HidingGlass

    Joined:
    Apr 29, 2015
    Posts:
    25
    More than fair. I appreciate all of the help in diagnosing the problem. The AlphaTest issue will definitely change how I think about developing for mobile.

    A+ asset and support!
     
  19. Kriszo91

    Kriszo91

    Joined:
    Mar 26, 2015
    Posts:
    181
    HDRP support are planned?
     
  20. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,984
  21. Necka_

    Necka_

    Joined:
    Jan 22, 2018
    Posts:
    488
    Hi @Arkhivrag,

    I'm not sure if it's a bug or if it's just me being a noob (that's totally possible!)

    But I wanted to use the Standard Roughness shader so I can make use of my roughness maps.

    There is a difference between the Unity Standard Roughness and the Advanced Dissolve one:

    upload_2018-9-27_13-44-55.png
    upload_2018-9-27_13-45-10.png

    There is no Roughness texture slot in there

    I was preparing all my materials to add the Dissolve shader, and now I'm wondering how to proceed
     
  22. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,984
    Download new update v2018.14.
    Several GUI bugs are fixed, including Standard Roughness shader GUI.



    VacuumShaders - Facebook Twitter YouTube
     
  23. Dougomite

    Dougomite

    Joined:
    Jul 15, 2011
    Posts:
    58
    Hey, loving the shaders so far.

    Had a request though, would it be possible to add the ability to change the rotation of the end result. Just something near the end like:

    Code (CSharp):
    1. void vert (inout appdata_full v) {
    2.             float sinX = sin ( _Rotation );
    3.             float cosX = cos ( _Rotation );
    4.             float sinY = sin ( _Rotation );
    5.             float2x2 rotationMatrix = float2x2( cosX, -sinX, sinY, cosX);
    6.             v.texcoord.xy = mul ( v.texcoord.xy, rotationMatrix );
    7.         }
     
  24. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,984
    Rotating what? Dissolve textures, MainMap or all textures.
    Can you send me example (gif or video) usage of it?
    If it adds something special and interesting effect, I may add it.



    VacuumShaders - Facebook Twitter YouTube
     
  25. anficyon

    anficyon

    Joined:
    Jan 30, 2018
    Posts:
    4
    how can i do this effect?
    , i am new with this shader
    upload_2018-10-5_22-48-27.png
     
  26. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,984
  27. pshawt2

    pshawt2

    Joined:
    Mar 24, 2017
    Posts:
    15
    Would you mind telling me which shaders work with LWRP? I bought the plugin because it said there was LWRP shaders but when I try to use them in my project they are all pink.
     
  28. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,984
    1. Make sure Render-pipeline.lightweight (v.3.0.0) is installed.
    upload_2018-10-11_11-51-49.png

    2. Graphic Setting is using Lightweight Pipeline Asset
    upload_2018-10-11_12-0-2.png

    3. Now you can import LWRP shaders from Assets\VacuumShaders\Advanced Dissolve\Packages folder.
    After that remove original Advanced Dissolve folder to avoid script compilation errors.



    VacuumShaders - Facebook Twitter YouTube
     
    DrOcto likes this.
  29. pshawt2

    pshawt2

    Joined:
    Mar 24, 2017
    Posts:
    15
    My project doesn't contain the packages folder. What am I missing?

    Screenshot.png
     
  30. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,984
    Package is submitted using Unity 2017.4.10 and 2018.2.5

    You are using 2018.2.1 and Unity editor downloads asset for Unity 2017.x, because your Unity engine version does not meet minimum required version (in your case 2018.2.5).

    Just upgrade Unity to 2018.2.5 and re-download asset.



    VacuumShaders - Facebook Twitter YouTube
     
  31. pshawt2

    pshawt2

    Joined:
    Mar 24, 2017
    Posts:
    15
    Thank you so much!
     
  32. Wolk

    Wolk

    Joined:
    Jul 12, 2014
    Posts:
    59
    Any idea how to use the disolve shader with showing internals? Eg, like a binary mesh operation, so that you would actually see what's inside a person or maybe how half a block of wood would look like. Thanks!
     
  33. ibrar_unity

    ibrar_unity

    Joined:
    Feb 12, 2018
    Posts:
    1
    Hi, i am admire your work and have purchased this asset from asset store. i am building your "5.Plane" scene for webGl but somehow its not working in WebGl. here i am attaching the screen shot and console file. Plz help me as I really needed to use this effect in my project.
     

    Attached Files:

  34. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,984
    Not sure what may be the problem at your side.
    upload_2018-10-18_13-37-17.png

    That scene uses SM4 shaders and may be your device can not handle them?

    Try adding Assets\VacuumShaders\Advanced Dissolve\Shaders\VertexLit\VertexLit.shader to the Always Included Shaders array of Graphics Settings.
    Or change scene shaders to simple ones, like VertexLit, One Directional Light, or Legacy shaders.


    VacuumShaders - Facebook Twitter YouTube
     
  35. CtrlVDev02

    CtrlVDev02

    Joined:
    Jan 6, 2017
    Posts:
    2
    I've tried opening the demo scene in Unity, however the edge effects/colors are a lot duller than the ones I see in the demo video. Is there something I'm forgetting to turn on? How can I reproduce exactly what was demoed in the video
     
  36. discofhc

    discofhc

    Joined:
    Dec 18, 2017
    Posts:
    47
    Your dissolve package is very great, congrats!
    I am interested on how did you achieve the volumetric light effect of some of the samples... is it part of your asset? Is it a shader?
    Thanks.
     
  37. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,984
    Example scenes do not use image effects. Download them from the Asset Store. e.g. Post Processing Stack.


    Package includes demo scenes using exactly that volumetric light effect.



    VacuumShaders - Facebook Twitter YouTube
     
  38. CtrlVDev02

    CtrlVDev02

    Joined:
    Jan 6, 2017
    Posts:
    2
    May I ask which image effects you used, and what settings they were set on?
     
  39. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,984
    Mostly bloom, adjust color correction and eye adaptation for your needs. Add screen space reflation for deferred rendering.



    VacuumShaders - Facebook Twitter YouTube
     
    CtrlVDev02 likes this.
  40. thegrailvr

    thegrailvr

    Joined:
    Jul 19, 2018
    Posts:
    11
    instead of light render pipeline, What other render pipelines are supported?
     
  41. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,984
    Standard built-in and Lightweight.



    VacuumShaders - Facebook Twitter YouTube
     
  42. gt_Jon

    gt_Jon

    Joined:
    Oct 15, 2018
    Posts:
    2
    I'm looking into this Asset, but I had a quick question.
    Would it be possible to use the edge of the dissolve as the emission source for a particle system?
     
  43. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,984
    I do not think Unity supports shader based particle emission. Or am I missing something o_O



    VacuumShaders - Facebook Twitter YouTube
     
  44. Emile97

    Emile97

    Joined:
    May 28, 2017
    Posts:
    105
    You're the best!! Was just about to ask that question lol.. I'll be buying your asset soon :)
     
  45. contempt

    contempt

    Joined:
    Jul 31, 2012
    Posts:
    88
    I purchased your Advanced Dissolve shader today with the hopes of implementing a gradient fade to transparent of a 3D model such that the top of the model is fully opaque and the bottom is fully transparent. I have not been able to achieve the correct look that I require. Can you suggest a method to implement a gradient faded transparent model using Advanced Dissolve shader? Thanks in advance.
     
  46. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,984
    You can dissolve (cutout) object gradually from bottom to top, as demonstrated in promo materials. But controlling transparency the same way - no.



    VacuumShaders - Facebook Twitter YouTube
     
  47. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    578
    Hi, I'm using your speedtree shaders at runtime to add to a prefab of the tree after it;s been chopped down... I've just made this code and wandering how I can set the tiling of the two custom cutout maps.. cheers for your help
    Jim

    Code (CSharp):
    1. MeshRenderer[] myRenders = HarvestDupe.GetComponentsInChildren<MeshRenderer>();
    2.             Shader DissolveShader = Shader.Find("VacuumShaders/Advanced Dissolve/Nature/SpeedTree");
    3.  
    4.             foreach (MeshRenderer mesh in myRenders) {
    5.  
    6.                 // SET SHADER
    7.                 mesh.material.shader = DissolveShader;
    8.  
    9.                 // CUTOUT //
    10.  
    11.                 // SET TWO CUSTOM MAPS
    12.                 mesh.material.DisableKeyword("_DISSOLVEALPHASOURCE_MAIN_MAP_ALPHA");
    13.                 mesh.material.DisableKeyword("_DISSOLVEALPHASOURCE_CUSTOM_MAP");
    14.                 mesh.material.DisableKeyword("_DISSOLVEALPHASOURCE_THREE_CUSTOM_MAPS");
    15.                 mesh.material.EnableKeyword("_DISSOLVEALPHASOURCE_TWO_CUSTOM_MAPS");
    16.  
    17.                 // SET NORMAL
    18.                 mesh.material.DisableKeyword("_DISSOLVEMAPPINGTYPE_TRIPLANAR");
    19.                 mesh.material.DisableKeyword("_DISSOLVEMAPPINGTYPE_SCREEN_SPACE");
    20.                 mesh.material.EnableKeyword("_DISSOLVEMAPPINGTYPE_NORMAL");
    21.  
    22.                 // SET TEXTURES
    23.                 mesh.material.SetTexture("_DissolveMap1", MappingTexture1);
    24.                 mesh.material.SetTexture("_DissolveMap2", MappingTexture2);
    25.  
    26.                 // SET FLOATS
    27.                 mesh.material.SetFloat("_DissolveSourceAlphaTexturesBlend", 0f);
    28.  
    29.  
    30.  
    31.  
    32.                 // EDGE //
    33.  
    34.                 // SET GRADIENT
    35.                 mesh.material.DisableKeyword("_DISSOLVEEDGETEXTURESOURCE_NONE");
    36.                 mesh.material.DisableKeyword("_DISSOLVEEDGETEXTURESOURCE_MAIN_MAP");
    37.                 mesh.material.DisableKeyword("_DISSOLVEEDGETEXTURESOURCE_CUSTOM");
    38.                 mesh.material.EnableKeyword("_DISSOLVEEDGETEXTURESOURCE_GRADIENT");
    39.  
    40.                 // SET TEXTURES
    41.                 mesh.material.SetTexture("_DissolveEdgeTexture", EdgeTexture);
    42.  
    43.                 // SET FLOATS
    44.                 mesh.material.SetFloat("_DissolveEdgeWidth", 0.2f);
    45.                 mesh.material.SetFloat("_DissolveEdgeColorIntensity", 5f);
    46.                 mesh.material.SetFloat("_DissolveEdgeTextureReverse", 1f);
    47.  
    48.                 // SET INTS // SMOOTH
    49.                 mesh.material.SetInt("_DissolveEdgeShape", 1);
    50.             }
     
  48. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,984
    Check example Controller_Cutout script (Assets\VacuumShaders\Advanced Dissolve\Example And Demo Scenes\Example Scenes\Files\Scripts\Controllers).
    It contains code to control cutout textures globally and per-material.



    VacuumShaders - Facebook Twitter YouTube
     
  49. SilverStorm

    SilverStorm

    Joined:
    Aug 25, 2011
    Posts:
    712
    The demo hangs after the made with Unity logo appears and I have to force exit it unless I want to see a dark screen forever. Anyone else get this error? I purchased the plugin but haven't used it yet and am wondering if the demo hanging is a result of plugin itself or something else. Downloaded the demo from your asset store link.
     
  50. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,984
    What Unity version do you use? What OS?



    VacuumShaders - Facebook Twitter YouTube