This pull request add the support for the following:
New examples
dynamic_geometry.py
dynamic_materials.py
Add support for interactive OpenGL examples:
Added the optix.sutil submodule to mimic the optix SDK sutil API (optix/SDK/sutil).
Added sutil.camera.Camera which implements all sutil/Camera.h features.
Added sutil.camera.Trackball which implements all sutil/Trackball.h features.
Added sutil.cuda_output_buffer.CudaOutputBuffer which implements sutil/CUDAOutputBuffer.h features (currently only supports CUDA_DEVICE mode, GL_INTEROP support may be added later once available in cupy).
Added sutil.gl_display.GLDisplay which implements all sutil/GLDisplay.h features.
Added sutil.gui which implements some GUI features of sutil/sutil.h (init_ui, display_text, display_stats).
The python port closely follows the SDK by using the exact same graphical APIs:
OpenGL -> PyOpenGL
glfw -> pyglfw
imgui -> pyimgui, pyimgui[glfw]
New features:
The two new examples required some additions to the existing wrapper:
Add a way to retrieve default build options to build custom user kernels: module.pyx:get_default_nvrtc_compile_flags().
OptixBuildInputInstanceArray.instances is now public to be able to update instances directly in python.
Instances that are modified in python in host memory can be updated in device memory with build.pyx:BuildInputInstanceArray.update_instance().
Allow to update traversable object reference and handle with build.pyx:BuildInputCustomPrimitiveArray.update_traversable().
Get a view on an instance transform matrix device memory with build.pyx:BuildInputInstanceArray.get_transform_view().
SbtRecord now store a list of ProgramGroup instead of a single ProgramGroup.
Program groups can now be updated with struct.pyx:SbtRecord.update_program_group().
Bug fixes
Fixed optix assertion in BuildInputCustomPrimitiveArray due to a CuPy stride bug when there was only one AABB passed as a numpy array (see https://github.com/cupy/cupy/issues/5897). This bug may affect other strides.
Fixed default visibility mask value from 2**(sizeof(unsigned int) * 8) - 1 to 2**max_visibility_mask_bits - 1.
Fixed Cython error on negative python int to unsigned int assignment (OPTIX_PRIMITIVE_TYPE_FLAGS_TRIANGLE = 1 << 31 is a negative C int affected to a python integer (enum.IntEnum.value). Optix expects unsigned int flags in its structs, which led to a Cython conversion error: cannot affect negative python int to unsigned int. This bug may affect other enums.
This pull request add the support for the following:
New examples
dynamic_geometry.py
dynamic_materials.py
Add support for interactive OpenGL examples:
optix.sutil
submodule to mimic the optix SDK sutil API (optix/SDK/sutil
).sutil.camera.Camera
which implements allsutil/Camera.h
features.sutil.camera.Trackball
which implements allsutil/Trackball.h
features.sutil.cuda_output_buffer.CudaOutputBuffer
which implementssutil/CUDAOutputBuffer.h
features (currently only supportsCUDA_DEVICE
mode,GL_INTEROP
support may be added later once available in cupy).sutil.gl_display.GLDisplay
which implements allsutil/GLDisplay.h
features.sutil.gui
which implements some GUI features ofsutil/sutil.h
(init_ui, display_text, display_stats).sutil.vecmath
which implements basic vector operations (dot product, cross product, normalize, length).New features:
The two new examples required some additions to the existing wrapper:
module.pyx:get_default_nvrtc_compile_flags()
.OptixBuildInputInstanceArray.instances
is now public to be able to update instances directly in python.build.pyx:BuildInputInstanceArray.update_instance()
.build.pyx:BuildInputCustomPrimitiveArray.update_traversable()
.build.pyx:BuildInputInstanceArray.get_transform_view()
.ProgramGroup
instead of a singleProgramGroup
.struct.pyx:SbtRecord.update_program_group()
.Bug fixes
2**(sizeof(unsigned int) * 8) - 1
to2**max_visibility_mask_bits - 1
.OPTIX_PRIMITIVE_TYPE_FLAGS_TRIANGLE = 1 << 31
is a negative C int affected to a python integer (enum.IntEnum.value). Optix expects unsigned int flags in its structs, which led to a Cython conversion error: cannot affect negative python int to unsigned int. This bug may affect other enums.