diff options
author | Patrick Mours <pmours@nvidia.com> | 2021-09-22 17:23:08 +0300 |
---|---|---|
committer | Patrick Mours <pmours@nvidia.com> | 2021-09-27 18:12:43 +0300 |
commit | 2189dfd6e25a7bb6b734116619d87bc2d2a535ff (patch) | |
tree | 10dec23d08987c41be76e694836a31feee0b4098 /intern/cycles/kernel/geom/geom_motion_triangle.h | |
parent | 7270ba011cd08656c0b18a60e6503223c1f50dcc (diff) |
Cycles: Rework OptiX visibility flags handling
Before the visibility test against the visibility flags was performed in an any-hit program in OptiX
(called `__anyhit__kernel_optix_visibility_test`), which was using the `__prim_visibility` array.
This is not entirely correct however, since `__prim_visibility` is filled with the merged visibility
flags of all objects that reference that primitive, so if one object uses different visibility flags
than another object, but they both are instances of the same geometry, they would appear the same
way. The reason that the any-hit program was used rather than the OptiX instance visibility mask is
that the latter is currently limited to 8 bits only, which is not sufficient to contain all Cycles
visibility flags (12 bits).
To mostly fix the problem with multiple instances and different visibility flags, I changed things to
use the OptiX instance visibility mask for a subset of the Cycles visibility flags (`PATH_RAY_CAMERA`
to `PATH_RAY_VOLUME_SCATTER`, which fit into 8 bits) and only fall back to the visibility test any-hit
program if that isn't enough (e.g. the ray visibility mask exceeds 8 bits or when using the built-in
curves from OptiX, since the any-hit program is then also used to skip the curve endcaps).
This may also improve performance in some cases, since by default OptiX can now perform the normal
scene intersection trace calls entirely on RT cores without having to jump back to the SM on every
hit to execute the any-hit program.
Fixes T89801
Differential Revision: https://developer.blender.org/D12604
Diffstat (limited to 'intern/cycles/kernel/geom/geom_motion_triangle.h')
0 files changed, 0 insertions, 0 deletions