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

No comments:

Post a Comment