Author Topic: UHD Cache Camera Specific or Scene Specific?  (Read 693 times)

2019-03-19, 21:20:58

Crazy Homeless Guy

  • Active Users
  • **
  • Posts: 28
    • View Profile

Hi All,

I am wondering if someone can give some insight into how the UHD Cache functions...  I have a scene that I need to render a handful of cameras.  For this particular project, I need to pre-render a UHD Cache and use the stored cache for rendering.  Do I need to render a unique cache for each camera, or does the cache contain the secondary light solver for the entire scene?

Hopefully, that makes sense.

Thanks,
CHG

2019-03-20, 00:46:11
Reply #1

SairesArt

  • Active Users
  • **
  • Posts: 686
  • Pizza | The Cheesen One
    • View Profile
    • SairesArt Portfolio

Hi All,

I am wondering if someone can give some insight into how the UHD Cache functions...  I have a scene that I need to render a handful of cameras.  For this particular project, I need to pre-render a UHD Cache and use the stored cache for rendering.  Do I need to render a unique cache for each camera, or does the cache contain the secondary light solver for the entire scene?

Hopefully, that makes sense.

Thanks,
CHG
By default it's cameraview and frame specific, recalculated each time. Since the core philosophy of Corona is to keep stuff simple, there are not many options to tailor such optimizations in detail, as opposed to V-Ray which for instance allows you to seed such a calculations along a camera's path and precompute a giant irradance cache and view it externally even.
Note, no matter what you do, the first bounce is always brute force anyway, a cached first bounce was voted out a feature quite a time back.

Corona does allow you to save out the UHD cache as a file and reuse it. For flythrough animations especially useful for instance. (As described in Corona's helpdesk article about it )
I presume that this goes for different camera positions as well. The calculation always happens from the view of the camera though. So reusing for other cameras would not be ideal. Where the file's records don't cover the view, brute force will be used instead. I do wonder, whether it makes sense to make a 360° Camera, calculate the UHD cache and since it's 360° reuse it for all the cameras with proper coverage.

You can check how much of the secondary solver is used from the cache in the VFB by reading the "Success rate %" value. If it's 0, then none of the cache is used and the secondary rays are brute forced. Last time I did precalculation, there was a hard limit of 100.000 UHD records. Just FYI.

2019-03-20, 01:15:21
Reply #2

Njen

  • Active Users
  • **
  • Posts: 540
    • View Profile
    • Kickstart Cyan Eyed!
What I've done:

1. Create a camera with extra overscan (I've typically gone for an extra 20% - 30%).
2. Animate the camera to each angle you want on consecutive frames.
3. Set render time to the lowest amount possible.
4. Set 'Precomputation' to 'Try to load + append'
5. Render the sequence.

You will then end up with a UHD cache file that covers all of your angles. After which set 'Precomputation' to 'Load from file', and submit your render for final.
Please support my Kickstarter for my animated film, Cyan Eyed (rendered in Corona)!

2019-03-20, 18:29:50
Reply #3

Crazy Homeless Guy

  • Active Users
  • **
  • Posts: 28
    • View Profile

By default it's cameraview and frame specific, recalculated each time. Since the core philosophy of Corona is to keep stuff simple, there are not many options to tailor such optimizations in detail, as opposed to V-Ray which for instance allows you to seed such a calculations along a camera's path and precompute a giant irradance cache and view it externally even.
Note, no matter what you do, the first bounce is always brute force anyway, a cached first bounce was voted out a feature quite a time back.

Corona does allow you to save out the UHD cache as a file and reuse it. For flythrough animations especially useful for instance. (As described in Corona's helpdesk article about it )
I presume that this goes for different camera positions as well. The calculation always happens from the view of the camera though. So reusing for other cameras would not be ideal. Where the file's records don't cover the view, brute force will be used instead. I do wonder, whether it makes sense to make a 360° Camera, calculate the UHD cache and since it's 360° reuse it for all the cameras with proper coverage.

You can check how much of the secondary solver is used from the cache in the VFB by reading the "Success rate %" value. If it's 0, then none of the cache is used and the secondary rays are brute forced. Last time I did precalculation, there was a hard limit of 100.000 UHD records. Just FYI.

Thanks for the insight.


You will then end up with a UHD cache file that covers all of your angles. After which set 'Precomputation' to 'Load from file', and submit your render for final.

Thanks.  I think I'll go this route.

2019-04-04, 15:40:47
Reply #4

maru

  • Corona Team
  • Active Users
  • ****
  • Posts: 9978
  • Marcin
    • View Profile
I don't know the exact technical details, but The UHD Cache is not as simple as "just irradiance caching" or "just camera-space". It is a mix of various solutions, and is just partly camera-dependent. Usually you can get away with just rendering a single cache file from a single camera, and using it for the whole scene. If something is not covered enough by the UHD Cache, or if something changes (like object or light moving), it will most likely get corrected by the path tracing anyway, as the UHD Cache is a kind of "helper" for path tracing.

2019-04-05, 02:48:42
Reply #5

SairesArt

  • Active Users
  • **
  • Posts: 686
  • Pizza | The Cheesen One
    • View Profile
    • SairesArt Portfolio
What I've done:

1. Create a camera with extra overscan (I've typically gone for an extra 20% - 30%).
2. Animate the camera to each angle you want on consecutive frames.
3. Set render time to the lowest amount possible.
4. Set 'Precomputation' to 'Try to load + append'
5. Render the sequence.

You will then end up with a UHD cache file that covers all of your angles. After which set 'Precomputation' to 'Load from file', and submit your render for final.
You have manually implemented V-Ray's "Use camera path" function to seed the global illumination samples around where the camera is supposed to look. That's pretty clever :]

The UHD Cache is not as simple as "just irradiance caching" or "just camera-space".
Indeed, it's not an irradiance cache in V-Ray's sense, as the first bounce is always brute forced. (although the term doesn't imply one thing or the other actually)

Not "just camera-space" - it actually is. The secondary GI rays are being cast from the Camera's point of view / angle of vision. Samples do indeed end up behind the camera after a couple of bounces, but most of the information remains relevant to what the camera sees. Turn a camera around 180° with a file for the other direction and watch the UHD success rate plummet.

The magic of Corona lies indeed in it brute forcing missing or unfitting information. Truly a headache saver and the primary reason I switched from V-Ray, where you always had to balance GI flicker vs high GI calculation times.