UI Frontbuffer Drawing

The interface toolkit was drawing all live updates (while using menus/buttons) in the frontbuffer. This isn't well supported cross-platform, involves quite some hackish code too, so was time to be killed once.

 

Live button updates or menus now are drawn in backbuffer only, and copied to front when needed. It only uses the glReadPixels and glCopyPixels for frontbuffer access now. These two calls are available since OpenGL 1.0, and known to be supported cross platform a lot better.

 

Another benefit of the recode is that drawing updates in frontbuffer now is a centralized call, allowing experiments by developers for optimal solutions for specific platforms. For example, for Windows systems the KTX OpengGL extensions could be used here, this has being enforced by Discreet for 3DStudio and being used by many games.

 

Results so far are very encouraging, especially for ATI cards, which had a lot of troubles with frontbuffer drawing. It still needs a thorough review though. On SGI/SUN workstations it should work smooth (the current method was in Blender 1.0 too); but I prefer feedback on that. Some (older) Linux systems might get a degraded performance as well.

You can switch the "copy from back to frontbuffer" to use another method by setting the "Rt" button in "Display Buttons" (F10) at value '2'. It then doesn't use glCopyPixels, but a glReadPixels and glDrawPixels combo.

Transparent Menus

One of the funny benefits of a cleaner menu drawing system also is that it allows more advanced drawing of buttons and menus. In the theme editor you now can define alpha values for menu backdrop and items, to have them showing transparent in the UI.

 

You can download a transparent UI .B.blend here. Load the file and if you like it, save it over as startup file with CTRL + U.

More UI Goodies

  • AA fonts were garbled on ATI systems. Now the AA fonts are drawn exactly on pixel positions. The AA font drawing library has been made faster too.
  • OS X only: AA fonts now also support .dfont and 'suitcase' fonts.
  • Rounded theme uses antialiased outlines for buttons now
  • Pulldown and popup menus have a nice soft shadow now
  • New button type 'PULLDOWN', that calls a pulldown menu. This should be added to themes, now it is default for all.
  • Screendump for one window does the full window now, including header. Activate screendumps with CTRL + F3 (full Blender screen) or SHIFT + CTRL + F3 (one window space). OSX users have to press the Alt too.
  • Added a menu for selecting the lamp type when it's created
  • Added curved lines as connectors, for OOPS Schematic