2D Renderer and Shader Graph | Universal RP | 7.1.8
docs.unity3d.com
    Show / Hide Table of Contents

    2D Renderer and Shader Graph

    Creating a Lit Shader

    1. Create a new Asset by selecting Create > Shader > 2D Renderer > Lit Sprite Graph.

    2. Double-click the new Asset to open the Shader Graph.

    3. Attach the Sample Texture 2D Nodes to Color, Mask, and Normal. Change the type on the sampler connected to normal from Default to Normal.

    4. In the Blackboard on the left side, add three new Texture2D items which can be named anything. However, it is required to name the reference for MainTex as _MainTex to render Sprites. It is also recommended to name the references for Mask as _MaskTex and Normal as _NormalMap to match the Shader inputs used in this package.

      Lastly the mode on Normal should be set to Bump so that if a normal map is not supplied, an appropriate default Texture is still available.

    5. Drag MainTex, Mask, and Normal from the Blackboard to the Shader Graph work area.

    6. Connect the MainTex, Mask, and Normal nodes to their respective Sample Texture2D nodes.

    7. Select 'Save Asset' to save the Shader.

      You can now assign new materials to the newly built Shader.

    In This Article
    • Creating a Lit Shader
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023