Boat Attack使用了Universal RP的许多新图形功能,可以用于探索 Universal RP 的使用方式和技巧。
您最多选择25个主题 主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 

1.3 KiB

Working with 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.