Sunday, 28 December 2008

Multithreading Begun

I recently downloaded some new data to try, from the same page as the CT scan I have been rendering. It was suggested in the last tutor meeting before christmas that I do this, in order to test that everything is working correctly.

The first set is a scan of the inner ear:



This data set does not contain cube voxels, instead they are rectangles, longer in the Z axis. I added some code to take this into account.

The second new data set is a mathematical function. This contains none of the problems of a scan (innaccuracies, noise etc) so it is good for testing the rendering is correct. I used the colour table function to map different colours and transparencies to various values.



Finally this evening I got multithreading working at a basic level using the boost::threads library.



The red component of the image indicates which thread rendered those pixels, just for testing purposes - here there are 8 threads. This computer only has a single core CPU and so I can't fully test this yet, however I will have a good point to start from when I get back to university after the christmas holidays.

The next task is to implement features such as selecting how the pixels are divided up between threads (in blocks or alternate pixels), possibly some improvements to the lighting, and some better output of rendering times to make testing easier.

No comments: