From 3aeb17a5dae6d79dad1d04e24185becc840510a6 Mon Sep 17 00:00:00 2001 From: mob-sakai Date: Mon, 11 May 2020 13:52:21 +0900 Subject: [PATCH] docs: update readme --- Packages/SoftMaskForUGUI/README.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Packages/SoftMaskForUGUI/README.md b/Packages/SoftMaskForUGUI/README.md index 1858a06..2bd0df9 100644 --- a/Packages/SoftMaskForUGUI/README.md +++ b/Packages/SoftMaskForUGUI/README.md @@ -155,8 +155,20 @@ Or, add a SoftMaskable components from the inspector of the SoftMask component.



## Support soft masks with your custom shaders -With just three additional lines, you can now support softmasks in your custom shaders! +Only a few steps are needed to support soft mask in your custom shaders! +1. Duplicate your shader file and add the ` (SoftMaskable)` suffix to the file name. +``` +Your_Custom_Shader.shader +-> Your_Custom_Shader (SoftMaskable).shader +``` +1. Modify the shader name (defined at the beginning of the shader file) as follows: + - Add `Hidden/` prefix + - Add ` (SoftMaskable)` suffix +``` +Shader "UI/Your_Custom_Shader" +-> Shader "Hidden/UI/Your_Custom_Shader (SoftMaskable)" +``` 1. Add `#pragma` and `#include` directives, where `SOFTMASK_EDITOR` is an editor-only keyword and is not included in the build. If you didn't use package manager to install, include `SoftMask.cginc` in the appropriate path instead. ```