Search Unity

  1. Are you interested in providing feedback directly to Unity teams? Sign up to become a member of Unity Pulse, our new product feedback and research community.
    Dismiss Notice

Help Wanted Setting up custom rendering pipe using HDAdditionalCameraData.customRender

Discussion in 'High Definition Render Pipeline' started by pyjamaslug, Mar 31, 2020.

  1. pyjamaslug

    pyjamaslug

    Joined:
    Jul 5, 2017
    Posts:
    46
    Hi all,
    I am new to using SRP and I am having trouble making progress on this. I have succesfully cretaed my own SRP and accessed it from the graphics settings and now I want to switch to using the HDRP for teh main camera and use my custom renderer on a specific camera. I have set its renderpath to custom (I am on 2018.4.12) and am subscribing to HDAdditionalCameraData.customRender from a monobehaviour like this:

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using UnityEngine.Experimental.Rendering;
    5. using UnityEngine.Experimental.Rendering.HDPipeline;
    6.  
    7.  
    8. public class CameraInspector : MonoBehaviour
    9. {
    10.     HDAdditionalCameraData aData;
    11.     CullResults cull;
    12.     Material errorMaterial;
    13.  
    14.     private void Awake()
    15.     {
    16.         aData = GetComponent<HDAdditionalCameraData>();
    17.         if (aData != null)
    18.         {
    19.             aData.customRender += SimpleRender;
    20.         }
    21.     }
    22.  
    23.     void SimpleRender(ScriptableRenderContext context, HDCamera HDcamera)
    24.     {
    25.         //renderer stripped down to this message
    26.         UnityEngine.Debug.Log("Entered custom render pipeline");
    27.     }
    28. }
    This produces the debug.log message and then a whole slew of internal errors:

    Internal error. Trying to destroy object that is already released to pool.
    UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)


    These errors continue to sporadically accumulate even after exiting play mode and then the editor crashes. Any help regarding what I am screwing up here is much appreciated.
     
  2. pyjamaslug

    pyjamaslug

    Joined:
    Jul 5, 2017
    Posts:
    46
  3. pyjamaslug

    pyjamaslug

    Joined:
    Jul 5, 2017
    Posts:
    46
    Well, after poking around in the dark for a while it seems the right advice is "don't use HDRP on 2018.4 because it is completely broken"
     
unityunity