Aftermath


Hopefully, reading through this tutorial and looking at the examples will have shown you that, exotic though this beast may be, it's actually not too difficult to write code for, and that you can have fun, even using hardly any memory and only one processor! And, if nothing else, you've got an excellent trip-toy to play with :-)

So what mistakes did I make during the process of making my warper? Well, there was that silly mistake of not using the UV pair from the outset to traverse the source tile, knowing full well that I intended to do a bilinear interpolation. I shall abase myself and say three Hail Turings, for I was guilty of the sin of not thinking in the Merlin Way when I chose my index registers. O woe! But it wasn't too difficult to fix though, so no harm done.

I also probably should have figured in the extra increments for the nonlinear warp while I was still planning my inner loop on the whiteboard - that way I would probably have spotted the problem with the inelegant walk around the pixel quad earlier. However, stuff like that is going to happen to you, and you will one day find yourself looking at an already packed loop and trying to fit something more in. Where there's a will and enough tea, there is often a way.

Where do you go from here? Well, here are a few suggestions...

You could try and bum a few more ticks off the warper. I concentrated almost entirely on the innermost loop and didn't really touch the outer ones much. Practise a little simple optimisation on them and see how much speed you gain. You'll appreciate how important that innermost loop is to the overall timing.

The basic framework of the warper is handy for just about any effect that traverses a destination rectangle. You could try messing about with it and seeing what you come up with. In fact, it's an excellent framework for testing out procedural textures with - something you might like to explore using my next document, How to Create Groovy Procedural Textures (which I will get around to next time I am in the mood to write documentation).

Remember, we only used one MPE - think about the naughtiness you can get up to when you start using multiple MPEs in parallel or in a pipeline...

Above all, have fun. Merlin is a blast to code, and the things you can do with graphics will make your brain bleed.

Happy hacking... and enjoy your LLAMA...

...I certainly enjoyed mine!


jmp prev
rts
nop
nop