Monday, 14 November 2011

In Motion

The printer is finally moving of its own accord - I discovered a work-around for the firmware issue. Connecting the Arduino via USB, connecting in RepStrapper, and then finally applying power to the shield allows the board to connect. The thermistor readings work fine and I'm pretty sure the heater MOSFETS do too, but the stepper boards get too warm to work effectively - I should have some thermal epoxy and old aluminium heatsinks spare to sort that out, though I dislike making any permanent changes to hardware (and that glue is just about as permanent as it gets). At the same time I should also be able to heatsink my 1W laser driver too, and get some pretty pictures of the beam at full power, without it cutting out as the thermal limiter kicks in. The only other option is to buy a new and higher-power circuit instead (torches have higher-power boards but with much less tight regulation, which should be OK for a tough laser diode, though it may shorten the life-span somewhat).

I've also played with the lighting shader code, and worked out that changing the data types (the "quick fix" solution to the lighting speed) is simply not enough to bring the time down to reasonable lengths - it saves a about 2 ms for 800 million pixels - not nearly enough. The only reasonable solution now is to apply the lighting calculation to less pixels - using an estimate of 0.75ms/4MP, that means that lighting can "afford" to light about 32MP and still leave enough processing time for pretty effects like depth of field, ambient light, SSAO and another lighting or material pass for skin, particles, and other effects. To restrict 100 lights to 32MP, the average visible light radius can be around 300 on-screen pixels, which is pretty reasonable - in a cluttered scene many of the lit pixels will be occluded anyway, so drawing the light with a depth comparison might save even more processing time. Shadows are also relatively cheap with this method but will still need careful planning. All of these estimates are based on a fast card at high resolution though, so others' mileage may vary.

Charlie

Monday, 7 November 2011

Thermistor Trouble

In the last week, I've added multi-lights, tidied up my current lighting method and planned/written the beginnings of a skeleton-loader - the Doom 3 format is particularly nice for my purposes. Lights are currently too inefficient - 100 simultaneous non-shadowcasting lights run at about 7fps at 2560x1600. Admittedly, I've taken some horrific shortcuts in the pursuit of simplicity (right now, for every pixel on the screen, for every light in view, it generates the inverse of a 4x4 matrix - not exactly a speedy process).. When I fix that particular source of inefficiency, I'll re-time everything, add shadows, and see if it still needs more work. After that is skeletons and game logic itself.

As for the 3D printer, I (badly) drilled the holes through the glass bed - it's still usable, but has some irritating cracks. The firmware is unfortunately proving to be a bit of a pain - I haven't managed to get everything working reliably. I remember having a similar issue previously, which I think ended up tracing back to the thermistor board, of all places. The board currently sends back a "start" signal, but doesn't do anything useful afterwards, and drops the connection. With a bit of luck that issue shouldn't take much more time to trace down and I'll be all but ready to print!

 Charlie

Monday, 31 October 2011

Normal Mapping

I took a bit of time off from working on the 3D printer to get back into the coding for the game. I designed and added a basic model format (one which requires nearly no interpretation before it can be sent to the graphics card, which cut load time in half), and implemented normal mapping:

Left-hand side: No normal mapping. Right-hand side: Normal mapped.
You will need to see the full-size image - note the detail on the lion's face and roughness of stone.
Normal mapping takes a flat face (for example, the pillar on the right) and adds small peturbations to the direction in which the surface is facing, based on a texture. These changes can add virtual roughness or smoothness to a surface without increasing the geometric complexity, which can make the surface lighting look more realistic, at a minimal performance hit.

The TODO list before something playable is ready:

  • Skeletal Animation
  • Audio
  • Streaming System
  • Game Logic
  • Mechanics
  • Shadows/Specular Power/MultiLights/Graphical Tweaks
  • Basic AI
  • A world/level to experiment with.
I'm aiming to tick on average one of these off per week, and have something completely playable by the end of the year. It's odd to think that I first played around with this code around New Year's time, and have now been working on this, on and (mostly) off, for almost a year!

Charlie

Monday, 24 October 2011

Ready to Print

The printer is now physically all but ready to go - all that remains is to finish the print-bed and belt, wire up everything and sort the electronics. This post will be edited when I finish.

Monday, 17 October 2011

It Extrudes!

After a weekend of heavy tinkering, I finally got the printer to spool a fair amount of plastic through the nozzle. The only bit I have left to finish now is the print bed, endstops, and the final bits of wiring/calibration - and then all of the optional bits, like insulation and taping the motor to reduce slip.

The very first stages of the extruder assembly - the clamp on the right grips the  plastic filament tightly. The grub screws (in theory - not on my first run!) hold the hot end in.

Later stage of the extruder construction - the big cog is driving the bolt, which in turn drags the filament through.
The near-finished extruder, now with motor.

No photos of the rest of it yet, I simply didn't have time - the SAQ isn't exactly the quickest form to fill out...
Charlie

Monday, 10 October 2011

3D Printer

Prusa Mendel so far

So, I spent a fairly long time over the weekend assembling my 3D printer. I'm still waiting for some bearings for the extruder, the print bed. and the final motor but otherwise it's all ready to go. Not much else to say, really, except check back soon to see it printing!

Charlie

Monday, 3 October 2011

I've made little progress with the game - what I have done has been mainly aesthetic, no physics yet. Normal mapping is almost finished - just need to compute the tangents and it'll be ready. On the plus side, I've made decent progress with the moped - it's in a decent condition given that it's been stored for several years with no maintenance. The brakes are even functional, though the front cable had seized. The gearbox (well, belt box) is also functional, but there's still plenty to do on it - for example, the engine has to be removed, lights sorted, legal bits checked, and it has to be weighed and measured fairly carefully, so that I can revise my estimates and get some real-world numbers to work with. I'll also have to buy the replacement bodywork. Motors are to be ordered shortly, it seems pointless to wait for delivery from China. Charlie