Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GLSL Processing Blocks #3654

Merged
merged 175 commits into from
May 5, 2019
Merged

Conversation

dorodnic
Copy link
Contributor

@dorodnic dorodnic commented Apr 2, 2019

Work in Progress - Do not merge

This pull-request introduces auxiliary realsense2-gl module. It can be used to perform common SDK processing tasks on the GPU in a relatively generic way (vendor neutral, unlike CUDA) via GLSL shaders.
In addition, it serves as a proof-of-concept for future SDK extensions beyond core API.

Benefits

  • On most platforms this will greatly improve Viewer responsiveness.
  • On some platforms, this can be a useful way to reduce CPU utilization and improve overall performance (Jetson series is a great example, and unlike dedicated CUDA optimizations this does not require any extra steps to build)

Limitations

  • Mac support is firmly missing. OpenGL support on the Mac is rough and it's unlikely to improve.
  • To handle OpenGL context management in a cross-platform way, this PR relies heavily on (and somewhat coupled with) GLFW.
  • At least for now, this set of enhancements is not helping at all on low-end GPUs. Perhaps this can be improved with shader optimization and simplification.

When it can be used?

  • In general it is rare to come across a system where one approach is hands-down better than the other (probably Jetson is the most extreme case)
  • When the goal of the application is rendering, it makes much more sense to do everything on the GPU
  • When chaining several GLSL blocks together some boost can be accomplished by avoiding unnecessary copies between main and GPU memory
  • It allows to distribute the workload more evenly, freeing the CPU to do other stuff

How to use it?

  • Adaptations required to existing code are fairly minimal. Some explicit initialization is required, but otherwise rs2::pointcloud becomes rs2::gl::pointcloud, rs2::colorizer becomes rs2::gl::colorizer, and so on.
  • rs-gl example is included to get started.

@dorodnic dorodnic added this to the v2.21.0 milestone Apr 2, 2019
schmidtp1 and others added 3 commits April 2, 2019 15:43
added odometry calibration information
(cherry picked from commit d95e09c)
dorodnic added 2 commits April 3, 2019 11:30
…-example

[sample] roll-pitch-yaw from T265
…amera_tm2

Realsense viewer multicamera T265 support
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet