Custom shader code in Unreal Engine — Part 1: Setup and Configuration



Here are some library files I’d recomment taking a peak at:

  • Engine/Shaders/Private/BasePassCommon.ush
  • Engine/Shaders/Private/BasePassVertexShader.ush
  • Engine/Shaders/Private/MaterialTemplate.ush

Project Settings

Create shader debug information

After following the setup described above, every material used in your project, will produce files showing you the combined / final shader file, after the UE shader preprocessor has glued all dependencies together. The output of your shader debug information can be found under: [YouProjectRoot]/Saved/ShaderDebugInfo/[ShaderTarget] where ShaderTarget might be PCD3D_SM5.

Optional / Recommended Settings

Build Script

In MyShaderDevPlugin.Build.cs:

Plugin Setup

Directory Structure

Module Definition

In MyShaderDevPlugin.cpp:


Originally published at on February 23, 2020.



Today’s impossible, will be tomorrow’s reality.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store