HDRP Setup
Last updated
Last updated
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
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!)
Possible Optimisation for HDRP (Using a Single Camera): https://www.intetic.com/blogs/unity-hdrp-render-object-on-top-of-everything/ (Therefore, the Camera component of Examine Camera should be disabled, you will just need one camera to do this.)
Temporal Anti-aliasing: May cause some undesired effects while examining, so you may want to disable this
We'll be using the CustomPasses from: https://github.com/alelievr/HDRP-Custom-Passes
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:
In the ExamineObject() method add this line:
In the DropItem() method add this line:
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! :)