[GRASS-dev] Re: [GRASS-user] [bug #3041] nviz max resolution
ppm image dump
Glynn Clements
glynn at gclements.plus.com
Fri Sep 1 11:59:16 EDT 2006
Hamish wrote:
> > > > > With off-screen rendering disabled, I get good results with
> > > > > either of the above var_i calculations.
> > > >
> > > > The off-screen rendering draws to the back-buffer, GS_write_zoom()
> > > > dumps the front buffer. Also, Create_OS_Ctx() hides the Togl
> > > > canvas (presumably to prevent expose events from trashing the
> > > > OpenGL state during off-screen rendering), so it probably isn't
> > > > usable for rendering.
> > > >
> > > > Does this help?
> > > >
> > > > diff -u -r2.6 do_zoom.c
> > > > --- visualization/nviz/src/do_zoom.c 9 Jul 2006 08:58:40 -0000 2.6
> > > > +++ visualization/nviz/src/do_zoom.c 31 Aug 2006 12:58:16 -0000
> > > > @@ -325,6 +325,9 @@
> > > > }
> > > > #endif
> > > >
> > > > + if (!pbuffer && !glxpixmap)
> > > > + return 1;
> > > > +
> > > > /* hide togl canvas before init_ctx
> > > > * This prevents bindings from re-initializing
> > > > * togl */
> > >
> > > Nope. No change.
> >
> > Did you try with GRASS_NO_GLX_{PBUFFERS,PIXMAPS} set?
> >
> > With those set, and the above patch, Create_OS_Ctx() should
> > essentially be a no-op.
>
>
> I didn't. I have now and it renders correctly; you see each panel being
> rendered in the NVIZ window.
>
> i.e. : This works
> + if (!pbuffer && !glxpixmap)
> + return 1;
> and
> export GRASS_NO_GLX_PIXMAPS=TRUE
> export GRASS_NO_GLX_PBUFFERS=TRUE
>
>
> OR making this test always false makes it work:
>
> /* create off-screen context if possible */
> #if defined(OPENGL_X11) && (defined(HAVE_PBUFFERS) || defined(HAVE_PIXMAPS))
>
> it fails with: (random bits of old windows in built panels)
> + if (!pbuffer && !glxpixmap)
> + return 1;
> and
> unset GRASS_NO_GLX_PIXMAPS
> export GRASS_NO_GLX_PBUFFERS=TRUE
>
>
> it fails with: (mostly black with some color stripes in built panels)
> + if (!pbuffer && !glxpixmap)
> + return 1;
> and
> export GRASS_NO_GLX_PIXMAPS=TRUE
> unset GRASS_NO_GLX_PBUFFERS
IOW, neither pBuffers nor GLX Pixmaps work. FWIW, they don't work for
me either.
The existing code (minus the patch) doesn't correctly handle the case
where off-screen rendering is requested but both mechanisms fail (or
are disabled by the environment variables).
I'll commit the patch, so that disabling off-screen rendering at
run time works.
I could invert the sense of the tests, so that you have to
specifically request it. However, that essentially guarantees that the
off-screen rendering won't get any significant amount of testing.
> > > Does max res PPM dump work for anybody? (ie is it a platform
> > > dependent thing)
> > >
> > > Shall we disable offscreen rendering for the 6.2 release branch in
> > > case it doesn't get fixed in time for release?
> >
> > It should suffice to ensure that it can be disabled at run time.
>
> or by packagers (say if it's broken for all MacOSX)
There's no way of knowing that. Even if you tested it on every
possible software/hardware combination currently available, you don't
know whether it will start working with the next update.
So long as might work for someone, and everyone for whom it doesn't
work can effectively disable it, it should remain.
The only valid reason for using compile-time tests is to prevent
errors which cannot be prevented at run-time, i.e. loading errors due
to the use of functions which may not exist on specific systems.
--
Glynn Clements <glynn at gclements.plus.com>
More information about the grass-dev
mailing list