OptiX & OpenGL interop - compressed textures

Is there any plan to add compressed texture formats support for Optix & OpenGL interop in future versions of API?

Or it’s better to look in direction of Vulkan RTX extension and Vulkan/OpenGL interop in case of integrating raytracing solution into existing OpenGL app?

Greatly appreciate any comments, thank you!

Just to clarify - the use case is to sample (inside rt kernel) material properties (albedo, normalmap, gloss, etc) from compressed textures created via OpenGL and then shared with OptiX.

Compressed textures are not currently supported in OpenGL->CUDA interop, and OptiX thus has the same limitation. This is something we would like to improve in the future.

If OptiX supported compressed textures natively (through CUDA BCn formats, not through GL interop) would that help? Or you really have to have GL interop?

  • does that mean, that one creates CUDA texture (in compressed format) and shares it with OptiX (don’t know if such interop option exists)?
    If that can be made, than one would easily share OpenGL texture with CUDA, and that proxy CUDA-texture with Optix; that would help to solve the task.

Actually the app we are working on has OpenGL renderer, and we wanted to share scene assets resident textures (compressed) with OptiX to stay in fixed VRAM budget. That is why direct GL -> OptiX compressed textures sharing would help a lot!

The other option would be to support integer texture views onto compressed texture (in GL), that would allow to read texel blocks directly in kernel and decompress manually. But unfortunately one can not create integer texture view on compressed texture :(

CUDA supports block compressed (“BCn”) texture formats:
https://docs.nvidia.com/cuda/cuda-driver-api/group__CUDA__TYPES.html#group__CUDA__TYPES_1ge7db5e5fe7c197287e55f2e97289dfcf

CUDA does NOT support interop with this texture format between OpenGL. You have to allocate the texture in CUDA directly.

OptiX textures are built on top of CUDA; OptiX textures are CUDA textures, they are not interop with the CUDA context.

That means currently it would be possible to allocate this type of texture in CUDA/OptiX if we exposed it in the OptiX API, but NOT possible to share an existing allocation from OpenGL. What you want to do is reasonable but difficult to do right now.

Thank you for explanation! It is clear now.
Hope someday this feature will be exposed :)