I went to Lidl this week.  Well, the car needed a run, and where better to go than on a crap adventure to a value supermarket of dubious standing?

Initial thoughts were foreboding, with a big sign telling you not to park for more than 90 minutes in case Mr Lidl was forced to make bad things happen, and a strange underground lobby full of cleaning-in-progress signs and not a lot of actual cleaning.  I took the stairs to yet another pre-emporium lobby, this one containing the actual entrance to the shop.

Inside is a bit odd; stuff just kind of piled around with some loose logic of similar things being in kept in the same place applied.  Vegetables are displayed directly in their packing crates and there are lots of things heaped in dump bins.  A bit like stepping into a Kwik Save from the late ’90s in that it’s all very pared down with no nonsense, although unlike a Kwik Save I didn’t spot any products that had zoomed past their sell-by date several months previously.

I bought some things.  Most of the things have now been consumed or otherwise put to use.

  • Serrano Ham (£1.49) – pretty good.  Larger quantity and slightly stronger taste compared to a similarly-priced pack from Sainsbury’s.
  • “Mixxed Up Classic Stimulation Drink” (29p) – every so often I try one of the Red Bull knockoffs to see what it’s like.  This one is almost identical.  Maybe a little sweeter.
  • Chocolate Cream Dessert (29p) – tasteless brown glop covered in tasteless white foamy stuff.  Briefly diverting for for its alien texture, but not an advisable purchase.
  • Mozzarella ball (47p) – good but a bit salty.  Seemed to decompose a bit on melting compared to the Galbani stuff.
  • Alfredo Pizza “Inferno” (£1.29) – the refrigerated pizzas looked a bit grim so I was apprehensive about this frozen one from the same brand, but I needn’t have been.
    a) The most bastarding hot chilli pizza I’ve ever bought, and that includes the limited-edition one Ask were knocking out a few years ago.
    b) I’ve paid more for worse.  Ingredients and base were both good quality, only the cheese was skimped on a little.
  • Salad Tomatoes (59p) – were tomatoes.

What’s reasonably obvious from the above is that the products are kept cheap by the judicious addition of salt, sugar or strong flavours to mask what might be missing compared to the full-price equivalent.  I think I prefer this to the endless grey goo of the usual supermarkets’ economy ranges, which might not kill you as soon but will certainly make you wish they had.

Thus concludes the research.  I have Actual Uses for the car over the next couple of weeks, obviating the need for pointless trips solely to stop it rusting in place, so no need to worry about any follow-on investigations of the local Aldi or Netto just yet.

Posted in Uncategorized | Leave a comment


I change operating system about once a decade.

Well, no; by accident rather than design I ended up running Windows 2000 well past what could charitably be called its twilight years, and by the time the installation was beyond a joke and I knew I needed to replace it, the Vista-isn’t-good-enough debacle was in full swing, and by the time that blew over I’d become so used to the daily trials of running an out of date, unsupported operating system that there seemed no point in changing it.

Last week I gave in.  Important things like Spotify and Dwarf Fortress had moved on into versions that didn’t work on Win2k, and that meant ordering a hard drive and a copy of Windows 7.

I have long ago learnt that the easiest way of performing an operating system upgrade is to lug out your old hard drive, keeping it frozen in time like a baby picture, and install to something shiny and new.  Even a relatively large and fast hard drive costs no more than a weekend session at the ales now – it’s worth it just to avoid having to negotiate the precarious path of installing over a drive containing data you want to keep.  (Plugging your old drive into a spare SATA port and copying across anything you wanted is much easier, put it that way.)

I’m reserving judgment on Win7 until I’ve used it long enough to find some dislikeables, although at this stage I can say the install process was very smooth, updating a graphics driver was bizarrely painless, and most things seem to be Just Working even if I will probably spend the next few weeks tweaking settings getting the latest versions of everything to work the way I liked the old versions to.

Just have to make sure after it’s all set up that I use my spare time to work on some projects like a good productive citizen, rather than downloading all those XP-only Steam games I’d been gazing at like a kid outside a locked sweetshop!

Posted in Uncategorized | Leave a comment


Ogre is a pretty good 3D engine/library, if one with a somewhat steep learning curve.  I’ll write some more thoughts on it one day, but for now, a useful finding from today is that by default, texture co-ordinates are set to wrap.  Additional discovery is that 0.0 and 1.0, even without bilinear filtering, have a tendency to nearest-neighbour in texels from the other end of the map when wrapping is enabled.

After spending a good while wondering why my terrain tiles had odd ridges where they abutted each other, and a good while more knowing what the problem was but wondering how to fix it, I found the following nestled away in the TextureUnitState class:


As I’ve said, more on Ogre to be forthcoming, but this is only a minor example of the ways it can be a real kitchen sink full of power when you need to do something unusual or specific.

Posted in Uncategorized | Leave a comment

Java Redux.

There’s something satisfying about conducting a little science, even when you know what the results are going to be.  Well.  I nearly caught a big surprise, but then I remembered I was comparing a debug build to a release one.

Java is slower.  But that’s not to say it doesn’t do very well for a bytecode language.

I copied my large-area terrain tile processor to C++.  Literally in some cases; Java syntax isn’t exactly a world away.  Getting it all running was… frustrating, I guess, but that’s what getting out of the managed world does for you.

I built two versions of the C++ implementation.  One that didn’t care about memory, and one that at least made a token effort about cleaning up as it went along.


Java: 52s
C++ dirty: 26s
C++ tidy: 33s

The bigger story is memory usage.  Both the Java and “dirty” C++ versions ended with about 220MB allocated.  This suggests the Java garbage collector was sitting around waiting until I either finished what I was doing with the CPU or ran out of memory.

C++ “tidy”, though… 72MB.  Bear in mind it’s got an SRTM DEM in memory throughout; those are 70MB on their own.  That time lost doing one’s own memory management may be worthwhile.

Speaking of time lost… it’s slower to develop in C++.  Doesn’t help that I’m (re)learning as I go along, but it has more gotchas and ways to end up in unpredictable places after a null reference or two.  Also the user community isn’t as good.

This may sound weird but when I was looking to see if other people had solved similar problems, the Java forums where much more helpful.  They tended to follow the 3-post question, answer, explanation of why the answer made sense format.

On a C++ forum it went more: Question, attack on the user for asking the question, nitpick of irrelevant details about how the question was asked, incorrect answer, failure to accept that wrong answer is wrong, further attack on original user… at which point the thread had pretty much died and I’d got an actual book off a bookshelf.  (I know.)

It seems an odd setup but it’s one I’ve seen in the commercial world.  The truth is most of those people posting don’t know the answer either… but they think they should, and this makes them angry at the person who asked.  C++ is a language with a steep learning curve and an involved problem-solving process though; it is hard to know the answers sometimes.  I know I don’t.

(Although I would suggest one of the best questions for narrowing the problem search space is “have you included windows.h?” as it has an interesting habit of redefining stuff you wouldn’t expect.)

Anyway.  Java is slow and uses lots of memory.  But not that slow, and not that unsensible in terms of why it’s using that memory.

Posted in Uncategorized | Leave a comment


My experiment with Java in a high-performance graphics context has “sort of” (perhaps not permanently) ended.  It’s been interesting, as I managed to get a lot more out of it than I did C#, even though the latter is a language I have most of my commercial experience in and therefore ought to be able to get more out of.

The thing is stuff like normal calculation is turning out to be dog-slow – down in the realm of things like reading from the filesystem – and I need to satisfy my curiosity by implementing the same class in C++ to see whether it’s language or design at fault.  For some reason, even with JIT, when you get down into really tight nested loops with lots of trig or memory accesses the bytecode languages start to struggle more than you’d expect from the literature.

Now that’s not to say 3D graphics won’t work in Java; Minecraft being the obvious counter-example, and if you can offload the work to the GPU or have a very simple, low-cost path to throw vertices at the graphics card then you’ll probably gain more from the development speed of Java than you’ll lose in raw FPS.  In other words, if your CPU operations aren’t much more than traversing a scene graph and doing some frustum culling, you’re fine.

Where I run into problems is that my project is doing a lot of data upsampling and streaming, at quite dense detail levels, which means that spending 2-3ms in calculation per scenery tile is already borderline before we’ve started thinking about normal maps, material baking or any other fun stuff you can do to a landscape tile.  It may be the case I see the same results working without the abstraction layer of a virtual machine, and it may be the case I can optimise my Java code better, but the point here is information gathering more than anything.

(Also I want to play with clipmap-based terrain rendering, which means some from-scratch coding whichever language I do it in.  May as well bung the terrain-gen algorithms in C++ as I do it.)

There probably ought to be more to this, and something of my playing with Delaunay triangulations, but blimey, look at the time!

Posted in Uncategorized | Leave a comment


Here is a lesson.  Never, ever lock the only available online copy of your source code behind a version control system.  Always have some way of getting a recent snapshot via HTTP, and preferably not via the tedious file-by-file approach offered by some VCS browsers.  There are some very good reasons for doing so.

  1. Is your favoured version control system universal?  I mean, really universal? The world is a much larger place than the 2 or 3 recent versions of Ubuntu your development team are running, and you can guarantee there’s some use case you haven’t thought of.  HTTP and a common file compression format are very good lowest common denominators in that most platforms support them.
  2. Anybody who lived through the Linux dependency hell era on a 56k (or slower) connection could tell you the folly of linking a 20KB utility program to an obscure 10MB library.  Requiring a version control system is similarly requiring users to waste bandwidth and disk space they may not have on downloading that system; a problem made worse by the tendency of a new “latest and greatest” to come out every year or so.

It’s annoying as we seem to never leap forward without taking some step back.  Being able to check out repositories and track changes against them – great.  Far better than the old days of having to manually reconcile differences against source tarballs.  Being forced to?  Not so great.

Posted in Uncategorized | Leave a comment


Applying a convolution kernel to a regular heightmap grid to produce points of interest for a Delaunay triangulation.  In other words, do edge detection on the dataset first, rather than going through the labourious process of attempting to compute errors for progressively more refined triangulations.  Genius.

I’d expect the visual fidelity for a given number of points to be lower, but probably not so much lower that you couldn’t simply add a few more triangles to the rendering pipeline and get away with it.

To be investigated, I think.

Posted in Uncategorized | Leave a comment