Showing posts with label hardware. Show all posts
Showing posts with label hardware. Show all posts

Thursday, October 22, 2009

OpenGL Vertex Buffer Objects

I recently updated my 3d object rendering code to VBO, introduced in OpenGL 1.5. Using them is very simple, and only need 4 additional API calls. Basically, the vertex data, normals and indexes are sent to the graphics card, stored in there, and accessed through an ID. At draw time, only one or two call with IDs are sufficient and performance is very much improved over using previous Vertex Arrays API, because no data is transfered. My frame rate was multiplied by 2 at least and I can now display up to 150 000 000 tris/s on my GeForce 8800 GTS, hardly the fastest card these days.


I also found GLEW library during this work, very nice and useful to develop OpenGL applications, because of poor header support in MS SDK. It allows using API calls without bothering if they are in headers or not, thanks to clever dynamic loading features at runtime and extensive coverage of OpenGL extensions.

Update: After some tests, the number of tris/s is about 230 000 000 on my 8800 GTS.

Thursday, November 27, 2008

Hacking the Webmail Notifier USB device

Some time ago I ordered the USB Webmail Notifier (only $17). When I received it, I was disapointed to find that the bundled software was very limited, only using the POP3 protocol. This protocol for example has no way of returning number unread mails, so the use cases are rather small.

So I decided to look at how I could code for this device. I found this very useful (albeit quite old) article on USB HID devices, a wery well though standard for this kind of devices (and keyboards, mouses, joysticks).

I also used a USB protocol analyzer to see what data was sent to the device. I managed to make it accept any color I want (whereas the bundled software only has green, red and blinking blue).

Each component is 5 bits, that makes some noticable transitions between adjacent colors. Also not all colors we use to get on LCD displays are available, because there is no black.

Here is a small image of an orange notifier.

I made 3 command line programs (building them requires the Windows DDK):
  • a simple color setter, arguments are R G B
  • a HUE wheel switcher
  • a CPU usage related color, green beeing 0%, red 100%
There is certainly many other possible uses for this cheap device:
  • An IMAP4 mail notifier, making use of all IMAP4 features
  • An automatic build indicator, for example for CruiseControl
  • an event remainder
  • ...
As usual source code will be send on request.