rayd 0.2.2__tar.gz → 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. {rayd-0.2.2 → rayd-0.3.0}/.github/constraints/drjit-build.txt +1 -1
  2. {rayd-0.2.2 → rayd-0.3.0}/.gitignore +2 -1
  3. {rayd-0.2.2 → rayd-0.3.0}/CMakeLists.txt +282 -22
  4. {rayd-0.2.2 → rayd-0.3.0}/PKG-INFO +5 -5
  5. {rayd-0.2.2 → rayd-0.3.0}/README.md +3 -3
  6. rayd-0.3.0/cmake/embed_ptx.cmake +27 -0
  7. {rayd-0.2.2 → rayd-0.3.0}/include/rayd/camera.h +1 -1
  8. {rayd-0.2.2/include/rayd → rayd-0.3.0/include/rayd/edge}/edge.h +48 -1
  9. {rayd-0.2.2/include/rayd/scene → rayd-0.3.0/include/rayd/edge}/scene_edge.h +18 -1
  10. rayd-0.3.0/include/rayd/edge/scene_edge_optix.h +60 -0
  11. rayd-0.3.0/include/rayd/fwd.h +108 -0
  12. {rayd-0.2.2 → rayd-0.3.0}/include/rayd/intersection.h +14 -2
  13. {rayd-0.2.2 → rayd-0.3.0}/include/rayd/mesh.h +1 -1
  14. {rayd-0.2.2/include/rayd → rayd-0.3.0/include/rayd/multipath}/reflection.h +18 -2
  15. rayd-0.3.0/include/rayd/multipath/reflection_accumulation.h +113 -0
  16. rayd-0.3.0/include/rayd/multipath/segment_visibility.h +87 -0
  17. {rayd-0.2.2 → rayd-0.3.0}/include/rayd/optix.h +16 -0
  18. {rayd-0.2.2 → rayd-0.3.0}/include/rayd/scene/scene.h +68 -4
  19. {rayd-0.2.2 → rayd-0.3.0}/include/rayd/scene/scene_optix.h +10 -0
  20. {rayd-0.2.2 → rayd-0.3.0}/include/rayd/types.h +20 -0
  21. {rayd-0.2.2 → rayd-0.3.0}/pyproject.toml +3 -3
  22. {rayd-0.2.2 → rayd-0.3.0}/rayd/torch/__init__.py +2 -0
  23. {rayd-0.2.2 → rayd-0.3.0}/rayd/torch/_convert.py +3 -2
  24. {rayd-0.2.2 → rayd-0.3.0}/rayd/torch/_native.py +128 -249
  25. rayd-0.3.0/rayd/torch/_state.py +44 -0
  26. {rayd-0.2.2 → rayd-0.3.0}/rayd/torch/_util.py +3 -25
  27. {rayd-0.2.2 → rayd-0.3.0}/rayd/torch/camera.py +32 -101
  28. {rayd-0.2.2 → rayd-0.3.0}/rayd/torch/mesh.py +8 -19
  29. {rayd-0.2.2 → rayd-0.3.0}/rayd/torch/scene.py +40 -115
  30. rayd-0.3.0/rayd/torch/types.py +226 -0
  31. {rayd-0.2.2/src/scene → rayd-0.3.0/src/edge}/edge_bvh.cu +76 -19
  32. {rayd-0.2.2/src/scene → rayd-0.3.0/src/edge}/edge_bvh.h +11 -0
  33. {rayd-0.2.2/src/scene → rayd-0.3.0/src/edge}/edge_bvh_config.h +0 -27
  34. rayd-0.3.0/src/edge/edge_optix.cu +610 -0
  35. rayd-0.3.0/src/edge/edge_optix_params.h +40 -0
  36. rayd-0.3.0/src/edge/edge_optix_ptx.h +2106 -0
  37. {rayd-0.2.2/src/scene → rayd-0.3.0/src/edge}/scene_edge.cpp +341 -115
  38. rayd-0.3.0/src/edge/scene_edge_optix.cpp +915 -0
  39. rayd-0.3.0/src/multipath/reflection_accumulation.cu +665 -0
  40. rayd-0.3.0/src/multipath/reflection_accumulation_host.cpp +225 -0
  41. rayd-0.3.0/src/multipath/reflection_accumulation_host.h +34 -0
  42. rayd-0.3.0/src/multipath/reflection_accumulation_params.h +105 -0
  43. rayd-0.3.0/src/multipath/reflection_accumulation_ptx.h +1426 -0
  44. {rayd-0.2.2 → rayd-0.3.0}/src/multipath/reflection_trace.cu +28 -0
  45. {rayd-0.2.2 → rayd-0.3.0}/src/multipath/reflection_trace_params.h +8 -0
  46. rayd-0.3.0/src/multipath/reflection_trace_ptx.h +594 -0
  47. rayd-0.3.0/src/multipath/segment_visibility.cu +251 -0
  48. rayd-0.3.0/src/multipath/segment_visibility_host.cpp +291 -0
  49. rayd-0.3.0/src/multipath/segment_visibility_host.h +57 -0
  50. rayd-0.3.0/src/multipath/segment_visibility_params.h +52 -0
  51. rayd-0.3.0/src/multipath/segment_visibility_ptx.h +1483 -0
  52. {rayd-0.2.2 → rayd-0.3.0}/src/native_launch_audit.cpp +3 -0
  53. {rayd-0.2.2 → rayd-0.3.0}/src/native_launch_audit.h +3 -1
  54. {rayd-0.2.2 → rayd-0.3.0}/src/rayd.cpp +436 -13
  55. {rayd-0.2.2 → rayd-0.3.0}/src/scene/scene.cpp +1824 -20
  56. {rayd-0.2.2 → rayd-0.3.0}/src/scene/scene_optix.cpp +99 -2
  57. {rayd-0.2.2 → rayd-0.3.0}/tests/benchmark_edge_bvh_stages.py +0 -7
  58. {rayd-0.2.2 → rayd-0.3.0}/tests/drjit/test_geometry.py +464 -77
  59. rayd-0.3.0/tests/drjit/test_reflection_accumulation.py +244 -0
  60. rayd-0.3.0/tests/drjit/test_visibility_topk.py +435 -0
  61. {rayd-0.2.2 → rayd-0.3.0}/tests/torch/test_geometry.py +184 -2
  62. rayd-0.2.2/cmake/embed_ptx.cmake +0 -11
  63. rayd-0.2.2/docs/api_reference.md +0 -424
  64. rayd-0.2.2/docs/build_optimization.md +0 -71
  65. rayd-0.2.2/docs/edge_bvh_bottleneck_analysis.md +0 -168
  66. rayd-0.2.2/docs/edge_bvh_lbvh_treelet_improvement_plan.md +0 -330
  67. rayd-0.2.2/docs/edge_bvh_optimization_log.md +0 -108
  68. rayd-0.2.2/docs/edge_bvh_stage3_preparation.md +0 -161
  69. rayd-0.2.2/docs/multi_bounce_reflection_trace.md +0 -1039
  70. rayd-0.2.2/docs/performance_benchmark.json +0 -552
  71. rayd-0.2.2/docs/performance_benchmark.png +0 -0
  72. rayd-0.2.2/docs/reflection_trace_gpu_dedup.md +0 -641
  73. rayd-0.2.2/docs/slang_interop.md +0 -231
  74. rayd-0.2.2/include/rayd/fwd.h +0 -59
  75. rayd-0.2.2/rayd/torch/_state.py +0 -109
  76. rayd-0.2.2/rayd/torch/types.py +0 -373
  77. rayd-0.2.2/src/multipath/reflection_trace_ptx.h +0 -464
  78. rayd-0.2.2/src/scene/experimental/edge_bvh_ploc.h +0 -32
  79. rayd-0.2.2/src/scene/experimental/edge_bvh_ploc_build.inc +0 -685
  80. rayd-0.2.2/src/scene/experimental/edge_bvh_ploc_kernels.inc +0 -377
  81. rayd-0.2.2/src/scene/experimental/scene_edge_ploc.inc +0 -318
  82. {rayd-0.2.2 → rayd-0.3.0}/.github/workflows/pypi.yml +0 -0
  83. {rayd-0.2.2 → rayd-0.3.0}/LICENSE +0 -0
  84. {rayd-0.2.2 → rayd-0.3.0}/examples/README.md +0 -0
  85. {rayd-0.2.2 → rayd-0.3.0}/examples/basics/camera_edge_sampling_gradient.py +0 -0
  86. {rayd-0.2.2 → rayd-0.3.0}/examples/basics/nearest_edge_query.py +0 -0
  87. {rayd-0.2.2 → rayd-0.3.0}/examples/basics/ray_mesh_intersection.py +0 -0
  88. {rayd-0.2.2 → rayd-0.3.0}/examples/renderer/README.md +0 -0
  89. {rayd-0.2.2 → rayd-0.3.0}/examples/renderer/cornell_box.png +0 -0
  90. {rayd-0.2.2 → rayd-0.3.0}/examples/renderer/cornell_box.py +0 -0
  91. {rayd-0.2.2 → rayd-0.3.0}/examples/renderer/rfdt.png +0 -0
  92. {rayd-0.2.2 → rayd-0.3.0}/include/rayd/constants.h +0 -0
  93. {rayd-0.2.2 → rayd-0.3.0}/include/rayd/ray.h +0 -0
  94. {rayd-0.2.2 → rayd-0.3.0}/include/rayd/rayd.h +0 -0
  95. {rayd-0.2.2 → rayd-0.3.0}/include/rayd/slang/interop.h +0 -0
  96. {rayd-0.2.2 → rayd-0.3.0}/include/rayd/slang/interop_types.h +0 -0
  97. {rayd-0.2.2 → rayd-0.3.0}/include/rayd/slang/rayd.slang +0 -0
  98. {rayd-0.2.2 → rayd-0.3.0}/include/rayd/transform.h +0 -0
  99. {rayd-0.2.2 → rayd-0.3.0}/include/rayd/utils.h +0 -0
  100. {rayd-0.2.2 → rayd-0.3.0}/include/rayd_slang.slang +0 -0
  101. {rayd-0.2.2 → rayd-0.3.0}/rayd/__init__.py +0 -0
  102. {rayd-0.2.2 → rayd-0.3.0}/rayd/slang/__init__.py +0 -0
  103. {rayd-0.2.2 → rayd-0.3.0}/rayd/torch/_env.py +0 -0
  104. {rayd-0.2.2 → rayd-0.3.0}/rayd/torch/_interop_patch.py +0 -0
  105. {rayd-0.2.2 → rayd-0.3.0}/src/camera.cpp +0 -0
  106. {rayd-0.2.2 → rayd-0.3.0}/src/mesh.cpp +0 -0
  107. {rayd-0.2.2 → rayd-0.3.0}/src/multipath/reflection_dedup.cu +0 -0
  108. {rayd-0.2.2 → rayd-0.3.0}/src/multipath/reflection_dedup.h +0 -0
  109. {rayd-0.2.2 → rayd-0.3.0}/src/multipath/reflection_trace_host.cpp +0 -0
  110. {rayd-0.2.2 → rayd-0.3.0}/src/multipath/reflection_trace_host.h +0 -0
  111. {rayd-0.2.2 → rayd-0.3.0}/src/optix.cpp +0 -0
  112. {rayd-0.2.2 → rayd-0.3.0}/src/slang_interop.cpp +0 -0
  113. {rayd-0.2.2 → rayd-0.3.0}/tests/__init__.py +0 -0
  114. {rayd-0.2.2 → rayd-0.3.0}/tests/baseline_cases.py +0 -0
  115. {rayd-0.2.2 → rayd-0.3.0}/tests/baseline_utils.py +0 -0
  116. {rayd-0.2.2 → rayd-0.3.0}/tests/baselines/drjit_v0_4_6/camera/perspective_fov.json +0 -0
  117. {rayd-0.2.2 → rayd-0.3.0}/tests/baselines/drjit_v0_4_6/camera/perspective_intrinsic.json +0 -0
  118. {rayd-0.2.2 → rayd-0.3.0}/tests/baselines/drjit_v0_4_6/camera/sample_primary_ray.json +0 -0
  119. {rayd-0.2.2 → rayd-0.3.0}/tests/baselines/drjit_v0_4_6/camera/sample_to_world.json +0 -0
  120. {rayd-0.2.2 → rayd-0.3.0}/tests/baselines/drjit_v0_4_6/camera/world_to_sample.json +0 -0
  121. {rayd-0.2.2 → rayd-0.3.0}/tests/baselines/drjit_v0_4_6/edges/primary_edge_sampling.json +0 -0
  122. {rayd-0.2.2 → rayd-0.3.0}/tests/baselines/drjit_v0_4_6/edges/secondary_edges.json +0 -0
  123. {rayd-0.2.2 → rayd-0.3.0}/tests/baselines/drjit_v0_4_6/geometry/batched_hits.json +0 -0
  124. {rayd-0.2.2 → rayd-0.3.0}/tests/baselines/drjit_v0_4_6/geometry/constant_hit.json +0 -0
  125. {rayd-0.2.2 → rayd-0.3.0}/tests/baselines/drjit_v0_4_6/geometry/degenerate.json +0 -0
  126. {rayd-0.2.2 → rayd-0.3.0}/tests/baselines/drjit_v0_4_6/geometry/miss.json +0 -0
  127. {rayd-0.2.2 → rayd-0.3.0}/tests/baselines/drjit_v0_4_6/geometry/multi_mesh.json +0 -0
  128. {rayd-0.2.2 → rayd-0.3.0}/tests/baselines/drjit_v0_4_6/geometry/uv.json +0 -0
  129. {rayd-0.2.2 → rayd-0.3.0}/tests/baselines/drjit_v0_4_6/gradients/transform_gradients.json +0 -0
  130. {rayd-0.2.2 → rayd-0.3.0}/tests/baselines/drjit_v0_4_6/gradients/vertex_gradients.json +0 -0
  131. {rayd-0.2.2 → rayd-0.3.0}/tests/baselines/drjit_v0_4_6/manifest.json +0 -0
  132. {rayd-0.2.2 → rayd-0.3.0}/tests/baselines/drjit_v0_4_6/stress/repeated_run_summary.json +0 -0
  133. {rayd-0.2.2 → rayd-0.3.0}/tests/baselines/drjit_v0_4_6/transforms/composition_left_right.json +0 -0
  134. {rayd-0.2.2 → rayd-0.3.0}/tests/baselines/drjit_v0_4_6/transforms/direction_transform_checks.json +0 -0
  135. {rayd-0.2.2 → rayd-0.3.0}/tests/baselines/drjit_v0_4_6/transforms/matrix_entry_checks.json +0 -0
  136. {rayd-0.2.2 → rayd-0.3.0}/tests/baselines/drjit_v0_4_6/transforms/point_transform_checks.json +0 -0
  137. {rayd-0.2.2 → rayd-0.3.0}/tests/benchmark_edge_bvh_cutoff_compare.py +0 -0
  138. {rayd-0.2.2 → rayd-0.3.0}/tests/benchmark_edge_bvh_pressure.py +0 -0
  139. {rayd-0.2.2 → rayd-0.3.0}/tests/benchmark_edge_queries.py +0 -0
  140. {rayd-0.2.2 → rayd-0.3.0}/tests/benchmark_support.py +0 -0
  141. {rayd-0.2.2 → rayd-0.3.0}/tests/drjit/__init__.py +0 -0
  142. {rayd-0.2.2 → rayd-0.3.0}/tests/drjit/test_baseline.py +0 -0
  143. {rayd-0.2.2 → rayd-0.3.0}/tests/profile_kernel_launches.py +0 -0
  144. {rayd-0.2.2 → rayd-0.3.0}/tests/slang/__init__.py +0 -0
  145. {rayd-0.2.2 → rayd-0.3.0}/tests/slang/cases/load_module_error.py +0 -0
  146. {rayd-0.2.2 → rayd-0.3.0}/tests/slang/cases/slang_ad_autograd.py +0 -0
  147. {rayd-0.2.2 → rayd-0.3.0}/tests/slang/cases/slang_ad_multi_param.py +0 -0
  148. {rayd-0.2.2 → rayd-0.3.0}/tests/slang/cases/slang_ad_optimize.py +0 -0
  149. {rayd-0.2.2 → rayd-0.3.0}/tests/slang/cases/slang_ad_struct_return.py +0 -0
  150. {rayd-0.2.2 → rayd-0.3.0}/tests/slang/cases/slang_rayd_intersect.py +0 -0
  151. {rayd-0.2.2 → rayd-0.3.0}/tests/slang/cases/slang_rayd_nearest_edge.py +0 -0
  152. {rayd-0.2.2 → rayd-0.3.0}/tests/slang/shaders/rayd_query.slang +0 -0
  153. {rayd-0.2.2 → rayd-0.3.0}/tests/slang/shaders/rayd_query_ad.slang +0 -0
  154. {rayd-0.2.2 → rayd-0.3.0}/tests/slang/test_interop.slang +0 -0
  155. {rayd-0.2.2 → rayd-0.3.0}/tests/slang/test_slang.py +0 -0
  156. {rayd-0.2.2 → rayd-0.3.0}/tests/test_project_metadata.py +0 -0
  157. {rayd-0.2.2 → rayd-0.3.0}/tests/test_torch_interop_patch.py +0 -0
  158. {rayd-0.2.2 → rayd-0.3.0}/tests/torch/__init__.py +0 -0
  159. {rayd-0.2.2 → rayd-0.3.0}/tests/torch/test_edge_bvh_pressure.py +0 -0
@@ -1,2 +1,2 @@
1
- drjit==1.2.0
1
+ drjit==1.3.1
2
2
  nanobind==2.9.2
@@ -22,4 +22,5 @@ unit_test/result/
22
22
  .slangtorch_cache/
23
23
  .rayd_slang_cache/
24
24
  tests/slang/test_interop_gen.cpp
25
- artifacts/
25
+ artifacts/
26
+ docs/
@@ -12,6 +12,9 @@ option(RAYD_OPTIX_PRODUCTION_CONFIG "Use OptiX production module settings (LEVEL
12
12
  option(RAYD_NANOBIND_NOMINSIZE "Disable nanobind's size-oriented optimization flags in optimized configs." ON)
13
13
  option(RAYD_ENABLE_LTO "Enable nanobind/C++ link-time optimization." OFF)
14
14
  option(RAYD_REGENERATE_REFLECTION_TRACE_PTX "Regenerate reflection_trace PTX during the build. Requires OptiX SDK headers." OFF)
15
+ option(RAYD_REGENERATE_REFLECTION_ACCUMULATION_PTX "Regenerate reflection_accumulation PTX during the build. Requires OptiX SDK headers." OFF)
16
+ option(RAYD_REGENERATE_SEGMENT_VISIBILITY_PTX "Regenerate segment_visibility PTX during the build. Requires OptiX SDK headers." OFF)
17
+ option(RAYD_REGENERATE_EDGE_OPTIX_PTX "Regenerate edge OptiX custom-AABB PTX during the build. Requires OptiX SDK headers." OFF)
15
18
 
16
19
  find_package(Python COMPONENTS Interpreter Development.Module REQUIRED)
17
20
  execute_process(
@@ -21,7 +24,7 @@ execute_process(
21
24
  OUTPUT_STRIP_TRAILING_WHITESPACE
22
25
  )
23
26
  if(NOT DRJIT_CMAKE_DIR_RESULT EQUAL 0)
24
- message(FATAL_ERROR "Could not locate the installed Dr.Jit CMake package. Ensure drjit>=1.2.0 is installed in the build environment.")
27
+ message(FATAL_ERROR "Could not locate the installed Dr.Jit CMake package. Ensure drjit>=1.3.1 is installed in the build environment.")
25
28
  endif()
26
29
 
27
30
  execute_process(
@@ -112,10 +115,12 @@ set(RAYD_CORE_SOURCE_FILES
112
115
 
113
116
  ${RAYD_INCLUDE_DIR}/ray.h
114
117
  ${RAYD_INCLUDE_DIR}/intersection.h
115
- ${RAYD_INCLUDE_DIR}/reflection.h
118
+ ${RAYD_INCLUDE_DIR}/multipath/reflection.h
119
+ ${RAYD_INCLUDE_DIR}/multipath/reflection_accumulation.h
120
+ ${RAYD_INCLUDE_DIR}/multipath/segment_visibility.h
116
121
  ${RAYD_INCLUDE_DIR}/transform.h
117
122
 
118
- ${RAYD_INCLUDE_DIR}/edge.h
123
+ ${RAYD_INCLUDE_DIR}/edge/edge.h
119
124
 
120
125
  ${RAYD_INCLUDE_DIR}/mesh.h
121
126
  ${RAYD_SOURCE_DIR}/mesh.cpp
@@ -130,14 +135,20 @@ set(RAYD_CORE_SOURCE_FILES
130
135
  ${RAYD_SOURCE_DIR}/multipath/reflection_trace_host.h
131
136
  ${RAYD_SOURCE_DIR}/multipath/reflection_trace_params.h
132
137
  ${RAYD_SOURCE_DIR}/multipath/reflection_trace_host.cpp
138
+ ${RAYD_SOURCE_DIR}/multipath/reflection_accumulation_host.h
139
+ ${RAYD_SOURCE_DIR}/multipath/reflection_accumulation_params.h
140
+ ${RAYD_SOURCE_DIR}/multipath/reflection_accumulation_host.cpp
141
+ ${RAYD_SOURCE_DIR}/multipath/segment_visibility_host.h
142
+ ${RAYD_SOURCE_DIR}/multipath/segment_visibility_params.h
143
+ ${RAYD_SOURCE_DIR}/multipath/segment_visibility_host.cpp
133
144
  ${RAYD_SOURCE_DIR}/multipath/reflection_dedup.h
134
- ${RAYD_INCLUDE_DIR}/scene/scene_edge.h
135
- ${RAYD_SOURCE_DIR}/scene/scene_edge.cpp
136
- ${RAYD_SOURCE_DIR}/scene/edge_bvh.h
137
- ${RAYD_SOURCE_DIR}/scene/experimental/edge_bvh_ploc.h
138
- ${RAYD_SOURCE_DIR}/scene/experimental/edge_bvh_ploc_build.inc
139
- ${RAYD_SOURCE_DIR}/scene/experimental/edge_bvh_ploc_kernels.inc
140
- ${RAYD_SOURCE_DIR}/scene/experimental/scene_edge_ploc.inc
145
+ ${RAYD_INCLUDE_DIR}/edge/scene_edge.h
146
+ ${RAYD_INCLUDE_DIR}/edge/scene_edge_optix.h
147
+ ${RAYD_SOURCE_DIR}/edge/scene_edge.cpp
148
+ ${RAYD_SOURCE_DIR}/edge/scene_edge_optix.cpp
149
+ ${RAYD_SOURCE_DIR}/edge/edge_bvh.h
150
+ ${RAYD_SOURCE_DIR}/edge/edge_bvh_config.h
151
+ ${RAYD_SOURCE_DIR}/edge/edge_optix_params.h
141
152
 
142
153
  ${RAYD_INCLUDE_DIR}/scene/scene.h
143
154
  ${RAYD_SOURCE_DIR}/scene/scene.cpp
@@ -158,18 +169,15 @@ if(WIN32)
158
169
  "@echo off\r\n\
159
170
  call \"${RAYD_VSDEVCMD}\" -arch=x64\r\n\
160
171
  if errorlevel 1 exit /b %errorlevel%\r\n\
161
- \"${CUDA_NVCC_EXECUTABLE}\" --extended-lambda -std=c++17 -c \"${CMAKE_CURRENT_SOURCE_DIR}/${RAYD_SOURCE_DIR}/scene/edge_bvh.cu\" ${RAYD_CUDA_INCLUDE_FLAGS} ${RAYD_CUDA_DEFINITIONS} -Xcompiler \"/MD /O2 /EHsc /wd4819\" -o \"${RAYD_CUDA_OBJECT}\"\r\n\
172
+ \"${CUDA_NVCC_EXECUTABLE}\" --extended-lambda -std=c++17 -c \"${CMAKE_CURRENT_SOURCE_DIR}/${RAYD_SOURCE_DIR}/edge/edge_bvh.cu\" ${RAYD_CUDA_INCLUDE_FLAGS} ${RAYD_CUDA_DEFINITIONS} -Xcompiler \"/MD /O2 /EHsc /wd4819\" -o \"${RAYD_CUDA_OBJECT}\"\r\n\
162
173
  ")
163
174
  add_custom_command(
164
175
  OUTPUT "${RAYD_CUDA_OBJECT}"
165
176
  COMMAND "${RAYD_CUDA_BUILD_SCRIPT}"
166
177
  DEPENDS
167
178
  "${RAYD_CUDA_BUILD_SCRIPT}"
168
- "${CMAKE_CURRENT_SOURCE_DIR}/${RAYD_SOURCE_DIR}/scene/edge_bvh.cu"
169
- "${CMAKE_CURRENT_SOURCE_DIR}/${RAYD_SOURCE_DIR}/scene/edge_bvh.h"
170
- "${CMAKE_CURRENT_SOURCE_DIR}/${RAYD_SOURCE_DIR}/scene/experimental/edge_bvh_ploc.h"
171
- "${CMAKE_CURRENT_SOURCE_DIR}/${RAYD_SOURCE_DIR}/scene/experimental/edge_bvh_ploc_build.inc"
172
- "${CMAKE_CURRENT_SOURCE_DIR}/${RAYD_SOURCE_DIR}/scene/experimental/edge_bvh_ploc_kernels.inc"
179
+ "${CMAKE_CURRENT_SOURCE_DIR}/${RAYD_SOURCE_DIR}/edge/edge_bvh.cu"
180
+ "${CMAKE_CURRENT_SOURCE_DIR}/${RAYD_SOURCE_DIR}/edge/edge_bvh.h"
173
181
  VERBATIM
174
182
  )
175
183
  else()
@@ -177,16 +185,13 @@ else()
177
185
  add_custom_command(
178
186
  OUTPUT "${RAYD_CUDA_OBJECT}"
179
187
  COMMAND "${CUDA_NVCC_EXECUTABLE}" -ccbin "${CMAKE_CXX_COMPILER}" -std=c++17 -Xcompiler=-fPIC -c
180
- "${CMAKE_CURRENT_SOURCE_DIR}/${RAYD_SOURCE_DIR}/scene/edge_bvh.cu"
188
+ "${CMAKE_CURRENT_SOURCE_DIR}/${RAYD_SOURCE_DIR}/edge/edge_bvh.cu"
181
189
  ${RAYD_CUDA_INCLUDE_FLAGS_LIST}
182
190
  ${RAYD_CUDA_DEFINITIONS_LIST}
183
191
  -o "${RAYD_CUDA_OBJECT}"
184
192
  DEPENDS
185
- "${CMAKE_CURRENT_SOURCE_DIR}/${RAYD_SOURCE_DIR}/scene/edge_bvh.cu"
186
- "${CMAKE_CURRENT_SOURCE_DIR}/${RAYD_SOURCE_DIR}/scene/edge_bvh.h"
187
- "${CMAKE_CURRENT_SOURCE_DIR}/${RAYD_SOURCE_DIR}/scene/experimental/edge_bvh_ploc.h"
188
- "${CMAKE_CURRENT_SOURCE_DIR}/${RAYD_SOURCE_DIR}/scene/experimental/edge_bvh_ploc_build.inc"
189
- "${CMAKE_CURRENT_SOURCE_DIR}/${RAYD_SOURCE_DIR}/scene/experimental/edge_bvh_ploc_kernels.inc"
193
+ "${CMAKE_CURRENT_SOURCE_DIR}/${RAYD_SOURCE_DIR}/edge/edge_bvh.cu"
194
+ "${CMAKE_CURRENT_SOURCE_DIR}/${RAYD_SOURCE_DIR}/edge/edge_bvh.h"
190
195
  VERBATIM
191
196
  )
192
197
  endif()
@@ -315,6 +320,261 @@ else()
315
320
  list(APPEND RAYD_CORE_SOURCE_FILES "${RAYD_REFLECTION_TRACE_PTX_H_COMMITTED}")
316
321
  endif()
317
322
 
323
+ set(RAYD_REFLECTION_ACCUMULATION_CU "${CMAKE_CURRENT_SOURCE_DIR}/${RAYD_SOURCE_DIR}/multipath/reflection_accumulation.cu")
324
+ set(RAYD_REFLECTION_ACCUMULATION_PTX_H "${CMAKE_CURRENT_BINARY_DIR}/reflection_accumulation_ptx.h")
325
+ set(RAYD_REFLECTION_ACCUMULATION_PTX_H_COMMITTED
326
+ "${CMAKE_CURRENT_SOURCE_DIR}/${RAYD_SOURCE_DIR}/multipath/reflection_accumulation_ptx.h")
327
+
328
+ if(RAYD_REGENERATE_REFLECTION_ACCUMULATION_PTX)
329
+ find_path(OPTIX_INCLUDE_DIR optix.h
330
+ HINTS
331
+ ENV OPTIX_INCLUDE_DIR
332
+ ENV OPTIX_PATH
333
+ "$ENV{PROGRAMDATA}/NVIDIA Corporation/OptiX SDK 9.1.0"
334
+ "$ENV{PROGRAMDATA}/NVIDIA Corporation/OptiX SDK 8.1.0"
335
+ "$ENV{PROGRAMDATA}/NVIDIA Corporation/OptiX SDK 8.0.0"
336
+ "/usr/local/NVIDIA-OptiX-SDK-9.1.0-linux64-x86_64"
337
+ "/usr/local/NVIDIA-OptiX-SDK-8.1.0-linux64-x86_64"
338
+ "/usr/local/NVIDIA-OptiX-SDK-8.0.0-linux64-x86_64"
339
+ "/opt/NVIDIA-OptiX-SDK-9.1.0-linux64-x86_64"
340
+ "/opt/NVIDIA-OptiX-SDK-8.1.0-linux64-x86_64"
341
+ "/opt/NVIDIA-OptiX-SDK-8.0.0-linux64-x86_64"
342
+ PATH_SUFFIXES include
343
+ )
344
+ if(NOT OPTIX_INCLUDE_DIR)
345
+ message(FATAL_ERROR
346
+ "Could not locate OptiX SDK headers needed to regenerate reflection_accumulation PTX. "
347
+ "Set OPTIX_INCLUDE_DIR or OPTIX_PATH, or disable RAYD_REGENERATE_REFLECTION_ACCUMULATION_PTX.")
348
+ endif()
349
+
350
+ set(RAYD_REFLECTION_ACCUMULATION_PTX "${CMAKE_CURRENT_BINARY_DIR}/reflection_accumulation.ptx")
351
+ if(WIN32)
352
+ set(RAYD_REFLECTION_ACCUMULATION_BUILD_SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/build_reflection_accumulation_ptx.bat")
353
+ file(GENERATE OUTPUT "${RAYD_REFLECTION_ACCUMULATION_BUILD_SCRIPT}" CONTENT
354
+ "@echo off\r\n\
355
+ call \"${RAYD_VSDEVCMD}\" -arch=x64\r\n\
356
+ if errorlevel 1 exit /b %errorlevel%\r\n\
357
+ \"${CUDA_NVCC_EXECUTABLE}\" -ptx --use_fast_math -std=c++17 -arch=compute_70 \"${RAYD_REFLECTION_ACCUMULATION_CU}\" -I\"${OPTIX_INCLUDE_DIR}\" ${RAYD_CUDA_INCLUDE_FLAGS} ${RAYD_CUDA_DEFINITIONS} -o \"${RAYD_REFLECTION_ACCUMULATION_PTX}\"\r\n\
358
+ ")
359
+ add_custom_command(
360
+ OUTPUT "${RAYD_REFLECTION_ACCUMULATION_PTX}"
361
+ COMMAND "${RAYD_REFLECTION_ACCUMULATION_BUILD_SCRIPT}"
362
+ DEPENDS
363
+ "${RAYD_REFLECTION_ACCUMULATION_BUILD_SCRIPT}"
364
+ "${RAYD_REFLECTION_ACCUMULATION_CU}"
365
+ "${CMAKE_CURRENT_SOURCE_DIR}/${RAYD_SOURCE_DIR}/multipath/reflection_accumulation_params.h"
366
+ VERBATIM
367
+ )
368
+ else()
369
+ add_custom_command(
370
+ OUTPUT "${RAYD_REFLECTION_ACCUMULATION_PTX}"
371
+ COMMAND "${CUDA_NVCC_EXECUTABLE}" -ptx --use_fast_math -std=c++17 -arch=compute_70
372
+ "${RAYD_REFLECTION_ACCUMULATION_CU}"
373
+ -I"${OPTIX_INCLUDE_DIR}"
374
+ ${RAYD_CUDA_INCLUDE_FLAGS_LIST}
375
+ ${RAYD_CUDA_DEFINITIONS_LIST}
376
+ -o "${RAYD_REFLECTION_ACCUMULATION_PTX}"
377
+ DEPENDS
378
+ "${RAYD_REFLECTION_ACCUMULATION_CU}"
379
+ "${CMAKE_CURRENT_SOURCE_DIR}/${RAYD_SOURCE_DIR}/multipath/reflection_accumulation_params.h"
380
+ VERBATIM
381
+ )
382
+ endif()
383
+
384
+ add_custom_command(
385
+ OUTPUT "${RAYD_REFLECTION_ACCUMULATION_PTX_H}"
386
+ COMMAND ${CMAKE_COMMAND}
387
+ -DPTX_FILE=${RAYD_REFLECTION_ACCUMULATION_PTX}
388
+ -DOUTPUT_FILE=${RAYD_REFLECTION_ACCUMULATION_PTX_H}
389
+ -DVAR_NAME=reflection_accumulation_ptx
390
+ -P "${CMAKE_CURRENT_SOURCE_DIR}/cmake/embed_ptx.cmake"
391
+ DEPENDS
392
+ "${RAYD_REFLECTION_ACCUMULATION_PTX}"
393
+ "${CMAKE_CURRENT_SOURCE_DIR}/cmake/embed_ptx.cmake"
394
+ VERBATIM
395
+ )
396
+ set_source_files_properties("${RAYD_REFLECTION_ACCUMULATION_PTX_H}" PROPERTIES GENERATED TRUE)
397
+ list(APPEND RAYD_CORE_SOURCE_FILES "${RAYD_REFLECTION_ACCUMULATION_PTX_H}")
398
+ else()
399
+ if(NOT EXISTS "${RAYD_REFLECTION_ACCUMULATION_PTX_H_COMMITTED}")
400
+ message(FATAL_ERROR
401
+ "Missing committed reflection_accumulation PTX header at "
402
+ "${RAYD_REFLECTION_ACCUMULATION_PTX_H_COMMITTED}. "
403
+ "Restore it or enable RAYD_REGENERATE_REFLECTION_ACCUMULATION_PTX with OptiX SDK headers available.")
404
+ endif()
405
+ list(APPEND RAYD_CORE_SOURCE_FILES "${RAYD_REFLECTION_ACCUMULATION_PTX_H_COMMITTED}")
406
+ endif()
407
+
408
+ set(RAYD_SEGMENT_VISIBILITY_CU "${CMAKE_CURRENT_SOURCE_DIR}/${RAYD_SOURCE_DIR}/multipath/segment_visibility.cu")
409
+ set(RAYD_SEGMENT_VISIBILITY_PTX_H "${CMAKE_CURRENT_BINARY_DIR}/segment_visibility_ptx.h")
410
+ set(RAYD_SEGMENT_VISIBILITY_PTX_H_COMMITTED
411
+ "${CMAKE_CURRENT_SOURCE_DIR}/${RAYD_SOURCE_DIR}/multipath/segment_visibility_ptx.h")
412
+
413
+ if(RAYD_REGENERATE_SEGMENT_VISIBILITY_PTX)
414
+ find_path(OPTIX_INCLUDE_DIR optix.h
415
+ HINTS
416
+ ENV OPTIX_INCLUDE_DIR
417
+ ENV OPTIX_PATH
418
+ "$ENV{PROGRAMDATA}/NVIDIA Corporation/OptiX SDK 9.1.0"
419
+ "$ENV{PROGRAMDATA}/NVIDIA Corporation/OptiX SDK 8.1.0"
420
+ "$ENV{PROGRAMDATA}/NVIDIA Corporation/OptiX SDK 8.0.0"
421
+ "/usr/local/NVIDIA-OptiX-SDK-9.1.0-linux64-x86_64"
422
+ "/usr/local/NVIDIA-OptiX-SDK-8.1.0-linux64-x86_64"
423
+ "/usr/local/NVIDIA-OptiX-SDK-8.0.0-linux64-x86_64"
424
+ "/opt/NVIDIA-OptiX-SDK-9.1.0-linux64-x86_64"
425
+ "/opt/NVIDIA-OptiX-SDK-8.1.0-linux64-x86_64"
426
+ "/opt/NVIDIA-OptiX-SDK-8.0.0-linux64-x86_64"
427
+ PATH_SUFFIXES include
428
+ )
429
+ if(NOT OPTIX_INCLUDE_DIR)
430
+ message(FATAL_ERROR
431
+ "Could not locate OptiX SDK headers needed to regenerate segment_visibility PTX. "
432
+ "Set OPTIX_INCLUDE_DIR or OPTIX_PATH, or disable RAYD_REGENERATE_SEGMENT_VISIBILITY_PTX.")
433
+ endif()
434
+
435
+ set(RAYD_SEGMENT_VISIBILITY_PTX "${CMAKE_CURRENT_BINARY_DIR}/segment_visibility.ptx")
436
+ if(WIN32)
437
+ set(RAYD_SEGMENT_VISIBILITY_BUILD_SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/build_segment_visibility_ptx.bat")
438
+ file(GENERATE OUTPUT "${RAYD_SEGMENT_VISIBILITY_BUILD_SCRIPT}" CONTENT
439
+ "@echo off\r\n\
440
+ call \"${RAYD_VSDEVCMD}\" -arch=x64\r\n\
441
+ if errorlevel 1 exit /b %errorlevel%\r\n\
442
+ \"${CUDA_NVCC_EXECUTABLE}\" -ptx --use_fast_math -std=c++17 -arch=compute_70 \"${RAYD_SEGMENT_VISIBILITY_CU}\" -I\"${OPTIX_INCLUDE_DIR}\" ${RAYD_CUDA_INCLUDE_FLAGS} ${RAYD_CUDA_DEFINITIONS} -o \"${RAYD_SEGMENT_VISIBILITY_PTX}\"\r\n\
443
+ ")
444
+ add_custom_command(
445
+ OUTPUT "${RAYD_SEGMENT_VISIBILITY_PTX}"
446
+ COMMAND "${RAYD_SEGMENT_VISIBILITY_BUILD_SCRIPT}"
447
+ DEPENDS
448
+ "${RAYD_SEGMENT_VISIBILITY_BUILD_SCRIPT}"
449
+ "${RAYD_SEGMENT_VISIBILITY_CU}"
450
+ "${CMAKE_CURRENT_SOURCE_DIR}/${RAYD_SOURCE_DIR}/multipath/segment_visibility_params.h"
451
+ VERBATIM
452
+ )
453
+ else()
454
+ add_custom_command(
455
+ OUTPUT "${RAYD_SEGMENT_VISIBILITY_PTX}"
456
+ COMMAND "${CUDA_NVCC_EXECUTABLE}" -ptx --use_fast_math -std=c++17 -arch=compute_70
457
+ "${RAYD_SEGMENT_VISIBILITY_CU}"
458
+ -I"${OPTIX_INCLUDE_DIR}"
459
+ ${RAYD_CUDA_INCLUDE_FLAGS_LIST}
460
+ ${RAYD_CUDA_DEFINITIONS_LIST}
461
+ -o "${RAYD_SEGMENT_VISIBILITY_PTX}"
462
+ DEPENDS
463
+ "${RAYD_SEGMENT_VISIBILITY_CU}"
464
+ "${CMAKE_CURRENT_SOURCE_DIR}/${RAYD_SOURCE_DIR}/multipath/segment_visibility_params.h"
465
+ VERBATIM
466
+ )
467
+ endif()
468
+
469
+ add_custom_command(
470
+ OUTPUT "${RAYD_SEGMENT_VISIBILITY_PTX_H}"
471
+ COMMAND ${CMAKE_COMMAND}
472
+ -DPTX_FILE=${RAYD_SEGMENT_VISIBILITY_PTX}
473
+ -DOUTPUT_FILE=${RAYD_SEGMENT_VISIBILITY_PTX_H}
474
+ -DVAR_NAME=segment_visibility_ptx
475
+ -P "${CMAKE_CURRENT_SOURCE_DIR}/cmake/embed_ptx.cmake"
476
+ DEPENDS
477
+ "${RAYD_SEGMENT_VISIBILITY_PTX}"
478
+ "${CMAKE_CURRENT_SOURCE_DIR}/cmake/embed_ptx.cmake"
479
+ VERBATIM
480
+ )
481
+ set_source_files_properties("${RAYD_SEGMENT_VISIBILITY_PTX_H}" PROPERTIES GENERATED TRUE)
482
+ list(APPEND RAYD_CORE_SOURCE_FILES "${RAYD_SEGMENT_VISIBILITY_PTX_H}")
483
+ else()
484
+ if(NOT EXISTS "${RAYD_SEGMENT_VISIBILITY_PTX_H_COMMITTED}")
485
+ message(FATAL_ERROR
486
+ "Missing committed segment_visibility PTX header at "
487
+ "${RAYD_SEGMENT_VISIBILITY_PTX_H_COMMITTED}. "
488
+ "Restore it or enable RAYD_REGENERATE_SEGMENT_VISIBILITY_PTX with OptiX SDK headers available.")
489
+ endif()
490
+ list(APPEND RAYD_CORE_SOURCE_FILES "${RAYD_SEGMENT_VISIBILITY_PTX_H_COMMITTED}")
491
+ endif()
492
+
493
+ set(RAYD_EDGE_OPTIX_CU "${CMAKE_CURRENT_SOURCE_DIR}/${RAYD_SOURCE_DIR}/edge/edge_optix.cu")
494
+ set(RAYD_EDGE_OPTIX_PTX_H "${CMAKE_CURRENT_BINARY_DIR}/edge_optix_ptx.h")
495
+ set(RAYD_EDGE_OPTIX_PTX_H_COMMITTED
496
+ "${CMAKE_CURRENT_SOURCE_DIR}/${RAYD_SOURCE_DIR}/edge/edge_optix_ptx.h")
497
+
498
+ if(RAYD_REGENERATE_EDGE_OPTIX_PTX)
499
+ find_path(OPTIX_INCLUDE_DIR optix.h
500
+ HINTS
501
+ ENV OPTIX_INCLUDE_DIR
502
+ ENV OPTIX_PATH
503
+ "$ENV{PROGRAMDATA}/NVIDIA Corporation/OptiX SDK 9.1.0"
504
+ "$ENV{PROGRAMDATA}/NVIDIA Corporation/OptiX SDK 8.1.0"
505
+ "$ENV{PROGRAMDATA}/NVIDIA Corporation/OptiX SDK 8.0.0"
506
+ "/usr/local/NVIDIA-OptiX-SDK-9.1.0-linux64-x86_64"
507
+ "/usr/local/NVIDIA-OptiX-SDK-8.1.0-linux64-x86_64"
508
+ "/usr/local/NVIDIA-OptiX-SDK-8.0.0-linux64-x86_64"
509
+ "/opt/NVIDIA-OptiX-SDK-9.1.0-linux64-x86_64"
510
+ "/opt/NVIDIA-OptiX-SDK-8.1.0-linux64-x86_64"
511
+ "/opt/NVIDIA-OptiX-SDK-8.0.0-linux64-x86_64"
512
+ PATH_SUFFIXES include
513
+ )
514
+ if(NOT OPTIX_INCLUDE_DIR)
515
+ message(FATAL_ERROR
516
+ "Could not locate OptiX SDK headers needed to regenerate edge_optix PTX. "
517
+ "Set OPTIX_INCLUDE_DIR or OPTIX_PATH, or disable RAYD_REGENERATE_EDGE_OPTIX_PTX.")
518
+ endif()
519
+
520
+ set(RAYD_EDGE_OPTIX_PTX "${CMAKE_CURRENT_BINARY_DIR}/edge_optix.ptx")
521
+ if(WIN32)
522
+ set(RAYD_EDGE_OPTIX_BUILD_SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/build_edge_optix_ptx.bat")
523
+ file(GENERATE OUTPUT "${RAYD_EDGE_OPTIX_BUILD_SCRIPT}" CONTENT
524
+ "@echo off\r\n\
525
+ call \"${RAYD_VSDEVCMD}\" -arch=x64\r\n\
526
+ if errorlevel 1 exit /b %errorlevel%\r\n\
527
+ \"${CUDA_NVCC_EXECUTABLE}\" -ptx --use_fast_math -std=c++17 -arch=compute_70 \"${RAYD_EDGE_OPTIX_CU}\" -I\"${OPTIX_INCLUDE_DIR}\" ${RAYD_CUDA_INCLUDE_FLAGS} ${RAYD_CUDA_DEFINITIONS} -o \"${RAYD_EDGE_OPTIX_PTX}\"\r\n\
528
+ ")
529
+ add_custom_command(
530
+ OUTPUT "${RAYD_EDGE_OPTIX_PTX}"
531
+ COMMAND "${RAYD_EDGE_OPTIX_BUILD_SCRIPT}"
532
+ DEPENDS
533
+ "${RAYD_EDGE_OPTIX_BUILD_SCRIPT}"
534
+ "${RAYD_EDGE_OPTIX_CU}"
535
+ "${CMAKE_CURRENT_SOURCE_DIR}/${RAYD_SOURCE_DIR}/edge/edge_optix_params.h"
536
+ VERBATIM
537
+ )
538
+ else()
539
+ add_custom_command(
540
+ OUTPUT "${RAYD_EDGE_OPTIX_PTX}"
541
+ COMMAND "${CUDA_NVCC_EXECUTABLE}" -ptx --use_fast_math -std=c++17 -arch=compute_70
542
+ "${RAYD_EDGE_OPTIX_CU}"
543
+ -I"${OPTIX_INCLUDE_DIR}"
544
+ ${RAYD_CUDA_INCLUDE_FLAGS_LIST}
545
+ ${RAYD_CUDA_DEFINITIONS_LIST}
546
+ -o "${RAYD_EDGE_OPTIX_PTX}"
547
+ DEPENDS
548
+ "${RAYD_EDGE_OPTIX_CU}"
549
+ "${CMAKE_CURRENT_SOURCE_DIR}/${RAYD_SOURCE_DIR}/edge/edge_optix_params.h"
550
+ VERBATIM
551
+ )
552
+ endif()
553
+
554
+ add_custom_command(
555
+ OUTPUT "${RAYD_EDGE_OPTIX_PTX_H}"
556
+ COMMAND ${CMAKE_COMMAND}
557
+ -DPTX_FILE=${RAYD_EDGE_OPTIX_PTX}
558
+ -DOUTPUT_FILE=${RAYD_EDGE_OPTIX_PTX_H}
559
+ -DVAR_NAME=edge_optix_ptx
560
+ -P "${CMAKE_CURRENT_SOURCE_DIR}/cmake/embed_ptx.cmake"
561
+ DEPENDS
562
+ "${RAYD_EDGE_OPTIX_PTX}"
563
+ "${CMAKE_CURRENT_SOURCE_DIR}/cmake/embed_ptx.cmake"
564
+ VERBATIM
565
+ )
566
+ set_source_files_properties("${RAYD_EDGE_OPTIX_PTX_H}" PROPERTIES GENERATED TRUE)
567
+ list(APPEND RAYD_CORE_SOURCE_FILES "${RAYD_EDGE_OPTIX_PTX_H}")
568
+ else()
569
+ if(NOT EXISTS "${RAYD_EDGE_OPTIX_PTX_H_COMMITTED}")
570
+ message(FATAL_ERROR
571
+ "Missing committed edge_optix PTX header at "
572
+ "${RAYD_EDGE_OPTIX_PTX_H_COMMITTED}. "
573
+ "Restore it or enable RAYD_REGENERATE_EDGE_OPTIX_PTX with OptiX SDK headers available.")
574
+ endif()
575
+ list(APPEND RAYD_CORE_SOURCE_FILES "${RAYD_EDGE_OPTIX_PTX_H_COMMITTED}")
576
+ endif()
577
+
318
578
  set(RAYD_NANOBIND_ARGS NB_DOMAIN drjit)
319
579
  if(RAYD_NANOBIND_NOMINSIZE)
320
580
  list(APPEND RAYD_NANOBIND_ARGS NOMINSIZE)
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: rayd
3
- Version: 0.2.2
3
+ Version: 0.3.0
4
4
  Summary: RayD: minimalist differentiable ray tracing package wrapping Dr.Jit and OptiX.
5
5
  Author-Email: Xingyu Chen <xic063@ucsd.edu>
6
6
  License: BSD-3-Clause
7
7
  Requires-Python: >=3.10
8
- Requires-Dist: drjit==1.2.0
8
+ Requires-Dist: drjit==1.3.1
9
9
  Provides-Extra: torch
10
10
  Requires-Dist: torch; extra == "torch"
11
11
  Description-Content-Type: text/markdown
@@ -285,7 +285,7 @@ In other words, RayD is not limited to triangle hits. It also gives you direct a
285
285
 
286
286
  RayD is a Python package with a C++/CUDA extension.
287
287
 
288
- You need Python `>=3.10`, CUDA Toolkit `>=11.0`, CMake, a C++17 compiler, `drjit>=1.2.0`, `nanobind==2.9.2`, and `scikit-build-core`.
288
+ You need Python `>=3.10`, CUDA Toolkit `>=11.0`, CMake, a C++17 compiler, `drjit>=1.3.1`, `nanobind==2.9.2`, and `scikit-build-core`.
289
289
 
290
290
  On Windows, use Visual Studio 2022 with Desktop C++ tools. On Linux, use GCC or Clang with C++17 support.
291
291
 
@@ -296,7 +296,7 @@ conda create -n myenv python=3.10 -y
296
296
  conda activate myenv
297
297
  python -m pip install -U pip setuptools wheel
298
298
  python -m pip install cmake scikit-build-core nanobind==2.9.2
299
- python -m pip install "drjit>=1.2.0"
299
+ python -m pip install "drjit>=1.3.1"
300
300
  ```
301
301
 
302
302
  ### Install
@@ -311,7 +311,7 @@ python -m pip install .
311
311
  RayD depends on:
312
312
 
313
313
  - Python `3.10+`
314
- - Dr.Jit `1.2.0+`
314
+ - Dr.Jit `1.3.1+`
315
315
  - OptiX `8+`
316
316
 
317
317
  RayD does not include:
@@ -273,7 +273,7 @@ In other words, RayD is not limited to triangle hits. It also gives you direct a
273
273
 
274
274
  RayD is a Python package with a C++/CUDA extension.
275
275
 
276
- You need Python `>=3.10`, CUDA Toolkit `>=11.0`, CMake, a C++17 compiler, `drjit>=1.2.0`, `nanobind==2.9.2`, and `scikit-build-core`.
276
+ You need Python `>=3.10`, CUDA Toolkit `>=11.0`, CMake, a C++17 compiler, `drjit>=1.3.1`, `nanobind==2.9.2`, and `scikit-build-core`.
277
277
 
278
278
  On Windows, use Visual Studio 2022 with Desktop C++ tools. On Linux, use GCC or Clang with C++17 support.
279
279
 
@@ -284,7 +284,7 @@ conda create -n myenv python=3.10 -y
284
284
  conda activate myenv
285
285
  python -m pip install -U pip setuptools wheel
286
286
  python -m pip install cmake scikit-build-core nanobind==2.9.2
287
- python -m pip install "drjit>=1.2.0"
287
+ python -m pip install "drjit>=1.3.1"
288
288
  ```
289
289
 
290
290
  ### Install
@@ -299,7 +299,7 @@ python -m pip install .
299
299
  RayD depends on:
300
300
 
301
301
  - Python `3.10+`
302
- - Dr.Jit `1.2.0+`
302
+ - Dr.Jit `1.3.1+`
303
303
  - OptiX `8+`
304
304
 
305
305
  RayD does not include:
@@ -0,0 +1,27 @@
1
+ file(READ "${PTX_FILE}" PTX_CONTENT)
2
+ string(LENGTH "${PTX_CONTENT}" PTX_SIZE)
3
+ file(WRITE "${OUTPUT_FILE}"
4
+ "// Auto-generated. Do not edit.\n"
5
+ "#pragma once\n"
6
+ "#include <cstddef>\n"
7
+ "static const char ${VAR_NAME}[] =\n"
8
+ )
9
+
10
+ set(PTX_CHUNK_SIZE 16000)
11
+ set(PTX_OFFSET 0)
12
+ while(PTX_OFFSET LESS PTX_SIZE)
13
+ math(EXPR PTX_REMAINING "${PTX_SIZE} - ${PTX_OFFSET}")
14
+ if(PTX_REMAINING GREATER PTX_CHUNK_SIZE)
15
+ set(PTX_CURRENT_CHUNK_SIZE ${PTX_CHUNK_SIZE})
16
+ else()
17
+ set(PTX_CURRENT_CHUNK_SIZE ${PTX_REMAINING})
18
+ endif()
19
+ string(SUBSTRING "${PTX_CONTENT}" ${PTX_OFFSET} ${PTX_CURRENT_CHUNK_SIZE} PTX_CHUNK)
20
+ file(APPEND "${OUTPUT_FILE}" "R\"PTX_CHUNK(${PTX_CHUNK})PTX_CHUNK\"\n")
21
+ math(EXPR PTX_OFFSET "${PTX_OFFSET} + ${PTX_CURRENT_CHUNK_SIZE}")
22
+ endwhile()
23
+
24
+ file(APPEND "${OUTPUT_FILE}"
25
+ ";\n"
26
+ "static const size_t ${VAR_NAME}_size = ${PTX_SIZE};\n"
27
+ )
@@ -3,7 +3,7 @@
3
3
  #include <utility>
4
4
 
5
5
  #include <rayd/rayd.h>
6
- #include <rayd/edge.h>
6
+ #include <rayd/edge/edge.h>
7
7
  #include <drjit/tensor.h>
8
8
  #include <drjit/math.h>
9
9
  #include <drjit/util.h>
@@ -83,6 +83,45 @@ using NearestRayEdgeT = NearestRayEdgeData<FloatT<Detached>>;
83
83
  using NearestRayEdge = NearestRayEdgeT<false>;
84
84
  using NearestRayEdgeDetached = NearestRayEdgeT<true>;
85
85
 
86
+ template <typename Float_>
87
+ struct NearestEdgesTopKData {
88
+ static constexpr bool IsDetached = std::is_same_v<Float_, FloatDetached>;
89
+
90
+ using Mask_ = std::conditional_t<IsDetached, MaskDetached, Mask>;
91
+ using Vec3f = std::conditional_t<IsDetached, Vector3fDetached, Vector3f>;
92
+ using Int_ = std::conditional_t<IsDetached, IntDetached, Int>;
93
+
94
+ int query_count = 0;
95
+ int k = 0;
96
+
97
+ Mask_ is_valid = full<Mask_>(false, 1);
98
+ Float_ distances = full<Float_>(Infinity, 1);
99
+ Vec3f points = zeros<Vec3f>(1);
100
+ Float_ edge_t = zeros<Float_>(1);
101
+ Vec3f edge_points = zeros<Vec3f>(1);
102
+ Int_ shape_ids = full<Int_>(-1, 1);
103
+ Int_ edge_ids = full<Int_>(-1, 1);
104
+ Int_ global_edge_ids = full<Int_>(-1, 1);
105
+ Mask_ is_boundary = full<Mask_>(false, 1);
106
+
107
+ DRJIT_STRUCT(NearestEdgesTopKData,
108
+ is_valid,
109
+ distances,
110
+ points,
111
+ edge_t,
112
+ edge_points,
113
+ shape_ids,
114
+ edge_ids,
115
+ global_edge_ids,
116
+ is_boundary)
117
+ };
118
+
119
+ template <bool Detached>
120
+ using NearestEdgesTopKT = NearestEdgesTopKData<FloatT<Detached>>;
121
+
122
+ using NearestEdgesTopK = NearestEdgesTopKT<false>;
123
+ using NearestEdgesTopKDetached = NearestEdgesTopKT<true>;
124
+
86
125
  /// Primary-edge sample returned by image-space edge sampling.
87
126
  struct PrimaryEdgeSample {
88
127
  Float x_dot_n;
@@ -173,24 +212,32 @@ struct SceneEdgeInfo {
173
212
  struct SceneEdgeTopology {
174
213
  IntDetached v0;
175
214
  IntDetached v1;
215
+ IntDetached v0_global;
216
+ IntDetached v1_global;
176
217
  IntDetached face0_local;
177
218
  IntDetached face1_local;
178
219
  IntDetached face0_global;
179
220
  IntDetached face1_global;
180
221
  IntDetached opposite_vertex0;
181
222
  IntDetached opposite_vertex1;
223
+ IntDetached opposite_vertex0_global;
224
+ IntDetached opposite_vertex1_global;
182
225
 
183
226
  int size() const { return v0.size(); }
184
227
 
185
228
  DRJIT_STRUCT(SceneEdgeTopology,
186
229
  v0,
187
230
  v1,
231
+ v0_global,
232
+ v1_global,
188
233
  face0_local,
189
234
  face1_local,
190
235
  face0_global,
191
236
  face1_global,
192
237
  opposite_vertex0,
193
- opposite_vertex1)
238
+ opposite_vertex1,
239
+ opposite_vertex0_global,
240
+ opposite_vertex1_global)
194
241
  };
195
242
 
196
243
  } // namespace rayd
@@ -1,7 +1,7 @@
1
1
  #pragma once
2
2
 
3
3
  #include <rayd/rayd.h>
4
- #include <rayd/edge.h>
4
+ #include <rayd/edge/edge.h>
5
5
  #include <rayd/ray.h>
6
6
  #include <vector>
7
7
 
@@ -17,6 +17,14 @@ struct ClosestEdgeCandidate {
17
17
  FloatDetached distance_sq;
18
18
  };
19
19
 
20
+ struct ClosestEdgeTopKCandidate {
21
+ int query_count = 0;
22
+ int k = 0;
23
+ MaskDetached is_valid;
24
+ IntDetached global_edge_ids;
25
+ FloatDetached distance_sq;
26
+ };
27
+
20
28
  struct SceneEdgeBVHStats {
21
29
  int primitive_count = 0;
22
30
  int node_count = 0;
@@ -48,6 +56,7 @@ public:
48
56
  const std::vector<EdgeDirtyRange> &dirty_ranges);
49
57
  void refit(const SecondaryEdgeInfo &edge_info,
50
58
  const IntDetached &primitive_indices);
59
+ void materialize() const;
51
60
  IntDetached map_to_global(const IntDetached &bvh_ids,
52
61
  const MaskDetached &valid) const;
53
62
  bool is_ready() const { return ready_; }
@@ -58,6 +67,11 @@ public:
58
67
  ClosestEdgeCandidate nearest_edge(const Vector3fT<Detached> &point,
59
68
  MaskT<Detached> &active) const;
60
69
 
70
+ template <bool Detached>
71
+ ClosestEdgeTopKCandidate nearest_edges_topk(const Vector3fT<Detached> &point,
72
+ int k,
73
+ MaskT<Detached> &active) const;
74
+
61
75
  template <bool Detached>
62
76
  ClosestEdgeCandidate nearest_edge(const RayT<Detached> &ray,
63
77
  MaskT<Detached> &active) const;
@@ -72,6 +86,9 @@ private:
72
86
  void refit_internal_nodes_dirty(const std::vector<IntDetached> &dirty_leaf_chunks);
73
87
  ClosestEdgeCandidate nearest_edge_point_detached(const Vector3fDetached &point,
74
88
  const MaskDetached &active) const;
89
+ ClosestEdgeTopKCandidate nearest_edges_topk_point_detached(const Vector3fDetached &point,
90
+ int k,
91
+ const MaskDetached &active) const;
75
92
  ClosestEdgeCandidate nearest_edge_finite_ray_detached(const Vector3fDetached &origin,
76
93
  const Vector3fDetached &segment,
77
94
  const MaskDetached &active) const;