diff options
author | Brecht Van Lommel <brecht@blender.org> | 2022-08-11 17:53:11 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2022-08-15 14:48:02 +0300 |
commit | e949d6da5bd347663addd583ff3f0211c96b81c8 (patch) | |
tree | 4a7478de4eb8fbd4c67989d94bc8e7c0353bca94 /intern/cycles/scene | |
parent | d8841d0aa341e05c8cb9559b116b7e2a9ec11882 (diff) |
Cycles: simplify handling of ray differentials
* Store compact ray differentials in ShaderData and compute full differentials
on demand. This reduces register pressure on the GPU.
* Remove BSDF differential code that was effectively doing nothing as the
differential orientation was discarded when making it compact.
This gives a 1-5% speedup with RTX A6000 + OptiX in our benchmarks, with the
bigger speedups in simpler scenes.
Renders appear to be identical except for the Both displacement option that
does both displacement and bump.
Differential Revision: https://developer.blender.org/D15677
Diffstat (limited to 'intern/cycles/scene')
-rw-r--r-- | intern/cycles/scene/camera.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/intern/cycles/scene/camera.cpp b/intern/cycles/scene/camera.cpp index eec269ab542..d9e574873bd 100644 --- a/intern/cycles/scene/camera.cpp +++ b/intern/cycles/scene/camera.cpp @@ -772,10 +772,7 @@ float Camera::world_to_raster_size(float3 P) #endif /* TODO: would it help to use more accurate differentials here? */ - differential3 dP; - differential_transfer_compact(&dP, ray.dP, ray.D, ray.dD, ray.D, dist); - - return max(len(dP.dx), len(dP.dy)); + return differential_transfer_compact(ray.dP, ray.D, ray.dD, dist); } return res; |