POV-Ray : Newsgroups : povray.unofficial.patches : Linux framebuffer support Server Time
16 May 2024 07:29:46 EDT (-0400)
  Linux framebuffer support (Message 1 to 3 of 3)  
From: Nicolas Calimet
Subject: Linux framebuffer support
Date: 30 Aug 2004 00:25:15
Message: <4132ac2b@news.povray.org>
As a possible future extension to the Linux/Unix version of
POV-Ray 3.6, I'm pleased to announce/release a patch which provides
support for the Linux framebuffer display.  This patch therefore
adds another possible preview method to the existing text, X Window
and SVGAlib (Linux only) displays.
	This patch to povray-3.6.1 for Unix is at an early development
stage (version 0.1) and is considered BETA code.  It was only tested
with 16bpp color depth display (65536 colors) at 1024x768, but it should
also work with 32bpp color depth (16 M + alpha) and at any other screen
resolution.  This release is aimed at testing the patch in as many
different situations as possible in order to detect major problems.

	Features currently (hopefully) supported:

1) 16 and 32bpp color depth at any resolution, either on the console
    screen or under X when the latter uses a framebuffer server*
2) Any preview size with automatic (lossy**) downscaling to fit the
    screen size when necessary
3) Automatic preview centering on screen
4) User abort by pressing the 'q' ('Q') key at any time during
    rendering (but not before) when using +x
5) A small "hidden" feature left as an exercise to the code reader  :-p

*  See p.b.i (same subject) for sample images.
** Simple nearest neighbour downscaling, so when using antialiasing
    the preview might still look harsh; but hey, that's just a preview
    afterall...

	Caveats:

a) This is quick-n-dirty BETA code, not much tested yet; it might
    blow up your computer if you are not friendly with it
b) Should support any screen depth
c) Dirty your screen, in particular under X, so you have to
    clean it yourself, e.g. by moving windows around
d) Other problems to be noticed when they'll be discovered  ;-)

	The patch is available as:

- a diff file to apply to a clean povray-3.6.1/ directory
     http://pov4grasp.free.fr/download/povray-3.6.1-fbdev-0.1.diff.gz (8 KB)
   Uncompress the file in the parent directory of povray-3.6.1/
   and run  'patch -pO < povray-3.6.1-fbdev-0.1.diff'
   then build the program as usual.

- or an archive file that contains only added/modified files
     http://pov4grasp.free.fr/download/povray-3.6.1-fbdev-0.1.tar.gz (97 KB)
   Unpack the archive, it creates a directory povray-3.6.1-fbdev-0.1/
   Then copy the directory content to your povray-3.6.1/ folder and
   build the program as usual.

	Note: this patch also contains two bugfixes to the 3.6.1 configure
script which could make the configuration fail and/or prevented the SVGAlib
to be used under Linux (the 3.6.1 official Linux binary also has this
problem).  They will be included in the future official 3.6.2 release.

	Have fun testing  :-)
	- NC


Post a reply to this message

From: Nicolas Calimet
Subject: Re: Linux framebuffer support
Date: 31 Aug 2004 11:48:21
Message: <41349dc5@news.povray.org>
> 1) 16 and 32bpp color depth at any resolution, either on the console
>    screen or under X when the latter uses a framebuffer server

	Additional notes (after a bit more testing):

1) FWIW I am a perfect newbie at using and programming with
    framebuffer devices  :-)

2) Working on the support for 24bpp (which is in principle the
same as 32bpp w/o alpha), I found a little problem that will cause
the image to display wrong colors in 24/32bpp (due to a missing
cast from signed to unsigned char).  So, as of version 0.1 the patch
is not useful at anything but 16bpp color depth.  Unfortunately
I don't know yet how to run the framebuffer at 32bpp for proper
testing (I only have fb codes up to 1280x1024 at 24bpp).
	The next 0.2 version will try to correctly support all but
the 256 color mode which needs colormap support for working (planed
for version 0.3).

3) The patch temporarly changes some attributes of the terminal
so as to be able to read keyboard input with neither blocking
nor line buffering (i.e. you don't need to press <enter> after 'q'
to stop rendering when using povray +x).  In certain conditions,
for instance when aborting povray with Ctrl+C, the initial tty
settings are not restored correctly and the console gets hardly
usable after povray terminates.  A workaround is to type in e.g.
'stty echo cooked' at the console to get it somewhat working again.
Will be fixed in version 0.2.  As one could guess, I'm also a
newbie at interfacing the tty's  :-)

4) Concerning running this patch under X Window:

- this is possible when the DISPLAY environment variable is unset:
   'unsetenv DISPLAY' (csh) or 'unset DISPLAY' (sh).

- the intend of the patch is to run povray on the console so as to
   save the great memory burden of running X, i.e. it's similar to
   using the SVGAlib display BUT w/o the need to run as root or to
   make povray suid root (therefore this patch is also targetted at
   making the program usage more secured under Linux).  Hence, it
   is a side-effect that the patch may work under X.  The next
   point explains why it's not a good idea to run it under X.

- the second screenshot I posted in p.b.images shows the patch
   running "under X Window (using framebuffer server)".  The text
   in parenthesis is actually meaningless, as the patch can also
   do something when the X server is not using a framebuffer module.
   I write "do something" instead of "is working" since it might
   work or not depending on your settings.  The image was obtained
   running the framebuffer console and the X server both at 16bpp.
   If the X server runs at a different color depth than the frame-
   buffer console (e.g. 16 and 24bpp respectively), this patch will
   display a crappy image.  I don't know (for now) of any way to
   fix that, nor if it is desirable at all.  Thus, you should not
   use this patch under X when a framebuffer device is also working
   at the console, which perfectly meets its goal anyway  :-)


	- NC


Post a reply to this message

From: Nicolas Calimet
Subject: Re: Linux framebuffer support
Date: 31 Aug 2004 11:50:37
Message: <41349e4d$1@news.povray.org>
Ouch, please followup-to p.u.patches.

	- NC


Post a reply to this message

From: Oleguer Vilella
Subject: Re: Linux framebuffer support
Date: 31 Aug 2004 14:09:08
Message: <4134bec4$1@news.povray.org>
Ok, thank you. I'm goig to change my home computer and I will intall the
Linux POV-Ray, now I'm using the Windows POV-Ray version.

Regards,
Oleguer


news:413492c3$1@news.povray.org...
> > What Linux is it? I have the RedHat 9
>
> Well, that should be obvious from the second screenshot  ;-)
>
> But it should work on any distro provided your kernel was compiled
> with support for framebuffer (e.g. vesafb).  I found the recent Knoppix
(3.4
> at least) to be the case, I'm sure there are several others too.
>
> Followup-to p.u.patches
>
> - NC


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.