Monday, 15 August 2016

Shader: Pixel Dominance

Another shader toy:

So, I wondered what would happen if set up a shader where I flood filled pixels based on a function where every colour beats half of the colour space. I also introduce one new random pixel per frame. I quite like the intricate patterns that show up after a few minutes. Not what I would have expected. This is the function I used to decide which pixel won:

X and Y are R+G+B for the two pixels being compared.

Sunday, 17 July 2016

Embedding Shadertoy shaders in web pages

Did you know you can run custom GPU pixel shaders from javascript inside a web browser?  I am super delighted by that fact.

Shadertoy ( is basically Youtube for GLSL shaders.

You can embed a Shadertoy shader in a webpage using this little snippet:
<iframe src="" style="height: 500px; width: 500px;"></iframe>

Just change "4td3Wn" in the snippet to the code for your shader.  The code is the bit after "/view/" in the URL of the shader you want. You'll also need to set your shader to "public" or "public + api".

Here's an example.  You can see the code at - but you might want to mute your speakers first.  I can't find a way to disable the sound on the video that the shader uses as a data source.  Also note that this shader in chrome doesn't work if you have two copies open (this embedded version and the shadertoy site, for example).

Saturday, 3 May 2014

Minecraft and turtles.

Today I learned you can buy(?) software that runs on virtual robots (called turtles ala Logo) that a Minecraft mod lets you craft.

I don't even need to look to know that someone is writing a version of Minecraft in Lua to run on a computer crafted in Minecraft.

The turtles can talk to each other, via an in game net or the real internet. I do so hope the singularity is triggered by a hivemind of virtual lumberjack robots.

Edit: Looks like 'premium' probably doesn't mean 'paid'. Unless they're doing the payment processing in Minecraft. I hope they are.

Wednesday, 12 February 2014

rails - `autodetect': Could not find a JavaScript runtime.

I was following this guide:

To get rails and heroku working.

But when I got to:

$ rails generate controller welcome

I got an error:

/home/tims/.rvm/gems/ruby-2.1.0/gems/execjs-2.0.2/lib/execjs/runtimes.rb:51:in `autodetect': Could not find a
JavaScript runtime. See for a list of available runtimes.
from /home/tims/.rvm/gems/ruby-2.1.0/gems/execjs-2.0.2/lib/execjs.rb:5:in `'
from /home/tims/.rvm/gems/ruby-2.1.0/gems/execjs-2.0.2/lib/execjs.rb:4:in `'
from /home/tims/.rvm/gems/ruby-2.1.0/gems/uglifier-2.4.0/lib/uglifier.rb:3:in `require'
from /home/tims/.rvm/gems/ruby-2.1.0/gems/uglifier-2.4.0/lib/uglifier.rb:3:in `'
from /home/tims/.rvm/gems/ruby-2.1.0@global/gems/bundler-1.5.3/lib/bundler/runtime.rb:76:in `require'
from /home/tims/.rvm/gems/ruby-2.1.0@global/gems/bundler-1.5.3/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from /home/tims/.rvm/gems/ruby-2.1.0@global/gems/bundler-1.5.3/lib/bundler/runtime.rb:72:in `each'
from /home/tims/.rvm/gems/ruby-2.1.0@global/gems/bundler-1.5.3/lib/bundler/runtime.rb:72:in `block in require'
from /home/tims/.rvm/gems/ruby-2.1.0@global/gems/bundler-1.5.3/lib/bundler/runtime.rb:61:in `each'
from /home/tims/.rvm/gems/ruby-2.1.0@global/gems/bundler-1.5.3/lib/bundler/runtime.rb:61:in `require'
from /home/tims/.rvm/gems/ruby-2.1.0@global/gems/bundler-1.5.3/lib/bundler.rb:131:in `require'
from /home/tims/ruby/hsfeb/config/application.rb:7:in `'
from /home/tims/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/commands.rb:43:in `require'
from /home/tims/.rvm/gems/ruby-2.1.0/gems/railties-4.0.2/lib/rails/commands.rb:43:in `'
from bin/rails:4:in `require'
from bin/rails:4:in `

I fixed this by installing therubyracer gem:

gem install therubyracer

And then by uncommenting the therubyracer line in the project's Gemfile.

(Thanks to -
"Rails adds the therubyracer gem to Gemfile in a commented line for new apps and you can uncomment if you need it.")

Part 2

After starting the server and visiting / I got:

Started GET "/" for at 2014-02-12 23:50:54 +1000

PG::ConnectionBad (FATAL: Peer authentication failed for user "hsfeb"
activerecord (4.0.2) lib/active_record/connection_adapters/postgresql_adapter.rb:831:in `initialize'
activerecord (4.0.2) lib/active_record/connection_adapters/postgresql_adapter.rb:831:in `new'
activerecord (4.0.2) lib/active_record/connection_adapters/postgresql_adapter.rb:831:in `connect'

This was easily fixed by following the instructions for setting up postgres, later in the document.

I'm added
ruby "2.1.0"
to my Gemfile instead of 2.0.0.

Thursday, 8 August 2013

Cosplay interviews at PAX Australia - TF2

I interviewed some people at PAX Australia. See Cosplay interviews at PAX Australia - Introduction for details.

I have uploaded a video of the interview for completeness, but the audio quality is poor so here's a transcript.

Sniper: I'm sniper, obviously, from Team Fortress 2.
Soldier: I'm Red soldier, from Team Fortress 2
Heavy: I'm Blu heavy, from Team Fortress 2

Abznak: Does the heavy actually have a tutu outfit?
Heavy: He does, it's a Halloween costume.

Abznak: How have you found cosplaying at Pax?
Sniper: Very receptive. Everyone taking so many photos, it's been really good. We've found so many other TF2 cosplayers. So, it's been really great.
Soldier: It's been actually kind of relaxing because usually conventions are a huge hassle and a bit stressful sometimes, especially with large props and larger items but it's been really, really relaxing and all the staff have been facilitating and everyone has been nice and friendly.
Heavy: The best thing about it is the space, we can move around with our props without banging into people all the time.
Soldier: And we're not in a sweatbox.

Abznak: Did you make your guns?
Sniper: We all made our own weapons. I just made mine out of junk. This is a plastic table leg I just found and its just bits of crap I found. I just painted it with acrylic.
Soldier: Mine is mostly wood and PVC. My carpentry teacher helped me lathe this [back end of gun] which is wood. I did the rest myself.
Heavy: My gun is mostly PVC pipe. It's powered by a cordless drill, so [demonstrates spinning - 15s video demo]. And the speaker is mounted in the front for the sound.

Abznak: How much did you spend and how long did it take?
Sniper: I didn't spend much for the gun, because it's mostly made of crap. These are just clothes bought from a shop. I'm not good at sewing, so I got someone to sew this for me but I designed the pattern and stuff. It cost not even $200.
Soldier: First cosplay I did I didn't know what I was doing, I kinda wasted a lot of money. This one was a lot cheaper in some respects. I think I spent the most money on materials and paint. I spent a lot on paint. My mum helped me. I got the material and I got the pattern and I did the hemming, but she actually made it.
Heavy: I probably spent the most on equipment. I had three attempts at getting the thing to spin. I used three different drills to get one that actually worked. The rest was pretty cheap, apart from the boots which are work boots, so like $200.

Abznak: Did you learn any lessons in the process? Any recommendations to new cosplayers?
Heavy: Keep trying. Eventually you'll get it to work.
Soldier: Prop making for conventions is more like a puzzle really, because you have to think about what you're going to be doing all day, where's it going to be going, that sort of thing. It's almost like prop making in theatre. You do want to do more detailed things but you have to take into consideration travel and how much is it going to be knocked around. So really, I should have made this a lot more solidly. Also, I should have made it out of materials that could take more of a shock. Those are considerations to take into the future. Ask around at forums. Ask around prop people, like opera Sydney and theatre groups. They're really helpful.
Sniper: This is my first cosplay, so I'm glad I made this so light, because I've been carting it around for two days straight. So if you're going to cosplay and it's your first one make something you'll be happy to carry around with you all day. Because these guys have a lot heaver weapons and they're suffering for it. If you are going to be coming somewhere like a convention... there's this pyro, and they had a mask on, and they were pretty much dying. I'm happy I didn't do anything like that. Just do something easy. Get a feel for it.
Soldier: Also materials for your costume, a lot of people don't take into consideration. Say, pleather might look better, but you might need to sew in seams that allow airflow (like ski gear). Consider the effects of layering (If I was outside right now it would be good, because it's freezing [outside]). Also consider what will look the best - for example linen looks fantastic sometimes but creases really easily, so you might need to use backing more or you might need to take more care ironing it and transporting it. There's a lot of things you have to think about.
Sniper: If you're taking a flight down, make sure your props are portable. Obviously these aren't, we had to drive down for 16 hours to get here, because we couldn't fly. You might want to take that into consideration if you're building props like this.

Abznak: Do you have a website or names you'd like attached to the article?
Soldier: lafayelle
Sniper: My Angry Pigeon on Steam.

Abznak: Are you planning on going to any other cons?
Soldier: I only really like going to smack and supernova in Sydney. But they dragged me here. But I really enjoyed it. They dragged me up to Brisbane as well.
Sniper: We're defiantly going next year if they have one.
Heavy: It blew EB Expo out of the water. Smash in Sydney if I can make it. If not, Brisbane supernova.

Abznak: Thank you all for your time.

Cosplay interviews at PAX Australia - Introduction

While I was at Pax Australia, I took photos of cosplayers (because I'm a photographer). After talking to them about their costumes while photographing, I though "This is interesting, I should record it". So I did.

My next post is the first in a series of interviews with cosplayers.

I learnt a few things in the process of these impromptu interviews. Next time, I

  • Get people to introduce themselves with names up front.

  • Bring a better microphone

  • Bring someone else to hold the camera

  • Take some reaction shots, in case I want to get fancy and actually edit the videos. (Credit to Mike Moore from Frontline for this tip)

I plan to do more of these, so I'd love to know what you think of them. If you have any comments, please tweet me a message or email me at

Sunday, 1 July 2012

Some photos not converted in Digital Photo Professional

I just figured out my problem with "Digital Photo Professional" (Canon software which converts CR2 (raw) files to jpgs). If software hasn't created the thumbnail yet, the file can't be selected.

So if you click on the first photo, then shift click on the last photo, it looks like it selects all, but actually it only selects the photos that it has had time to load. Then you batch convert them to jpgs and wonder why you only have one photo of the flying trapeze.

This also explains why the "select all" button is greyed out.