robot_dart icon indicating copy to clipboard operation
robot_dart copied to clipboard

Clean/Improve Graphics

Open costashatz opened this issue 5 years ago • 7 comments

The Magnum GUI is working well, but there remains to be a lot of cleaning and more features. In particular:

  • Clean up the code related to graphics/Magnum
  • Go through the OpenGL stuff and investigate if we can be better/faster
  • Provide all the parameters to the user (e.g., shadow map sizes, light features, etc.)
  • Integrate Magnum UI in a generic way

costashatz avatar May 10 '20 11:05 costashatz

One idea to (possibly) make the GUI faster (credits to @mosra for this idea):

  • call draw(), let the gpu work on that
  • simulate physics while the gpu works
  • only then call swapbuffers

Instead of the current:

  • simulate physics (takes CPU time)
  • draw() (takes GPU time)
  • swapbuffers (CPU idle, waits until GPU is done)

To test if it is actually going to help..

costashatz avatar May 11 '20 09:05 costashatz

Other ideas to improve rendering times (again credits to @mosra):

  • Instancing, e.g. see here, see also Bullet example of Magnum
  • When constructing the Magnum GUI, the user could request the types of lights and max lights per type; this way we do not need to allocate before-hand all the textures (saves quite a lot of GPU memory)

One more thing to check is the way I am plotting transparent objects (I have a feeling that I am wasting too much time there, even if we do not have any transparency).

costashatz avatar May 11 '20 16:05 costashatz

A first cleaning was done with #47... Another thing to investigate is the defines for the plugins; it should not be needed for newer versions of Magnum.

costashatz avatar May 13 '20 18:05 costashatz

I think the graphics do not need to be faster (graphics is not slowing us down, I think). But simpler is better for long-term maintenance.

Also, we need maximum performance in no graphics mode. We usually do not care much in graphics mode (in the worst case, we record a video and play it at the right framerate).

jbmouret avatar May 18 '20 08:05 jbmouret

I agree that graphics should remain simple for long-term maintenance. However, we are more and more using cameras during the training, and more and more in video streams. So, faster graphics without overwhelming complexity would be welcome.

(And I agree, max perf in no graphics mode is priority).

Aneoshun avatar May 18 '20 08:05 Aneoshun

I agree that graphics should remain simple for long-term maintenance. However, we are more and more using cameras during the training, and more and more in video streams. So, faster graphics without overwhelming complexity would be welcome.

I tend to agree with Antoine. I am planning to use the cameras quite a lot in the coming future and thus faster graphics would make my life easier. Of course, faster does not necessarily mean more complex.

Also, we need maximum performance in no graphics mode.

I think we do not really add any serious overhead over plain DART, do we?

costashatz avatar May 18 '20 09:05 costashatz

Implement Cascaded Shadow Maps for Directional Lights (see here and here).

costashatz avatar Jun 18 '20 07:06 costashatz