Page MenuHome

Cycles: Make Embree compact BVH optional
ClosedPublic

Authored by Thomas Dinges (dingto) on Dec 16 2021, 11:17 AM.

Details

Summary

Make the Embree RTC_SCENE_FLAG_COMPACT flag optional and enabled per default.
Disabling this setting makes rendering a bit faster in some scenes at the cost of a higher memory usage.

SceneCompact ONCompact OFF
barbershop (50% resolution)8:16min, 2280M peak8:03min, 2318M peak
bmw3:05min, 139M peak2:57min, 153M peak
fishy_cat4:04min, 518M peak4:01min, 518M peak
junk_shop (50% resolution)1:16min, 4724M peak1:16min, 4972M peak
koro (50% resolution)1:37min, 381M peak1:37min, 381M peak
victor (50% resolution)4:14min , 6485M peak4:04min, 7397M peak
wdas_cloud0:22min, 315M peak0:22min, 315M peak

Reference: T73778

Memory increase is minimal in most scenes. Only victors shows some higher increase.

Diff Detail

Event Timeline

Thomas Dinges (dingto) requested review of this revision.Dec 16 2021, 11:17 AM
Thomas Dinges (dingto) created this revision.
Thomas Dinges (dingto) edited the summary of this revision. (Show Details)Dec 16 2021, 11:38 AM
Thomas Dinges (dingto) edited the summary of this revision. (Show Details)Dec 16 2021, 12:21 PM
Brecht Van Lommel (brecht) requested changes to this revision.Dec 16 2021, 6:43 PM

The increase in memory usage seems significant enough to me that we should keep the BVH compact by default.

We also need to make it clear which devices these BVH options apply to, it's not clear this only affects CPU rendering.

This revision now requires changes to proceed.Dec 16 2021, 6:43 PM
Thomas Dinges (dingto) updated this revision to Diff 46149.EditedDec 17 2021, 9:23 AM
  • Rebase to latest master
  • Enabled compact per default

The options inside the Acceleration Structure panel are:

  • Use Spatial Splits (CPU & GPU)
  • Use Hair BVH (GPU only)
  • Use Compact BVH (CPU only)
  • BVH Time Steps (GPU only & !spatial_splits)

We could just display the relevant ones and hide the others while CPU or GPU is selected?
CPU:

  • Use Spatial Splits
  • Use Compact BVH

GPU:

  • Use Spatial Splits
  • Use Hair BVH
  • BVH Time Steps

Should this be clarified further in the code too? Or just UI?

Alaska (Alaska) edited the summary of this revision. (Show Details)Dec 17 2021, 10:04 PM
Alaska (Alaska) edited the summary of this revision. (Show Details)
Alaska (Alaska) edited the summary of this revision. (Show Details)

Showing only the relevant options make sense to me. The check should also take into account if CPU + GPU rendering and used. And also if OptiX is used, which doesn't use any of the options as far as I can tell.

Brecht Van Lommel (brecht) requested changes to this revision.Jan 19 2022, 6:32 PM
This revision now requires changes to proceed.Jan 19 2022, 6:32 PM
  • Rebase to latest master
  • Only show UI options, for devices that make use of them.

Todo: Take CPU + GPU into account.

  • Multi device is now taken into account. If the user selects a device with another type (in practise a CPU), the UI shows CPU rendering options as well.

This is ready now from my end. I'd commit the compact and UI changes as two separate commits.

  • Fix case of OPTIX with multi device in UI.
This revision is now accepted and ready to land.Jan 25 2022, 5:00 PM
This revision was automatically updated to reflect the committed changes.