Page MenuHome

Cycles: port curve-ray intersection from Embree for use in Cycles GPU
ClosedPublic

Authored by Brecht Van Lommel (brecht) on Jun 12 2020, 10:55 PM.

Details

Summary

This keeps render results compatible for combined CPU + GPU rendering.
Peformance and quality primitives is quite different than before. There
are now two options:

  • Rounded Ribbon: render hair as flat ribbon with (fake) rounded normals, for fast rendering. Hair curves are subdivided with a fixed number of user specified subdivisions.

    This gives relatively good results, especially when used with the Principled Hair BSDF and hair viewed from a typical distance. There are artifacts when viewed closed up, though this was also the case with all previous primitives (but different ones).
  • 3D Curve: render hair as 3D curve, for accurate results when viewing hair close up. This automatically subdivides the curve until it is smooth.

    This gives higher quality than any of the previous primitives, but does come at a performance cost and is somewhat slower than our previous Thick curves.

The main problem here is performance. For CPU and OpenCL rendering performance
seems usually quite close or better for similar quality results.

However for CUDA and Optix, performance of 3D curve intersection is problematic,
with e.g. 1.45x longer render time in Koro (though there is no equivalent quality
and rounded ribbons seem fine for that scene). Any help or ideas to optimize this
are welcome.

Ref T73778

Depends on D8012

Diff Detail

Event Timeline

Having such a big performance hit is rather annoying :( Couldn't see anything obvious to change in the code to improve the situation. But since OpenCL is not hit in such a dramatic way, maybe there is something @Patrick Mours (pmoursnv) can help us with? :)

So the way I see this is, on the one hand we have:

  • Ability to improve CPU speed a lot.
  • Matched results between CPU and GPU with the same settings.

On another hand we have considerably slower rendering on NVidia when using accurate curve primitives.

Quite sure the performance loss will be gained back in one way or another (aka it's intermediate state). The default settings are set to the best performance on all platforms. So I am in favour of moving forward with what we have already, and get Embree enabled by default.

This revision is now accepted and ready to land.Jun 17 2020, 3:27 PM