High-Definition Render Pipeline

Installation
In order to use the high-definition render pipeline with NeoFPS, the following requirements must be met:
- You must be using Unity 2020.3 or higher
- You must import the High Definition RP package version 10.9 or greater
- You must import the Particle System Shader Samples that are provided with the HDRP package
To import the HD render pipeline Unity package, you must use Unity's Package Manager. The layout and wording of the package manager can vary between Unity versions, but the first thing required is to set the package manager to show the packages in the Unity Registry. This will show all the available Unity add-on packages that you can add to your project, as opposed to the "My Assets" or "In Project" options.
While looking at the unity registry, you should be able to find a package called High Definition RP (com.unity.render-pipelines.high-definition). Make sure to download version 10.9 or greater and then import it into your project. Once the package is imported, stay on the High Definition RP entry in the package manager, and expand it Samples dropdown. There should be an option in here called Particle System Shader Samples. Add this to your project too, as it's required to convert the particle effects such as muzzle flare, explosions and smoke. The following is how the entry in the package manager looks in Unity 2020.3.

Once the HDRP package and particle sample shaders are imported, you can import the NeoFPS HDRP extension package. The best way to do this is via the Unity Settings page in the NeoFPS Hub. This will track the selected pipeline and notify you of any changes to the package with each NeoFPS update. There is also a different package for Unity 6 and above due to changes in how lightmap UVs are packaged, and breaking changes with adaptive probe volumes affecting render texture scopes and dynamic lighting.
After importing the HDRP package, you will likely see a HDRP Wizard window pop up. This lets you check for any problems with your project setup and HDRP. Fix all the issues here before continuing. If required, NeoFPS comes with a number of settings assets to speed up the setup process. If you already have your project's HDRP settings set up then you can ignore the NeoFPS versions, as they are entirely default.
An alternative to the above process is using the High-Definition RP Project Template when first setting up your project via the Unity Hub. However, you will still need to import the sample particle shaders, since this won't be done by default.
While the NeoFPS HDRP extension package comes with a number of replacement materials for the NeoFPS demos, this only covers the materials that cannot be auto-converted due to using custom NeoFPS shaders. To fix the rest of your materials you can convert them using the tools provided with HDRP. This includes an option somewhere under Edit/Render Pipelines to Upgrade Project Materials to High Definition Materials. This will convert all materials using built-in shaders to use their equivalent shader graph options. This option might have a slightly different name or location based on the HDRP version you have imported.
Post-Processing
The high-definition render pipeline comes with an integrated post processing solution, however its volumes and profiles are not compatible with the Post Processing Stack V2 that Unity uses with the built-in render pipeline. It is advised to remove the Post Processing Stack via the package manager to prevent getting them mixed up.
To get post-processing properly working with the NeoFPS demos there are a few things you need to do:
- Modify the cameras for your characters and spawners, setting their Volume Mask setting to include Default and PostProcessingVolumes
- Replace any PostProcessingVolume or Missing Script components on the post processing volume objects in the scenes with the new Volume components.
- Set the volume components to Local for collider based volumes such as the underwater zones in the swimming demo.0.
- Assign one of the provided profile assets to the volume or create a new one as desired.
If you are moving from a built-in render pipeline project to HDRP then you might already have the old post processing stack package imported in your project. When this package is imported it adds the scripting define UNITY_POST_PROCESSING_STACK_V2 to your project. NeoFPS uses this to compile code specifically for the post processing package. Unfortunately, removing the package does not remove the scripting define and can cause errors with code that requires the package to be present. You will need to do this manually. To do this, open the project's Player Settings and navigate to the bottom to find the Script Compilation section. Here you will find a setting called Scripting Define Symbols. This might be an array, or it might be a single string with multiple entries each separated using the semicolon (';') character. Delete the entry called UNITY_POST_PROCESSING_STACK_V2 and the code that requires that will no longer be compiled.
One of the major differences between HDRP and the other render pipelines is the physical camera system. This can give much more natural and realistic looking lighting, but it also means that it heavily relies on post-processing exposure settings to keep the lighting within a controlled visible range. You may find that the lighting in your levels looks very wrong when making the jump to HDRP from built-in. This is because the old light settings of strength and colour don't always map well to real world light values in the conversion process. In this situation you will need to inspect each of the lights in your scene and modify their settings to achieve the look you're after.
Holographic and Red Dot Sights
Due to the changes in the way stencils work in the SRPs, the holographic sights have been modified in the NeoFPS SRP extension packages to use a new single shader, single mesh approach. The old shaders used a separate quad far in front of the weapon that had the reticule texture on it, and then used stencils to make sure that it was only visible through the glass of the holographic sight. The new system projects the reticule into the uv space of the glass itself, so does not need multiple objects or stencils.
The extension packages should replace the demo optics with URP compatible versions, but you can also find replacement versions of the demo optics in the Assets/NeoFPS/Extensions/RenderPipelines/Prefabs/ folder. The replacement optics work for both HDRP and URP.
To manually switch a holographic or red dot sight, you can use the following steps:
- Find the holographic sight object in the weapon or attachment hierarchy
- Delete the reticule mesh from the hierarchy. This will be a quad that is parented to the sight object, and is referenced by the HolographicSight behaviour's Reticule property
- Replace the HolographicSight behaviour with a HolographicSightSRP behaviour, copying over the settings. A simple way to do this is to switch the inspector to debug mode and then change the Script property to point at the SRP version of the script.
- Find the glass mesh for the sight and replace its material with one that uses the Optics_HolographicSight or Optics_RedDot shader graph depending on the scope type. The NeoFPS URP and HDRP packages come with an example for each, with a material name matching the shader name.
Note: The built in shader version used separate shaders for the reticule materials instead of the glass materials to differentiate between holographic and red dot sights. This also means that extracting the NeoFPS URP or HDRP package will overwrite the existing weapon sight glass material with the new holographic sight version, changing the demo optics to all use a holographic sight reticule. To switch your red dot sights back to using a dot reticule, you can either swap the scope with one of the prefabs provided in the RenderPipelines/Prefabs folder, or change the scope's glass material to the correct type to fix this.
Render Texture Scopes
Similarly to the holographic and red dot scopes, the render texture scopes also require some manual steps in order to work with URP or HDRP. The way the shader properties are set has changed, and so the scopes require a different behaviour script to control the fade, reticule and parallax. To switch your render texture scopes to URP/HDRP, replace the RenderTextureScope behaviour with a RenderTextureScopeSRP behaviour. A simple way to do this is to switch the inspector to debug mode and then change the Script property to point at the SRP version of the script. If you are using the scope lens material from the NeoFPS demos then extracting the NeoFPS URP or HDRP package should replace the material with one that uses the new SRP shader. If not then you will need to switch your material to use the Optics_RenderTextureScope shader graph.
In Unity 6 and above, the adaptive light probes system can interfere with the functioning of render texture scopes if your scene is not correctly set up. Make sure that your scene includes an adaptive light probes volume, or else dynamic objects could extreme lighting and scopes can show black instead of the scope camera view. Also be aware that scope cameras have their own exposure calculations due to post processing which can take time to adapt in extreme lighting conditions.
Stencil Scopes
Stencil scopes are not currently working with the SRPs at this time. Currently, working with stencils in URP or HDRP requires the use of the Render Objects Feature within the renderer asset. To recreate the stencil scopes from NeoFPS this requires the addition of 4 Unity layers dedicated to the different parts of the scope, along with a complex setup.
Hitscan and Projectile Trails
Each of the bullet trail materials from the NeoFPS demos will have been replaced with alternatives that use the SRP shader graphs when you extracted the NeoFPS URP or HDRP package. If you have your own custom trail materials then you will need to replace their shaders with the shadergraph equivalents. Most of these can be found in the RenderPipelines\ShaderGraphs\Shared folder and will start with BulletTrail_. The distortion bullet trails are SRP specific, so you will find the HDRP version in RenderPipelines\ShaderGraphs\HDRP\BulletTrail_Distortion_HDRP.shadergraph.