HDRP Setup

Tag & Layer Setup:

  • Make sure to create tags called:

    • InteractiveObject

    • ExaminePoint: Tag for the ExaminePoint gameobject parented to the ExamineCamera

    • InspectPoint: Tag for every single inspect point that exists for an object

  • Create Layers:

    • User Layer 8: ExamineLayer (Doesn't need to be added to objects, referenced in code)

    • User Layer 9: InspectPointLayer (Tag for every single inspect point)

    • User Layer 10: PostProcess

    • User Layer 11: PadlockSpinner

Step 1 - HDRP Setup Video:

Step 2 - Using a Single Camera (Using Custom Passes)

Step 3 - Adding the Blur Shader with a Custom Pass

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