Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Spotlight GPU usage issue

Discussion in 'General Graphics' started by Coredumping, Jan 13, 2020.

  1. Coredumping

    Coredumping

    Joined:
    Dec 17, 2014
    Posts:
    51
    I read that spotlights only use a simple depth render for shadows as opposed to pointlights, which need a cubemap, and that they cull more objects. So I tried switching all my pointlights to spotlights and saw maybe 5-10 FPS increase. Then I started getting reports of people's GPUs getting very hot. When I tested it, switching to spotlights from pointlights increased my GPU usage from 50% to 95%, and without shadows toggled, point lights seem to perform better. Maybe due to avoiding an extra matrix transform? Is this expected behaviour?

    Running 2017.4.32f1 in deferred rendering mode, btw.
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,329
    Without shadows, point lights are indeed faster.

    With shadows, spot lights are faster.

    One big thing with shadowed point lights is, as far as shadow map generation is concerned, they're effectively 6 spot lights (one pointed in each direction of the cubemap shadow map they generate). This means they also use way more CPU time to generate meaning the GPU might not be getting fully utilized if the CPU is causing the GPU to have to wait as it sets up the draw calls for those 6 shadow map views.