Custom Render Passes
-
Customised Render Passes
Learning how to create customised render passes for unique effects using C#
-
Custom Shader Passes
Creating custom shaders to use in the render passes using HLSL
-
Learning Both
Learning how C# and HLSL scripts talk to each other through a more complicated medium of Custom Render Passes
This series of learning how Custom Render Passes work was used to learn more about HLSL and how I can customise environments using these for more unique effects.
Using, ‘https://www.kodeco.com/22027819-volumetric-light-scattering-as-a-custom-renderer-feature-in-urp’, as my learning source, it taught me a lot, applying that knowledge below…
Custom Render Pass:
Screen Tint
This first Render Pass focused on tinting the screen a specific colour with its associated intensity. Whilst the HLSL for this was relatively simple, the real challenge lay in creating the render pass from scratch without relying on tutorials. This meant I gained a much deeper understanding of how all the functions work and communicate with one another such as using the Command Buffer and Blit functions. As well as this, coding the settings, linking these to the values in the shader and displaying them in the game engine through my own render feature. This really helped develop an understanding of how I can use Custom Render Passes and whilst there is a lot I dont know, this was a fantastic way to learn more!
Custom Render Pass: Gaussian Blur
This study focused on replicating the Gaussian Blur effect, since this wasn’t in the default post processing volume, I wanted to try and create this effect. Learning that a Convolution Blur was the result of summing weighed values from a Gaussian curve to create a ‘blurred’ effect, I used two shader passes: Horizontal and Vertical, This meant instead of performing a blur in a 3×3 grid, I could reduce the calculations to a more efficient 1×3 grid in both Horizontal and Vertical directions: 6 calculations instead of 9. This was a really valuable case study, understanding more about different blur techniques and their implementation in Custom Render Passes.
Custom Render Pass: Sobel Filter
This Study was an attempt to learn how the Sobel Edge Detection method works and use it in a Custom Render Pass. Here, the X axis is shown in blue and the Y Axis is shown in Red.: this in itself is an interesting looking effect. This used a combination of C# for the render pass and HLSL for calculating the X and Y. This would help provide the foundation for a stylized outline shader had I taken this further.
These Unity Case Studies, exploring how Custom Render Passes work and the correlation between HLSL and C#, provided valuable insight into how more intricate effects and shaders could be produced with further time and experience in this area.