GLVis / glvis

Lightweight OpenGL tool for accurate and flexible finite element visualization
http://glvis.org
BSD 3-Clause "New" or "Revised" License
253 stars 52 forks source link

Screenshot does not behaves reliably in glvs script #254

Open dohyun-cse opened 1 year ago

dohyun-cse commented 1 year ago

Following this tutorial, I tried to make a .gif file from a series of solutions.

However, when I check .png files, one of every three files is just empty.

I get the following warning from GLVis when I run the script:

MFEM Warning: Screenshot: Reading from the front buffer is unreliable. Resulting screenshots may be incorrect. But there is no suggestion for a better way to save the figure.

What is a proper way to save figures using glvs scripts?

dohyun-cse commented 1 year ago

I managed to resolve this issue by replacing

keys b to keys ~b

v-dobrev commented 1 year ago

If you are loading different mesh and/or solution files before each screenshot, you don't need the command keys b.

In the tutorial we use the same mesh and vector solution (which defines a backward displacement), so we use keys b to change what state between the no-backward-displacement and full-backward-displacement we draw, see the key b description in section "2D vector data" in https://github.com/GLVis/glvis/blob/master/README.md.

That said, there is still probably some issue with the keys not being fully processed in the script as intended and we probably need to track it down and resolve it.