Search Unity

Deferred rendering profiling/optimization question

Discussion in 'General Graphics' started by caosdoar, Apr 25, 2017.

  1. caosdoar

    caosdoar

    Joined:
    Oct 29, 2016
    Posts:
    26
    Hi,

    I have started making some profiling of a project I am developing in a quite old laptop to see what the bottle-necks are and what I have to reduce, delete or tweak.

    On that process I found out in the GPU profiler a process that is taking 3 milliseconds called "RenderDeferred.ReflectionsToEmissive".

    As far as I understand from RenderDoc that is copy information generated from reflections (skybox and reflection probes) to the light buffer. But if I disable the skybox reflections and any reflection probe no drawcalls are generated for reflections but the "RenderDeferred.ReflectionsToEmissive" is still executed taking those precious 3ms, to add nothing to the light buffer.

    ¿Is there any way to avoid that behaviour?

    Cheers.
     
  2. YourUncleBob

    YourUncleBob

    Joined:
    Jun 11, 2012
    Posts:
    55
    I was about to ask a similar question. I want reflections but see better performance if I disable deferred reflections under Graphics Settings (set deferred reflections shader to no support).

    When I do this, I still get reflections in the deferred renderer, but looking at the profile in PIX, RenderDeferred.Reflections goes away (that includes RenderDeferred.ReflectionsToEmissive).

    With the deferred render reflection shader enabled the renderer seems to render the geometry for each of the reflection probes and adds reflections to the current screen. It seems this can take a long time (3ms in my most recent profile test which renders in 19ms total).

    With the deferred render reflection shader disabled objects use the reflection probes during their first render pass. Static objects get both their baked lightmap textures and their reflection probe texture in this pass.The reflection probe geometry itself isn't ever rendered. I believe dynamic object work as well, but none of our dynamic objects have strong reflections so it's hard to tell. This seems to make the first pass render take slightly longer (.5ms in my most recent test), but nowhere near as long as using the deferred reflection shader.

    Visually, I can see no difference between the two renders but in all cases I've tested the render time is less with the deferred reflection shader disabled. On a typical test scene for instance, our render is taking 19ms with the deferred reflection shader enabled and 16.5ms with it disabled.

    We had strictly limited our art team to the number of reflection probes they were allowed in a scene because RenderDeferred.Reflections seems to render all that are in frustum view and the more probes you have, the longer RenderDeferred.Reflections seemed to take. We have not profiled a situation with many reflection probes and the deferred reflection shader disabled as we've already pruned down the number of probes we have in scenes.