top of page

Unity Scriptable Rendering Pipeline

UnitySRP_Sponza.png

Example of Sponza scene rendered by SRP

Introduction

A custom Scriptable Render Pipeline implemented in Unity using C# and HLSL.

The pipeline covers the full rendering workflow, including culling, lighting, shadow mapping, and post-processing, with a modular architecture designed for flexibility and extensibility.

Focused on understanding modern rendering pipelines and building production-style rendering systems.

Overview:

This project implements a full custom rendering pipeline using Unity’s Scriptable Render Pipeline (SRP).

It includes core rendering stages such as camera rendering, culling, command buffer execution, lighting, shadow mapping, and post-processing.

The system is designed to provide explicit control over rendering order, data flow, and GPU interaction.

Technical Breakdown

Rendering Pipeline

Implemented the full SRP rendering flow, controlling each stage of rendering explicitly.

The pipeline handles opaque and transparent objects separately to ensure correct rendering order and visual results.

Command buffers are used to manage rendering execution and GPU submission.

Screenshot 2026-04-27 231845.png

Rendering Flow showing in Frame Debugger

image.png
image.png

Customize rendering order

Lighting System

Implemented a lighting system supporting multiple light types (Directional, Point, Spot).
Light data is extracted from culling results and uploaded to the GPU via command buffers.
Lighting calculations are performed in shaders using a BRDF-based model.

SPR_LightData.png
image.png

Light Data Setup

Lighting Shader

image.png

Light Settings Pannel

BRDF & Global Illumination

Built a physically-based shading model using a microfacet BRDF.

Supports baked global illumination by integrating lightmaps and environment lighting with real-time shading.

image.png

BRDF (microfacet model)

image.png

Baked Global Illumination

image.png

Lighting computation combining material and light data

Shadow Mapping

Implemented shadow mapping for multiple light types.
Supports configurable shadow parameters such as resolution, cascades, and filtering.
Shadow maps are generated per light and integrated into the lighting pipeline.

SRP_LightComputation.png
image.png

Shadow rendering

Configurable shadow settings

image.png

Visualized generated shadow maps

Shader Library

Developed a modular shader library for reusability and maintainability.
Includes shared material inputs, math utilities, coordinate transformations, and BRDF functions.
Supports both Lit and Unlit shaders.

image.png
image.png

Lit & Unlit Shader

image.png

Shader function library

Material System

Built a parameter-driven material system based on the shader library.
Material properties are bound to shaders and reused across rendering passes.
Supports reusable presets for different rendering scenarios.

image.png
image.png

Normal Map On/Off

image.png
image.png

Shadow On/Off

Post Processing

Implemented post-processing effects including color grading and exposure control.
The pipeline generates intermediate textures (color and depth) as inputs for post-processing.
Post-processing is integrated into the rendering pipeline with explicit execution order.

Screenshot 2026-04-27 233732.png

Post Processing Setting

image.png
image.png

Color Texture On/Off

image.png

Example of color grading (Highlight: Red, Shadow: Yellow)

Optimization

GPU Instancing:

Implemented GPU instancing and dynamic batching to improve rendering performance.
Supports rendering 500+ instances of the same mesh in a single draw call.
Frame Debugger confirms reduced draw calls and efficient batching behavior.

  • Reduced draw calls significantly

  • Improved rendering performance

  • Supports per-instance material variation

image.png
image.png

Example of rendering 500+ instancing using GPU Instancing

image.png

GPU Instancing and Batching settings

bottom of page