HDRP Setup
Tag & Layer Setup:
LAYER NOTE: If you can place these on the corresponding User Layers (As above) it is easier for setup, as Unity will automatically place them in the correct places so the below information might not be all relevant to you. (It's worth checking through just encase!)
Step 1 - HDRP Setup Video:
Step 2 - Using a Single Camera (Using Custom Passes)
Step 3 - Adding the Blur Shader with a Custom Pass
We'll be using the CustomPasses from: https://github.com/alelievr/HDRP-Custom-Passes
Code Implementation:
The code below just turns the custom pass which exists on the main camera on and off, by enabling and disabling it's built in checkbox for Custom Passes. Check out the video if you need more guidance!
Add the namespace reference to the top of the script:
using UnityEngine;
using UnityEngine.Rendering.HighDefinition; //Add this line here
In the ExamineObject() method add this line:
public void ExamineObject()
{
ExamineUIManager.instance.examineController = gameObject.GetComponent<ExamineItemController>();
ExamineAudioManager.instance.Play(pickupSound);
//Add the line below
Camera.main.GetComponent<CustomPassVolume>().customPasses[0].enabled = true;
...
In the DropItem() method add this line:
public void DropObject()
{
if (hasChildren)
{
foreach (GameObject gameobjectToLayer in childObjects)
{
gameobjectToLayer.layer = LayerMask.NameToLayer(defaultLayer);
Material thisMat = gameobjectToLayer.GetComponent<Renderer>().material;
thisMat.DisableKeyword(emissive);
}
}
gameObject.layer = LayerMask.NameToLayer(defaultLayer);
//Add the line below
Camera.main.GetComponent<CustomPassVolume>().customPasses[0].enabled = false;
HDRP Text Notes Setup
Select your "Main Camera" and set the "Culling Mask" so that you UNTICK the "ExamineLayer" & "InspectPointLayer" - As we don't want the main camera to render our examinable objects.

Select the βExamine Cameraβ and make sure the βCulling Maskβ is set to βExamineLayerβ & "InspectPointLayer" β Make sure to create this in the layers at the top right of the inspector if not already
Make sure that all inspect points have the layer of: "InspectPointLayer" and NOT "ExamineLayer" or it will not detect them.
Create a custom pass using the video above to remove the need for 2 cameras and gain needed performance!
Add the Blur Custom Passes, which is featured above in the video and steps! :)
Last updated