• Stars
    star
    1,260
  • Rank 37,337 (Top 0.8 %)
  • Language
    C#
  • License
    MIT License
  • Created about 5 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A bunch of custom passes made for HDRP

HDRP-Custom-Passes

A bunch of custom passes made for HDRP. This project have been setup for Unity 2022.1 version with HDRP 13.x.

If you're looking for older versions, you can find them in the git branches: 2020.2/3, 2021.2/3.

TIPS Effect:

Features:

  • Edge detect
  • Draw Mesh
  • Compositing with fullscreen pass

Source file link for this effect: TIPS.cs and TIPS.shader

TIPS_Effect TIPS_Effect_Size TIPS_Effect_Color

Slight Blur Effect:

Features:

  • 2 Pass gaussian blur and a downscale
  • Masking to not blur certain part of the screen using meshes

Source file link for this effect: SlightBlur.cs and Blur.shader SlightBlur

Outline Effect:

Source file link for this effect: 02_Selection_Objects.shader and 02_Selection_Fullscreen.shader

Effect made without custom C#, setup in the inspector: image

OutlineThickness OutlineColor2

See Through Effect:

Source file link for this effect: SeeThrough.cs and SeeThroughStencil.shader SeeThrough

AR Effect:

Features:

  • Early depth pass
  • Composite with video in background

AR

Glitch Effect:

Features:

  • Display a "bad reception" effect over objects of specified layer, using the following shader: SS_Glitch

Glitch

Scrolling Formulas Effect:

Features:

  • Uses a builtin fullscreen custom pass and a custom pass fullscreen shader
  • Triplanar mapping ScrollingFormulas

Liquid

Features:

  • Meta balls made by bluring normals
  • Visual Effect Graph inside a custom pass
  • Overriding depth and normals of a fullscreen transparent to emulate a surface Liquid

Glass

Features:

  • Thickness aproximation using a custom pass rendering backfaces in custom depth image

Depth Capture

Features:

  • Render objects from a different camera and output their depth in a depth buffer
  • Source code: CameraDepthBake.cs image

Render With Normal Buffer

Rendering objects in the normal buffer is essential to make objects work with screen space effects. This example show how to create a custom pass that renders an object in the depth, normal and color buffer so the SSAO can correctly be applied (you can see the exagerated SSAO effect in this screenshot)

image

And this is the same image without rendering the object to the normal buffer:
image As you can see the SSAO is completely messed-up

Note that because you need to render the object in both depth-prepass and forward pass, you need two custom passes volume with different injection points:
image

ScreenSpace Camera UI Blur

This effect blurs the camera color buffer and renders the screenspace UI on top of it. It is intended to be used in the after post process injection point UI_blur

Note that this custom pass also avoid z test issues when doing this kind of as the transparent objects are rendered after everything.

image

Render Video Without TAA

This effect allows you to render an object (for example a video player) without TAA. It uses custom post processes to achieve this, so be sure to have the "VideoPlaybackWithoutTAAPostProcess" post process in your HDRP default settings:

image.

As you can see in the videos, this pass will remove all artifacts visible when an object doesn't have valid motion vector data (which is the case for most texture animation or video playback):

With TAA:

VideoWithTAA.mp4

Without TAA:

VideoWithoutTAA.mp4

By default in this effect, the fixDepthBufferJittering field is disabled because it's a very costly operation (re-render all the objects in the scene into an unjittered depth buffer) but it allows to get rid of all TAA artifacts remaining after you add this effect (mainly depth jittering).

Custom pass effect sources: Assets/CustomPasses/Video Playback Without TAA.

Render Object Motion Vectors

Render the Object motion vectors (not camera motion vectors!) into a render texture image

Sources: Assets/CustomPasses/RenderMotionVectors

Copy Buffer

Custom pass that can copy the following buffers to a render texture:

  • Color
  • Normal
  • Roughness
  • Depth
  • Motion Vectors

image

Source: Assets/CustomPasses/CopyPass

Screen Space Wetness

Effect that modifies the normal and roughness buffers in screen space to give a "wet" effect to objects. Sources: Assets/CustomPasses/Wetness

It's also compatible with ShaderGraph using the SubGraph "EncodeIntoToNormalBuffer".

Wetness.mp4

Current Depth To Custom Depth

Duing HDRP rendering, you only have access to the depth buffer that contains all opaque objects, the depth texture is not updated when rendering transparent with depth pre/post passes.

This custom pass copies the current camera depth (up to date with the current injection point) to the custom depth buffer. The custom depth buffer can then be sampled in a fullscreen shader graph using the custom depth node.

Source file for this effect: CurrentDepthToCustomDepth.cs and CurrentDepthToCustomDepth.shader.

More Repositories

1

NodeGraphProcessor

Node graph editor framework focused on data processing using Unity UIElements and C# 4.6
C#
2,137
star
2

Mixture

Mixture is a powerful node-based tool crafted in unity to generate all kinds of textures in realtime
C#
930
star
3

libft-unit-test

C
447
star
4

Procedural-Worlds-Editor

Procedural World Editor is a node based procedural terrain generator
C#
273
star
5

HDRP-UI-Camera-Stacking

Optimized implementation of camera stacking for UI only in HDRP.
ShaderLab
135
star
6

MasterUnityHandles

Unity custom handles examples
C#
96
star
7

printf-unit-test

C++
30
star
8

SOIL2

C
15
star
9

ProceduralTerrainGPU

HLSL
11
star
10

shaderRender

C
9
star
11

PolygonBurst

C#
7
star
12

VoxelEngine

Vulkan engine in c++ exploiting the compute shaders to generate voxel terrain
C++
6
star
13

ShaderSourceExtractor

Unity shader source extractor
ShaderLab
5
star
14

MixAndGameJam_2019

Mix and Game jam 2019
C#
5
star
15

PostEffects

Small unity post processing effects missing from the post processing stack
C#
5
star
16

THE_FUTURE

program used to render shaders on multiple imacs during the artistik rezo party
GLSL
5
star
17

UnityGraphSerialization

Unity graph serialization tests
C#
4
star
18

42sh

42sh
C
4
star
19

LightweightGraphicCore

Lightweight Graphic Vulkan wrapper to manage windows, allocations, shader compilation, GUI and more
C++
4
star
20

DistanceFieldGraph

C#
3
star
21

GGJ2019

C#
3
star
22

ProceduralTextureExporter

C#
3
star
23

Mixture-dev

ShaderLab
3
star
24

DistributionVisualization

C#
2
star
25

Coders-of-the-caribbean

Unity visualizer for CondiinGame challenge: Coders of the Caribbean
C#
2
star
26

Ludum-Dare-43

C#
2
star
27

Touhou-jam

C#
1
star
28

2D-JamStartupKit

A Unity kit of assets and scripts for game jams
C#
1
star
29

Unity-analytics-test

C#
1
star
30

JamKit

A bunch of useful scripts for jam games
C#
1
star
31

Binary-Security

C
1
star
32

Open-Game-Jam-1

C#
1
star
33

AudioFractal

Little Audio fractal visualizer using KlakLasp
C#
1
star
34

malloc

C
1
star
35

HDRP-Mobile

Unlock HDRP to build on mobile devices
C#
1
star