[GRASS-dev] [GRASS GIS] #3600: m.nviz.image doesn't produce any output

GRASS GIS trac at osgeo.org
Mon Jul 9 16:40:51 PDT 2018


#3600: m.nviz.image doesn't produce any output
--------------------------+-------------------------
  Reporter:  guano        |      Owner:  grass-dev@…
      Type:  defect       |     Status:  new
  Priority:  normal       |  Milestone:
 Component:  Default      |    Version:  7.0.4
Resolution:               |   Keywords:
       CPU:  Unspecified  |   Platform:  MacOSX
--------------------------+-------------------------

Comment (by hcho):

 One thing I found interesting is that in lib/nviz/draw.c, Nviz_draw_all()
 calls Nviz_draw_all_(surf, vect, site, vol) after switching the draw
 buffer to GL_BACK. Nviz_draw_all_(vect, site, vol) again switch the draw
 buffer to GL_FRONT_AND_BACK, draw stuff, and switch back to GL_BACK, but
 Nviz_draw_all_surf doesn't do that and seems to draw in the GL_BACK buffer
 that Nviz_draw_all initially set.

 Now, since we're still in the GL_BACK buffer (because the other
 Nviz_draw_all_* switch back to the GL_BACK buffer at the end),
 GS_done_draw() in Nviz_draw_all tries to swap the front and back buffers
 using a user-defined function, which is a void function in m.nviz.image.
 So the back buffer with an image is never swapped with the front buffer,
 but gsd_getimage() reads the front buffer anyway to write the output,
 which is blank.

 How does it work in Linux? I don't know. I tried to draw to GL_FRONT,
 GL_BACK, GL_FRONT_AND_BACK in Nviz_draw_all_surf, they all worked! I was
 able to produce a white blank image by drawing to GL_NONE though...

 Since I cannot reproduce this issue myself, someone may want to try this.

 * Draw the surface on the front buffer. lib/nviz/draw.c line 223. Change
 {{{GSD_BACK}}} to {{{GSD_FRONT}}}.

 OR (NOT both at the same time)

 * Read the back buffer. lib/ogsf/gsd_prim.c line 921. Change
 {{{GSD_FRONT}}} to {{{GSD_BACK}}}.

-- 
Ticket URL: <https://trac.osgeo.org/grass/ticket/3600#comment:52>
GRASS GIS <https://grass.osgeo.org>



More information about the grass-dev mailing list