Package samples reference for URP
Learn about the package samples that URP provides.
읽는 시간 7분최근 업데이트: 한 달 전
The package samples that URP provides are:
- URP Package Samples: A set of example shaders, C# scripts, and other assets to help you build or enhance your application.
- URP RenderGraph Samples: A set of example custom render passes that use the render graph system.
For information about installing package samples, refer to Import a package sample in URP.
URP Package Samples
URP Package Samples is a package sample for the Universal Render Pipeline (URP). It contains example shaders, C# scripts, and other assets you can build upon, use to learn how to use a feature, or use directly in your application. For information on how to import URP Package Samples into your project, refer to Importing package samples.
Each example uses its own URP asset so, if you want to build an example scene, add the example's URP asset to your Graphics settings. If you don't do this, Unity might strip shaders or render passes that the example uses.
Camera Stacking
The folder contains examples for Camera Stacking. The following table describes each Camera Stacking example in this folder.
URP Package Samples/CameraStackingExample | Description |
|---|---|
| Mixed field of view | The example in |
| Split screen | The example in |
| 3D skybox | The example in |
Decals
The folder contains examples for decals. The following table describes each decal example in this folder.
URP Package Samples/DecalsExample | Description |
|---|---|
| Blob shadows | The example in |
| Paint splat | The example in |
| Proxy lighting | The example in Note: To demonstrate the extent of its lighting simulation, this example disables normal real-time lighting. |
Lens Flares
The folder contains lens flare examples. The following table describes each lens flare example in this folder.
URP Package Samples/LensFlaresExample | Description |
|---|---|
| Sun flare | The |
| Lens flare showroom | The 1. In the Hierarchy window, select the Lens Flare GameObject. 2. In the Lens Flare component, assign a LensFlareDataSRP asset to the Lens Flare Data property. 3. Change the Lens Flare component and data properties and view the lens flare in the Game View. Note: If the text box is in the way, disable the Canvas in the scene. |
Lighting
The folder contains examples for lighting. The following table describes each lighting example in this folder.
URP Package Samples/LightingExample | Description |
|---|---|
| Reflection probes | The example in |
Renderer Features
The folder contains examples for Renderer Features. The following table describes each Renderer Feature example in this folder.
URP Package Samples/RendererFeaturesExample | Description |
|---|---|
| Ambient occlusion | The example in |
| Glitch effect | The example in |
| Keep frame | The example in Note: The effect is only visible in Play Mode. |
| Occlusion effect | The example in |
| Trail effect | The example in |
Shaders
The folder contains examples for shaders. The following table describes each shader example in this folder.
URP Package Samples/ShadersExample | Description |
|---|---|
| Lit | The example in |
RenderGraph Samples
After you install the Render Graph Samples, the folder contains examples of Scriptable Renderer Features that use the render graph system.
URPRenderGraphSamplesTo use an example, follow these steps:
- In the Project window, select the URP Renderer your project uses.
- In the window, select Add Renderer Feature.Inspector
?
- Select the example you want to use.
For more information, refer to Add a Renderer Feature to a URP Renderer.
To get more information about each sample, use the Render Graph Viewer to visualize the sequence of render passes. Some examples are for API demonstrative purposes and don't generate a visible output in the Game or Scene view, but you can use the Frame Debugger to see their output.
Example | Description |
|---|---|
| Blit | Copies the active color texture to a new texture. |
| BlitWithFrameData | Demonstrates how Blit operations can be handled using frameData with multiple ScriptableRenderPasses. |
| BlitWithMaterial | Blits the active CameraColor to a new texture. Shows how to perform a blit with material and use ResourceData to avoid another blit back to the active color target. This example is for API demonstrative purposes. |
| Compute | Shows how a compute shader can be used together with RenderGraph. |
| Culling | Renders the scene geometry associated with a specific layer using the culling results, for API demonstrative purposes. |
| FramebufferFetch | Copies the target of the previous pass to a new texture using a custom material and framebuffer fetch. This example is for API demonstrative purposes. |
| GBufferVisualization | Uses the gBuffer components in a RenderPass when they are not global. |
| GlobalGBuffers | Sets the gBuffer components as globals (it renders nothing itself). Adding this feature to the scriptable renderer allows subsequent passes to access the gBuffers as globals. |
| MRT | Demonstrates how to use Multiple Render Targets (MRT) in RenderGraph with URP. Useful when more than 4 channels of data (a single RGBA texture) need to be written by a pass. |
| OutputTexture | Uses RenderGraph to output a specific texture in URP, shows how to attach a texture by name to a material, and demonstrates how two render passes can be merged if executed in the correct order. |
| RendererList | Clears the current active color texture, then renders the scene geometry associated with a layer mask. |
| TextureReferenceWithFrameData | Creates a texture reference ContextItem in frameData to hold a reference used by future passes. This avoids additional blit operations copying back and forth to the camera's color attachment. |
| UnsafePass | Copies the active color texture to a new texture and then downsamples the source texture twice. This example is for API demonstrative purposes. |