Version: Unity 6 (6000.0)
Language : English
Examples of writing a custom shader in URP
Write an unlit basic shader in URP

Create a sample scene in URP

To follow the examples in this section:

  1. Install URP into an existing Unity project, or create a new project using the Universal Project Template.

  2. In the sample sceneA Scene contains the environments and menus of your game. Think of each unique Scene file as a unique level. In each Scene, you place your environments, obstacles, and decorations, essentially designing and building your game in pieces. More info
    See in Glossary
    , create a GameObjectThe fundamental object in Unity scenes, which can represent characters, props, scenery, cameras, waypoints, and more. A GameObject’s functionality is defined by the Components attached to it. More info
    See in Glossary
    to test the shadersA program that runs on the GPU. More info
    See in Glossary
    on; for example, a capsule.

    Sample GameObject
    Sample GameObject
  3. Create a new Material and assign it to the capsule.

  4. Create a new Shader asset and assign it to the Material of the capsule. When following an example, open the shader asset to edit the Unity shader source file. Replace the code in the source file with the code in the example.

To start writing URP shaders, continue to section URP unlit basic shader.

Examples of writing a custom shader in URP
Write an unlit basic shader in URP
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961