Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.


    Read our full announcement for more information and let us know if you have any questions.

HDRP Garbage Collection Issue (light related?)

Discussion in 'High Definition Render Pipeline' started by Velo222, Jan 13, 2020.

  1. Velo222

    Velo222

    Joined:
    Apr 29, 2012
    Posts:
    1,437
    Hey guys,

    I'm getting a ton of garbage collection when using the HD pipeline. I'm trying to figure out what in the HD settings or workflow is causing the GC allocation.

    The command in question is: "C#_TPPrepareLightsForGPU".

    Does anyone know what this is, what it does, or how to get rid of it's massive garbage collection problem?

    I'm using HD package version 6.9.2 currently, and I realize we're on 7.1 or higher (I think now), and that Unity 2019.3 is almost set to release......however I don't want to upgrade my HD package version yet until another asset gets updated to the most recent version.

    Anyways, I'd just like to know what this command/function does, and if there's any way I can stop it from giving me so much garbage collection by default?

    Here is a profiler pic of how bad it is:
    UnityHD_GC_Problem1.jpg
     
  2. Velo222

    Velo222

    Joined:
    Apr 29, 2012
    Posts:
    1,437
    Ok I figured out the problem to some extent.

    Any point lights I had in my scene were causing additional garbage collection. When I turn them all off, half of the GC disappeared.

    The other half has to do with a Render texture being used on my second camera in my scene for some reason. I didn't know Render Textures were so Garbage Collection heavy? I'm using the render texture as a minimap texture on my Canvas/UI. So I guess I'll have to do something else for that.

    Is there any way to get Render Textures to not generate so much garbage?
     
  3. JohnKP-Mindshow

    JohnKP-Mindshow

    Joined:
    Oct 25, 2017
    Posts:
    56
    This seems to be an issue that gets brought up, fixed, then comes back again (as is the nature of development with lots of churn with garbage collection). But with a render pipeline (that aims for high definition) its a little embarrassing as someone who's recommended unity to others.

    I think it would be best to file a ticket and post a link to it here to get visibility in the community and in their system.