Additional Settings
Last updated
Last updated
Beside material editor, Advanced Dissolve shader properties can be controlled from scripts too and for some properties this is the only way to be updated (for example for geometric cutouts). In the example scenes dissolve properties of all materials are updated using two script:
AdvancedDissolvePropertiesController – Updates dissolve edges visual properties.
AdvancedDissolveGeometricCutoutController – Updates geometric cutout properties.
Both scripts use simple for loop to iterate through materials array and update them. For scenes with just a few dissolve materials this has no impact on performance, but in the case of big amount of materials needed to be updated every frame, or if those materials share the same properties (for example geometric cutouts), Global Control becomes very useful, as it updates only one global shader property and all materials automatically use it. When Global Control is enabled material editor becomes inactive and it does not allow property changes from there (except keywords). Instead all dissolve properties must be updated from controller scripts:
Global Control usage is demonstrated in the 10. Cone Smooth (Global Control) example scene. It is exact copy of the 9. Cone Smooth example scene, but with Global Control enabled.
Check AD Properties Controller and AD Geometric Cutout Controller game objects with attached controller scripts there. None of them has materials assigned in the Materials array, instead they are updating global properties defined by ID One:
All scene materials are setup to use Global Control with ID One. Advanced Dissolve has 4 global control IDs. It allows to have 4 independent groups of global materials updated separately from each other.
Global Control ID is one of the Advanced Dissolve shader keywords, explained in the chapter Keywords.
Option is available only for scriptable render pipeline (Universal and High Definition) shaders and displays selected shaders compatibility with SRP Batcher. By default it is not compatible.
To make shader SRP Batcher compatible it is necessary to remove all Advanced Dissolve keywords and shader variants from it. This is done by clicking on the Bake button:
This generates new shader file that is an exact copy of the selected shader, with currently used Advanced Dissolve keywords baked inside – all unused keywords and shader variants are removed. For baked shaders it is not possible in the future to change or assign new Advanced Dissolve keywords, appropriate fields inside material editor also becomes inactive.