Clone of mesa.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

osmesa.html 2.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <HTML>
  2. <TITLE>Off-screen Rendering</TITLE>
  3. <BODY text="#000000" bgcolor="#55bbff" link="#111188">
  4. <H1>Off-screen Rendering</H1>
  5. <p>
  6. Mesa 1.2.4 introduced off-screen rendering, a facility for generating
  7. 3-D imagery without having to open a window on your display. Mesa's
  8. simple off-screen rendering interface is completely operating system
  9. and window system independent so programs which use off-screen
  10. rendering should be very portable. This feature effectively
  11. enables you to use Mesa as an off-line, batch-oriented renderer.
  12. </p>
  13. <p>
  14. The "OSMesa" API provides 3 functions for making off-screen
  15. renderings: OSMesaCreateContext(), OSMesaMakeCurrent(), and
  16. OSMesaDestroyContext(). See the Mesa/include/GL/osmesa.h header for
  17. more information. See the demos/osdemo.c file for an example program.
  18. There is no facility for writing images to files. That's up to you.
  19. </p>
  20. <p>
  21. If you want to generate large images (larger than 1280x1024) you'll
  22. have to edit the src/config.h file to change MAX_WIDTH and MAX_HEIGHT
  23. then recompile Mesa. Image size should only be limited by available
  24. memory.
  25. </p>
  26. <H2>Deep color channels</H2>
  27. <p>
  28. For some applications 8-bit color channels don't have sufficient
  29. accuracy (film and IBR, for example). If you're in this situation
  30. you'll be happy to know that Mesa supports 16-bit and 32-bit color
  31. channels through the OSMesa interface. When using 16-bit channels,
  32. channels are GLushorts and RGBA pixels occupy 8 bytes. When using 32-bit
  33. channels, channels are GLfloats and RGBA pixels occupy 16 bytes.
  34. </p>
  35. <p>
  36. To build Mesa/OSMesa with 16-bit color channels:
  37. <pre>
  38. cd Mesa-5.x/src
  39. make -f Makefile.X11 clean
  40. make -f Makefile.OSMesa16 linux-osmesa16
  41. </pre>
  42. For 32-bit channels:
  43. <pre>
  44. cd Mesa-5.x/src
  45. make -f Makefile.X11 clean
  46. make -f Makefile.OSMesa16 linux-osmesa32
  47. </pre>
  48. <p>
  49. You'll wind up with a library named libOSMesa16.so or libOSMesa32.so.
  50. </p>
  51. <p>
  52. If you're not using Linux, you can easily edit Make-config and add
  53. an appropriate configuration.
  54. </p>
  55. <p>
  56. The Mesa/tests/osdemo16.c file (available via CVS) demonstrates how
  57. to use this feature.
  58. </p>
  59. <p>
  60. BE WARNED: 16 and 32-bit channel support has not been exhaustively
  61. tested and there may be some bugs. However, a number of people have
  62. been using this feature successfully so it can't be too broken.
  63. </p>
  64. </BODY>
  65. </HTML>