Dynamic Radial Masks
Dynamic Radial Masks (DRM) is a shader extension for Unity, calculating world-space volumetric 3D spherical masks in a variety of forms, shapes and amounts directly inside a shader.
Calculated result is a mask, value of float type, which inside shader can be used for interpolating one material value into another, vertex displacement, discarding mesh fragments, creating hit and impact, rain drops, ripples, sonar and many others effects.






DRM is a shader extension and it needs to be manually integrated into a shader, made by Shader Graph, Amplify Shader Editor or hand-written HLSL file. And it is quit easy.
DRM integrates into Shader Graph and Amplify Shader Editor using just one node. That's all. No other shader coding is required:

Output result of the DRM node is a mask, value of float type. In this example, it is connected to the Base Color block for demonstrating volumetric 3D spherical mask it creates:

One DRM node can contain up to 200 mask objects. Output result is a combination of all those masks as a one float value. Example below demonstrates ripple effect, create by one DRM node consisting of 64 objects:


DRM can calculate and render volumetric 3D spherical masks of 8 shapes:








Inside shader can be used multiple DRM nodes of various shapes and counts, each one for different purposes and effects. For example, shaders in the scene below use 2 DRM nodes - one for blending winter/summer textures and another node is used for sonar effect:

Total number of spherical masks that can be calculated inside one shader depends on the target device’s GPU and how many shader instructions it can handle. For PC and modern consoles it may be hundreds of DRM projections, but for mobile devices it is much less.
DRM node consists of multiple complex properties (world-space position of mask objects, their radius, intensity, noise strength, etc) that are not editable in shader and visible inside material editor, instead those properties are updated using controller script.
