Archive for September, 2008

Clowns to the left of me, Free Software zealots to the right…

Tuesday, September 23rd, 2008

The world and its Free Software loving dog have exploded all over the Internet at the news of SGI changing one of the licenses it uses to open source software to make it FSF-tolerated. Why is this exciting one asks? Well it is because it is widely being reported as SGI Open Sourcing OpenGL. This is a proper hand.slap(head) statement as I shall explain. Already it has lead to a number of misconceptions:

  • Anyone using OpenGL under Linux has been using non-Free software. This is false. The OpenGL implementation on Linux is not, necessarily, related to the SGI offering at all. For example, the popular Mesa 3D library forms the base of most FLOSS OpenGL stacks. Certainly if you are using an Intel card, your OpenGL implementation is delocalised over Mesa and the X11 licensed driver in X.org. The SGI code has no effect on you.
  • The OpenGL I’m using is written by SGI. Unlikely, see below for what OpenGL actually is. SGI released a reference implementation of OpenGL for people to test against but it only implements OpenGL 1.2. In computer graphics terms, that is roughly equivalent to the age of the Roman Empire.
  • There is one ‘true’ OpenGL implementation. OpenGL is not a piece of software at all. Rather it is an API specification. It is, if it can be said to exist tangibly at all, a pile of paper. It is also a trademark which prevents Mesa 3D claiming anything other than it is a ’similar’ API to OpenGL.

What people should be celebrating is that now a large amount of SGI’s other FLOSS projects now can earn their ‘F’.

Firtree 0.0.5

Saturday, September 20th, 2008

The Firtree 0.0.5 release is out. This is going to be the first one which is actually advertised on the website since it is the first one that people might actually stand a good chance of being able to use properly :). See the Launchpad release page for more information.

Getting it

Firtree can be downloaded as a source tar-ball (thanks to Tony for pointing out this deficiency last time) and as a source or binary package for Ubuntu. Your primary sources are therefore:

Changelog

The big things in this release are the playground example which is similar to the Core Image Fun House application which ships with XCode on OSX, an optional software-only backend based on libOSMesa and an important bugfix to do with using swizzled vector types as lvalues.

  * NEW: Added the Python-based 'playground' example which shows how to make a
    generic filter-oriented image processing pipeline using Firtree.

  * NEW: ImageAccumulator and friends are more picky about there being an
    OpenGLContext 'current'. Slowly migrating all the examples over to 'best
    practise' of making sure that a context is created, even if it is only a
    NULL context.

  * NEW: Added a software-only rendering backend based on libOSMesa. This
    necessitated moving all the GL API entry points inside the OpenGLContext
    structure. Hence there *must* always be a context current when Firtree
    calls are made.

  * BUG FIX: In the kernel language, 'foo.x' et al are all lvalues which can
    be assigned to. The GLSL backend was translating swizzles in such a way
    that assignment to them was in effect a NOP.

  * API CHANGE: ImageProvders now have the semantic of 'creating' a
    BitmapImageRep on demand, even if this only involves returning an internal
    cached rep and incrementing its reference count. This brings it more into
    line with Firtree's object ownership conventions.

  * BUG FIX: ImageProviders have no way, currently, of signalling a 'dirty'
    bit on their BitmapImageRep and so each time they are used we now copy the
    image to the GPU. This is highly sub-optimal and a good signaling method
    must be found but it does ensure that changing the bitmap returned by an
    ImageProvider changes what ends up on screen.

  * BUG FIX: Blob lengths were never being set internally.

  * NEW: Added a skeleton API for converting pixel formats into the RGBA form
    expected by Firtree. Currently only supports 8-bit luminance values.

  * NEW: Long-standing feature need. When creating a kernel, syntax errors in
    the kernel source now throw an exception including the error.

USB circus cannon under Linux

Monday, September 15th, 2008

For anyone that might care, here is a quick ‘n’ dirty piece of Python code that allows me to control the circus cannon my sister bought me for my birthday. YMMV and you’ll probably need to change the device name in send_cmd().

from __future__ import with_statement
import curses

def send_cmd(cmd):
  try:
    with open('/dev/hidraw1', 'wb') as outfile:
      outfile.write("\x00")
      outfile.write("%c" % int(cmd))
  except:
    pass

def mainbody(stdscr):
  quit = False
  while(not quit):
    a = '%c' % stdscr.getch()
    if(a == 'a'):
      stdscr.addstr(1,0,"left ")
      send_cmd(4)
    elif(a == 'd'):
      stdscr.addstr(0,0,"right")
      send_cmd(8)
    elif(a == 's'):
      stdscr.addstr(0,0,"up   ")
      send_cmd(2)
    elif(a == 'w'):
      stdscr.addstr(0,0,"down ")
      send_cmd(1)
    elif(a == 'f'):
      stdscr.addstr(0,0,"fire ")
      send_cmd(16)
    elif(a == 'x'):
      stdscr.addstr(0,0,"stop ")
      send_cmd(0)
    elif(a == 'q'):
      stdscr.addstr(0,0,"quit ")
      send_cmd(0)
      quit = True

if(__name__ == '__main__'):
  curses.wrapper(mainbody)

The answer is ‘no’

Friday, September 12th, 2008

Thursday’s Metro wins this week’s Wareham award for most bizarre headline:

Giant ice penis - is climate change to blame?

If the answer’s ‘yes’, do a little robot.

Friday, September 12th, 2008

Personally I’m not a fan of swearing as part of written media. Swearing is, to my mind, an entirely verbal thing—a rapid expression of frustration if you will. I’m about to break my own swearing rules for a video which, I am presuming, is the result of Microsoft paying Jerry Seinfeld $107.

OMG, WHAT THE FUCKITY FUCK FUCK?!?!///elevenslash

Its the end of the world as we know it…

Thursday, September 11th, 2008

I recommend people taking a look at these two interesting LHC webcams.

Firtree 0.0.4

Thursday, September 11th, 2008

In the tradition of ‘release early, release often’, I ‘released’ version 0.0.4 of Firtree today. Release is a strong word since, for the 0.0 series, ‘release’ basically means ‘bump minor version and build packages’. Feel free to add the Firtree APT sources if you’re an Ubuntu person and have a play.

I’m also starting to write a Python-based tutorial series which will end with the page curl example I blogged about earlier. Along with all this joy, I added a screenshots page so that you can drool at mindless eye candy :).

New in this release are image accumulators, so that you can easily perform effects which ‘feed back’ the result of one iteration into the next. Also new is the option to use the Mesa 3d software renderer instead of your hardware GL implementation so that you can tell if bugs are your vendor’s or mine :).

Switching GL backends within one process is a surprisingly hard thing to do. GL doesn’t really have the concept of different devices, or renderers, built into it and the nVidia and Mesa 3d libraries tried very hard to tread on each other’s toes.

Keeping the art of rhetoric alive

Wednesday, September 10th, 2008

So, Intarwebs, I’ve often toyed with attending a local Alpha course. Pros and cons?

In the beginning…

Tuesday, September 9th, 2008

The WebAIM site has a most amusing article up at the moment about the history of user agent strings—the name your web browser uses to identify itself to a website you are visiting. From the article:

And Netscape said, let us make fun of Microsoft and refer to Windows as “poorly debugged device drivers,” and Microsoft was angry. And so Microsoft made their own web browser, which they called Internet Explorer, hoping for it to be a “Netscape Killer”. And Internet Explorer supported frames, and yet was not Mozilla, and so was not given frames. And Microsoft grew impatient, and did not wish to wait for webmasters to learn of IE and begin to send it frames, and so Internet Explorer declared that it was “Mozilla compatible” and began to impersonate Netscape, and called itself Mozilla/1.22 (compatible; MSIE 2.0; Windows 95), and Internet Explorer received frames, and all of Microsoft was happy, but webmasters were confused.

How unsurprising

Monday, September 8th, 2008
What Be Your Nerd Type?
Your Result: Science/Math Nerd
 

(Absolute Insane Laughter as you pour toxic chemicals into a foaming tub of death!)

Well, maybe you aren’t this extreme, but you’re in league with the crazy scientists/mathmeticians of today. Very few people have the talent of math and science is something takes a lot of brains as well. Thank whosever God you worship, or don’t worship, so thank no deity whatsoever in your case, for you people! Most of us would have died off without your help.

Drama Nerd
 
Musician
 
Literature Nerd
 
Gamer/Computer Nerd
 
Anime Nerd
 
Social Nerd
 
Artistic Nerd
 
What Be Your Nerd Type?
Quiz Created on GoToQuiz