Skip to content

Conversation

@keckj
Copy link
Contributor

@keckj keckj commented Oct 14, 2021

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).
  • Added sutil.vecmath which implements basic vector operations (dot product, cross product, normalize, length).
  • The python port closely follows the SDK by using the exact same graphical APIs:
    1. OpenGL -> PyOpenGL
    2. glfw -> pyglfw
    3. 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 Unexpected stride when performing cupy.asarray on numpy.ndarray with leading dim 1 cupy/cupy#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.
  • Other small fixes

@mortacious
Copy link
Owner

Wow, really nice work!
I will review and merge this as soon as possible once I get back from my vacation.

@mortacious mortacious merged commit d55fc17 into mortacious:master Jan 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants