Cutout
Last updated
Last updated
Options in the Cutout section define dissolve area and its shape:
Dissolve effect can be calculated using Standard - user defined texture maps, or using Geometric equations. They can be used together or separately. There is no dissolve effect if both of them are disabled.
Base Alpha - Dissolve value is read from the shaders "Main Map" texture's alpha channel. By default those are properties with MainMap, BaseMap or AlbedoMap names:
Custom Maps - Dissolve effect is calculating using one or by combining 2 or 3 textures:
Channel (Red, Green, Blue, Alpha) – Texture channel used for calculating dissolve effect.
Invert - Inverts selected texture channel.
Scroll - Controls texture scroll animation. Requires texture with Repeat or Mirror wrap mode.
Texture's Scroll property is self-animated. To see its effect inside Scene view, make sure Always Refresh check-box is enabled:
User Defined – User defined cutout source, available only in the shaders created using Shader Graph. Explained in more details in the Shader Graph Integration chapter.
Dissolve effects created using Standard cutout maps are demonstrated in the 1. Texture Cutout example scene. Open scene and enter game mode to enable materials Clip property animation, or modify it manually from the material editor.
Geometric cutouts calculate dissolve area based on one mathematical equations of the selected type:
Geometric cutouts can be used separately or in combination with Standard cutout. In this case Standard cutout will be used for calculating "noise" on the edges of the geometric cutout.
Geometric cutouts have no visible controllers and options inside material editor, and for updating their properties inside material, must be used AdvancedDissolveGeometricCutoutController script.
AdvancedDissolveGeometricCutoutController and all package included scripts are explained in the Run-time API chapter.
XYZ Axis cutout effect uses mesh vertex position (world or local) to determine which pixels will be dissolved. This effect is demonstrated in 2. XYZ example scene. Open it and move Pivot Point game object in the Scene view. All pixels whose position Z value are less than Pivot Point object’s position Z value, will be cutoff:
All geometric cutout properties are controlled using AdvancedDissolveGeometricCutoutController script. Scene contains AD Geometric Cutout Controller game object with this script attached:
It is setup to use Z Axis with Linear style and Pivot Point is controlled in the World space. All this data is sent to the materials selected in the Materials array (at the end of the script).
Reset Pivot Point object’s scene position and change the Style property from Linear to Rollout. Change Axis to X. Now based on the Rollout property mesh pixels will be dissolved symmetrically on the both side of the pivot point:
Plane cutout effect dissolves pixels behind the parametric plane object. This effect is demonstrated in the 3. Plane example scene. Open it and move/rotate Plane game object. Pixels behind the plane are cut off:
For calculating Plane type cutout effect shader requires plane's world space position and normal. Those data to the material are sent using AdvancedDissolveGeometricCutoutController script attached to the AD Geometric Cutout Controller game object:
In this example scene materials are set up to use only One cutout plane.
Advanced Dissolve shaders can use 4 cutout objects simultaneously, but only of the same type.
Inside controller script change Count property to Two:
This will add Plane #2 field and additional plane gizmo will be rendered in the scene view, visualizing new parametric plane’s position and orientation. Inside controller script it is possible to directly set position and normal values for the plane equation, but in this case click on the Create button:
This will create child transform object and it will be used by the Plane #2 field. Position and normal of this object will be sent to the materials. But currently scene materials do not expect second plane data, there are setup to use only one cutout plane. To enable cutout effect using two planes each material must be updated from their material editors:
To speed up working with Advanced Dissolve keywords for the big list of materials, package includes AdvancedDissolveKeywordsController script and in the scene it is attached to the AD Keywords Controller game object. Select it and change Geometric Count property from there:
All materials in the script Materials list will be updated. Now moving and rotating Plane #2 game object will affect materials too.
Geometric cutout Count is a keyword, explained in the chapter Keywords.
Package included controller scripts are explained in the Run-time API chapter.
Package includes 4. Plane (Two Worlds) example scene using Plane cutout effect, demonstrating how one meshes can be dissolved in the same place where others are rendered. All scene materials here have exactly the same dissolve properties and keywords and are cutout using one plane, but for one group of meshes cutout effect is inverted in the AdvancedDissolveGeometricCutoutController script. Open scene and move/rotate Plane game object there to see the effect:
Sphere cutout effect dissolves pixels outside or inside its radius. This effect is demonstrated in the 5. Sphere example scene. Open scene and move/scale Sphere (1) and Sphere (2) objects:
For calculating Sphere type cutout effect shader requires sphere's world space position and radius. Those data to the material are sent using AdvancedDissolveGeometricCutoutController attached to the AD Geometric Cutout Controller game object:
In this example scene, Radius properties in the AdvancedDissolveGeometricCutoutController script are updated separately using additional script attached to the sphere objects which converts their gameobject's scale into radius.
Cube cutout effect dissolves pixels outside or inside cube's bounds. This effect is demonstrated in the 6. Cube example scene. Open scene and move/rotate/scale Cube (1) object:
For calculating Cube type cutout effect shader requires object's world space position, rotation and size. Those data to the materials are sent using AdvancedDissolveGeometricCutoutController attached to the AD Geometric Cutout Controller game object:
In this example scene Cube #1 field reads position, rotation and size data from the Cube (1) game object, but Cube #2 does not use any objects and allows to assign all requires data by hand.
Capsule cutout effect dissolves pixels outside or inside capsule volume. This effect is demonstrated in the 7. Capsule example scene. Open scene and move Point (1) Start and Point (1) End game objects:
For calculating Capsule type cutout effect shader requires two points position (start and end) and radius. Those data to the materials are sent using AdvancedDissolveGeometricCutoutController attached to the AD Geometric Cutout Controller game object:
Additionally check 8. Capsule (Camera See-Through) example scene using this cutout affect. The only difference is the AdvancedDissolveGeometricCutoutController script is using scene’s Main Camera for Start Point, and End Point is the custom mesh object in the scene that camera is looking at and rotates around it. This creates a “see through” effect, when target object is always visible to the camera through the other meshes.
Cone Smooth cutout effect works exactly the same way as the Capsule and requires same position and radius data. The only difference is that Cone Smooth radius is 0 at the start point and grows to the full size at the end point position. This effect is demonstrated in the 9. Cone Smooth example scene. Open scene and move/rotate Spot Light game object:
In this example, AdvancedDissolveGeometricCutoutController data is updated separately using helper script attached to the Spot Light game object, which converts spot light's properties (transform position, spot light range and angle) into Cone Smooth properties: start position, end position and radius.
- Textures wrap mode. This is the same setting as in the Texture Import Settings window.