blob: 6feb8df52a0f084ad78e1b3af23135b9986b871d [file] [log] [blame]
Brian Paul0b27ace2003-03-08 17:38:57 +00001<HTML>
2
3<TITLE>Off-screen Rendering</TITLE>
4
Brian Paul36da0452005-01-20 03:55:10 +00005<link rel="stylesheet" type="text/css" href="mesa.css"></head>
6
7<BODY>
Brian Paul0b27ace2003-03-08 17:38:57 +00008
9<H1>Off-screen Rendering</H1>
10
11
12<p>
13Mesa 1.2.4 introduced off-screen rendering, a facility for generating
143-D imagery without having to open a window on your display. Mesa's
15simple off-screen rendering interface is completely operating system
16and window system independent so programs which use off-screen
17rendering should be very portable. This feature effectively
18enables you to use Mesa as an off-line, batch-oriented renderer.
19</p>
20<p>
21The "OSMesa" API provides 3 functions for making off-screen
22renderings: OSMesaCreateContext(), OSMesaMakeCurrent(), and
23OSMesaDestroyContext(). See the Mesa/include/GL/osmesa.h header for
24more information. See the demos/osdemo.c file for an example program.
25There is no facility for writing images to files. That's up to you.
26</p>
27<p>
28If you want to generate large images (larger than 1280x1024) you'll
29have to edit the src/config.h file to change MAX_WIDTH and MAX_HEIGHT
30then recompile Mesa. Image size should only be limited by available
31memory.
32</p>
33
34
35<H2>Deep color channels</H2>
36
37<p>
38 For some applications 8-bit color channels don't have sufficient
39 accuracy (film and IBR, for example). If you're in this situation
40 you'll be happy to know that Mesa supports 16-bit and 32-bit color
41 channels through the OSMesa interface. When using 16-bit channels,
Brian Paul7357f202003-05-02 15:05:02 +000042 channels are GLushorts and RGBA pixels occupy 8 bytes. When using 32-bit
43 channels, channels are GLfloats and RGBA pixels occupy 16 bytes.
Brian Paul0b27ace2003-03-08 17:38:57 +000044</p>
45<p>
46 To build Mesa/OSMesa with 16-bit color channels:
47<pre>
Brian Paul58be9e62004-09-24 20:31:02 +000048 make realclean
49 make linux-osmesa16
Brian Paul0b27ace2003-03-08 17:38:57 +000050</pre>
51
52 For 32-bit channels:
53<pre>
Brian Paul58be9e62004-09-24 20:31:02 +000054 make realclean
55 make linux-osmesa32
Brian Paul0b27ace2003-03-08 17:38:57 +000056</pre>
57
58<p>
Brian Paul7357f202003-05-02 15:05:02 +000059You'll wind up with a library named libOSMesa16.so or libOSMesa32.so.
60</p>
61
62<p>
Brian Paul58be9e62004-09-24 20:31:02 +000063If you need to compile on a non-Linux platform, copy Mesa/configs/linux-osmesa16
64to a new config file and edit it as needed. Then, add the new config name to
65the top-level Makefile. Send a patch to the Mesa developers too, if you're
66inclined.
Brian Paul0b27ace2003-03-08 17:38:57 +000067</p>
Brian Paul58be9e62004-09-24 20:31:02 +000068
Brian Paul0b27ace2003-03-08 17:38:57 +000069<p>
70BE WARNED: 16 and 32-bit channel support has not been exhaustively
71tested and there may be some bugs. However, a number of people have
72been using this feature successfully so it can't be too broken.
73</p>
74
75
76</BODY>
77</HTML>