HDRP Setup

SETTING UP TAGS

  • Make sure to create tags called:

    • "ExaminePoint" (Tag for the "ExaminePoint" gameobject parented to the "ExamineCamera")

    • "InspectPoint" (Tag for every single inspect point that exists for an object)

  • Create two layers:

    • ExamineLayer” (Doesn't need to be added to objects, referenced in code)

    • "InspectPointLayer" (Tag for every single inspect point)

NOTE: If you need to know what tags go on which game object, see the page below:

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!

  1. Add the namespace reference to the top of the script:

using UnityEngine;
using UnityEngine.Rendering.HighDefinition; //Add this line here 
  1. 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;
    ...
  1. 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

  1. 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.

  1. 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

  2. Make sure that all inspect points have the layer of: "InspectPointLayer" and NOT "ExamineLayer" or it will not detect them.

  3. Create a custom pass using the video above to remove the need for 2 cameras and gain needed performance!

  4. Add the Blur Custom Passes, which is featured above in the video and steps! :)

Last updated