CustomSRP
Many mini-custom-SRPs showing how to achieve different things when creating your own SRP. Only SRP Core package is needed.
Unity Project
Built with Unity 6000.3.11f1 · download the source from GitHub
Dependencies (43)
Unity UI 2.0.02D Sprite 1.0.0NUnit Extension 2.0.5JetBrains Rider Editor 3.0.39com.unity.2d.tilemap 1.0.0AI 1.0.0UI 1.0.0VR 1.0.0XR 1.0.0Wind 1.0.0Audio 1.0.0Cloth 1.0.0IMGUI 1.0.0Umbra 1.0.0Video 1.0.0Post Processing 3.5.1Physics 1.0.0Terrain 1.0.0Tilemap 1.0.0Visual Studio Editor 2.0.26Director 1.0.0Vehicles 1.0.0Animation 1.0.0Physics 2D 1.0.0com.unity.modules.androidjni 1.0.0UI Elements 1.0.0com.unity.multiplayer.center 1.0.1Asset Bundle 1.0.0Accessibility 1.0.0JSON Serialize 1.0.0Screen Capture 1.0.0Render Pipeline Core 17.3.0Particle System 1.0.0Terrain Physics 1.0.0Unity Analytics 1.0.0com.unity.modules.vectorgraphics 1.0.0Image Conversion 1.0.0Unity Web Request 1.0.0Unity Web Request WWW 1.0.0com.unity.modules.adaptiveperformance 1.0.0Unity Web Request Audio 1.0.0Unity Web Request Texture 1.0.0Unity Web Request Asset Bundle 1.0.0
README
CustomSRP
A new SRP from scratch
Unity version : 6000.3.11f1+ Checkout to branches for older versions
Tested with : Win DX11
| Scene | Image | Description |
|---|---|---|
SRP0101_Basic |
Super basic SRP that renders unlit material objects | |
SRP0102_AssetSettings |
![]() |
Let the SRP Asset to pass some custom variables |
SRP0103_CustomGUI |
![]() |
Have a proper interface for the SRP Asset |
SRP0201_FrustumCulling |
![]() |
Frustum culling always work. This is a test scene to verify the culling results |
SRP0202_OcclusionCulling |
![]() |
Baked Occlusion Culling always work also. This is just a test scene to verify it |
SRP0301_Batching |
Use Static Batching, Dynamic Batching, GPU Instancing and SRP Batcher | |
SRP0401_NoSpecificPass |
To draw the shaders that do not have a tag, e.g. default Unlit shaders | |
SRP0402_Multipass |
In SRP we need to specify the pass names, so no more infinite pass. But we can specify the orders of passes | |
SRP0403_Compute |
Use compute shader to achieve simple edge detection | |
SRP0404_DrawCommands |
![]() |
using CommandBuffer functions (DrawMeshInstancedIndirect) |
SRP0405_Callback |
Make your custom callback function so that you can insert extra rendering code with other scripts | |
SRP0406_ShaderDebugPrint |
Print pixel values from shader to Console | |
SRP0501_SoftParticle |
Setup CameraDepthTexture to achieve soft-particle effect | |
SRP0502_Distortion |
![]() |
No more grab pass but we can implement our own |
SRP0101_Fog |
![]() |
Use Fog on Lighting Settings |
SRP0601_RealtimeLights |
Directional / Point / Spot lights and setup PerObject light data | |
SRP0602_BakedLights |
Baked Lightmap / Reflection Probe / Light Probes and setup PerObject data for them | |
SRP0603_RealtimeShadowDirectional |
![]() |
Directional light realtime shadow |
SRP0701_HDR_MSAA |
![]() |
Use HDR and MSAA |
SRP0701_HDR_MSAA_RTHandle |
![]() |
Same as above, but using RTHandle instead of RenderTargetIdentifier |
SRP0701_Stencil |
In order to use stencil, we need the render target having at least 24bit depth. This case we use the same pipeline with 0701 | |
SRP0702_Postprocessing |
![]() |
This shows you how to use Postprocessing Stack with SRP (transparent effects e.g. Bloom, Depth of Field) |
SRP0703_MotionVector |
Make motion blur works. Use per-object and camera motion vector | |
SRP0801_UGUI |
Use UICamera to render UGUI, also render 3D objects and particle on UI | |
SRP0802_RenderPass |
![]() |
Use RenderPass to target multiple color attachments and read / write from / to them |
SRP0802_RenderGraph_RasterCommandBuffer |
Use RasterCommandBuffer in RenderGraph to modularize rendering passes. Use Window > Analysis > Render Graph Viewer to see RT read/write status in each pass. | |
SRP0803_MultiRenderTarget |
Use CommandBuffer.SetRenderTarget() to target multiple color surfaces | |
SRP0901_SceneViewFix |
Make the gizmos / icons appear on scene view | |
SRP0902_SceneViewDrawMode |
![]() |
Adding custom Scene View draw modes |
SRP1001_Error |
Render the pink shaders on the materials that the SRP doesn't support | |
SRP1002_Debug |
![]() |
Make the Profiler records the timing for SRP performance debugging |
SRP1003_DefaultShaders |
![]() |
Set pipeline default materials when creating new material / objects / particle / terrain etc |
References / Useful Links:
- SRP Core Documentation
- Custom SRP template by phi-lira
- Custom Pipeline for Unity 2018 by Catlike Coding
- Custom Pipeline for Unity 2019 by Catlike Coding
- URP & HDRP
- SRPFromScratch by pbbastian
- Siggraph 2018 SRP presentation by Matt Dean
Comments
No comments yet. Be the first!














Sign in to join the conversation
Sign In