Shader Graph Integration
Last updated
Last updated
Advanced Dissolve effect cannot be created inside Unity's Shade Graph using just one or several nodes, however it can be integrated into HSLS shader file generated from the Shader Graph.
Steps describe below are valid for Unity 2020.3 and later versions.
In the case of using Unity 2019.4, check Unity 2019.4 subpage below.
Shader Graph for Built-in render pipeline requires Unity 2021.3 or later version.
Here are all required steps for integrating dissolve effect inside .shadergraph file:
Inside Graph Settings of the selected .shadergraph make sure Alpha Clip checkbox is active. This will add Alpha Clip Threshold field to the master node:
Add Advanced Dissolve node and connect its output to the Alpha Clip Threshold field:
Advanced Dissolve node is available from the create node context menu: Amazing Assets -> Advanced Dissolve.
Advanced Dissolve node itself does nothing here. Its output value is always 0. This node serves as a "marker" for the HLSL shader generator.
When shader is ready and Advanced Dissolve node has been added, save it.
Now select .shadergraph file inside Project window and from the context menu choose Amazing Assets -> Advanced Dissolve -> Generate Shader:
This will generate HLSL shader, exactly the same as the .shadergraph file, but with integrated Advanced Dissolve features. Shader is ready to be used in materials.
Keep original .shaderGraph file and if in the future some changes are required, just repeat steps 3 - 4.
Note, generated .shader file will have the same name as the source .shaderGraph file. If folder already contains file with such name, it will be overwritten.
Generate Shader context menu supports multiple .shaderGraph files selection, in the case of updating/generating multiple shader files at once.