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