ishani-logo
March 10th, 2013  »  Personal  »  No Comments

OddityOnSiteIt’s one week on from the Kinetica art show in London – as mentioned in my last post – where myself and my partner-in-hacking John exhibited some of our electronics projects to the public for the first time. We filled my car with tools, half-built devices, cables and an extremely heavy iron fireplace. Wood panels got strapped to the roof (really should have properly measured the boot ahead of time) and we made our way to the Ambika P3 warehouse, bunker-like under the University of Westminister.

Exhausting, chaotic and great fun all at once, we were utterly unprepared for the level of attention we got over the course of the week. By Sunday my voice had diminished to a croak after hours and hours of constant talking, explaining, evangelising. It was a shame we have no way to create lots of these pieces quickly, as I’m fairly sure we could have easily sold a suitcase full!

It was also a great live test of our new interactive unit. With a little explanation, most everyone – including young kids – managed to get the hang of the interface and was soon dialling between effects and mucking about with wave simulations and spinning 3D cubes. We also quickly found out which were the crowd-pleasers and which could stand a little more work.

Here’s a couple of videos from people taken at the show:

A demo of all four Oddity units, ticking away (as part of a larger video about Kinetica, go check the rest out too!)

A one-on-one showing the interface and a few effects being fiddled with.

December 13th, 2012  »  Personal | Programming  »  No Comments

One ARM Cortex-M3 clocked at 72 MHz, equipped with a staggering 128k Flash and 20KB SRAM. Add four 8×8 Red/Green LED matrix panels that can pump out an eye-watering 4-bit colour palette. You get something like this, which we call Oddity:

My friend John and I have been hacking LED panel projects together for a little while now. He builds marvellous hardware and I make pretty patterns appear. These devices are curiously hypnotic and addicting – something about the colourful intensity of the LEDs and the smooth fluidity of the patterns (60Hz and beyond!) .. or perhaps the nostalgia for old-school graphic effects like plasma and sinebows at a miniature scale on a device you can hold in the palm of your hand!

One downside: they are a bastard to photograph properly

One downside: they are a bastard to photograph properly


It turns out 16×16 is just about enough resolution to get recognisable 3D going (via 16.16 fixed-point, that M3 has no FPU), whereas the polar-plasma and sine-based effects still ‘work’ all the way down at 8×8 pixels – even a tiny pixel-font text scroller is possible at the smallest panel size (which works out at 1″ square on the panel). To really drink in the effect, you have to see it in person, preferably in the dark .. which brings me to a quick plug:

If being hypnotised by tiny, bright buckets of light swirling around in glossy black perspex boxes sounds like your kinda thing, why not pencil in a trip to the Kinetica Art Fair in London early next year – http://www.kinetica-museum.org/ – where we’ll (or John will, mostly) be hanging out in a little booth, alongside many other mind-bending exhibits of amazing visual art.

December 5th, 2012  »  Programming  »  No Comments

C++ enums are pretty boring, right? Depends. Can yours do this?

VertexFormat::Enum k = VertexFormat::Vertex_Pos3_RGBA_Normal3_UV0;
const char* str = VertexFormat::toString(k);
k = VertexFormat::fromString(str);

printf("%s has %i entries, of which %s == %i\n\n", 
  VertexFormat::enumName(),
  VertexFormat::enumCount(),
  str,
  k);

// prints: "VertexFormat has 7 entries, of which Vertex_Pos3_RGBA_Normal3_UV0 == 5"

Or how about

for (VertexFormat::StorageType i=0; i<VertexFormat::enumCount(); i++)
{
  printf("> %s \n", VertexFormat::toString( VertexFormat::getByValue(i) ) );
}

I can convert to and from a string representation, get proper name isolation as well as basic reflection. Defining the enum is not much more work than normal:

#define BF_VERTEX_FORMATS(_entry) \
  _entry(Vertex_Pos3) \
  _entry(Vertex_Pos4) \
  _entry(Vertex_Pos3_RGBA) \
  _entry(Vertex_Pos4_RGBA) \
  _entry(Vertex_Pos3_RGBA_Normal3) \
  _entry(Vertex_Pos3_RGBA_Normal3_UV0) \
  _entry(Vertex_Pos3_RGBA_UV0) 

CREATE_FANCYENUM(VertexFormat, uint32_t, BF_VERTEX_FORMATS);

Using the marvels of layered high-order macros – Hey, did you know you can pass macros to macros (to macros)? because you can. And it’s awesome. – we get something a bit more useful than a weakly-typed alias.

I’m not a massive fan of writing my own ‘meta-language’ using macros as it ends up being a nightmare to debug should it go wrong or refuse to compile – but in this case the underlying code is simple to keep track of and provides such a useful addition that it’s worth dealing with any negatives.

Here’s how it works…
(more…)

December 4th, 2012  »  Programming  »  No Comments

Hey guess what’s been updated

Time to write some more varied posts otherwise this blog is going to get (even more) tedious!

October 23rd, 2012  »  Programming  »  2 Comments

A post two months after the last with almost the same content! Here’s just a quick note to say – if you’re mucking with ClangVSx or my pre-built Clang for Windows package, both have just been updated. Details on the pages.

IMPORTANT: The Clang distribution is built with Visual Studio 2012 – Please snag the X86 redistributables from Microsoft to use it if you don’t have VS2012 (RTM) installed.

August 9th, 2012  »  Programming  »  23 Comments

I have updated my prebuilt ‘Clang/LLVM for Windows’ to the latest and greatest. Find the August 2012 package over here.

There were some annoyances trying to get ClangVSx working on Visual Studio 2012 RC, which are now fixed. I have uploaded a small point-release to GitHub, find the details on the ClangVSx page.

The two stumbling blocks for getting the 2010 version of the add-in working were:

  • Forgetting to update the 2010-specific assembly references in the project; namely Microsoft.VisualStudio.VCProjectEngine & Microsoft.VisualStudio.VCProject
  • 2012 returns the hidden .filters file in the VCProject.Files collection, which happens to then throw an exception when you ask if it is ExcludedfromBuild. Wrapping access to these freaky dynamic objects saves the system from failing and we just skip anything that doesn’t support the required interfaces.

Anyone using either of these projects – please let me know bugs and issues, either via the comments system on the site or via GitHub!

August 7th, 2012  »  Programming  »  No Comments

After someone reported that ClangVSx wasn’t loading into the VS 2012 RC, I tried using the latest [New Add-in Wizard] to see what I was missing, or what had changed. Turns out, their default example add-ins don’t load either, or at least they don’t on my install.

I’m not entirely sure why yet, but the usual spot where I put AddIn files for registration – Documents\Visual Studio 2012\Addins – wasn’t being scanned by Visual Studio. There are no obvious differences in the [Tools] -> Options -> Add-In Security panel, yet the entry I would expect to have covered that path – %VSMYDOCUMENTS%\Addins – clearly wasn’t working.

Manually adding in my local path fixes it.

Just incase there are any issues with loading the existing version of ClangVSx, I’ve quickly recompiled it inside 2012 using the .NET 4.5 Framework .. snip Update: It required a few code changes to get things working in 2012. A new version, along with an update to the Clang-Win32 package is coming very soon.

August 3rd, 2012  »  Programming  »  No Comments

The new Windows 8 handsets are being built upon Qualcomm’s Snapdragon S4 Plus SoC – which, if the various internet sources are correct, means it will likely ship with their new Adreno 320; a GPU that is listed as OpenCL 1.2 compliant, meaning one can begin to do GPGPU tasks on a phone. If you ever needed more proof that mobile device capabilities are advancing at an incredible rate … !

Curiously, in several reports it is only described as being conformant to DirectX 11 feature level 9_3 for Windows platforms – essentially top-tier DirectX 9 functionality, which precludes the use of Compute Shaders. I can only hope this isn’t the case when they ship the actual hardware, as it seems like a pity to not be able to take advantage of what could be a really differentiating GPU feature (at least until the A6 comes out, no doubt!)

Still, the WP8 SDK offers the full DirectX 11 graphics API and, although this is likely to simply be the fault of an overachieving emulator, reports that it is feature level 11_0. So how about we give it a crack anyway?

‘Radial Blur’ Compute Shader running in Windows Phone 8 emulator at ~8 FPS. Blur length is scaled over time. Runs as [32,32] groups with [16,16] threads on a 512×512 texture input.


(more…)