69 void raytracePacket(RayPacket &rays, Colour *results); |
70 void raytracePacket(RayPacket &rays, Colour *results); |
70 #endif |
71 #endif |
71 static void *raytrace_worker(void *d); |
72 static void *raytrace_worker(void *d); |
72 public: |
73 public: |
73 Raytracer(): top(NULL), camera(NULL), lights(), bg_colour(0., 0., 0.), |
74 Raytracer(): top(NULL), camera(NULL), lights(), bg_colour(0., 0., 0.), |
74 ao_samples(0), num_threads(2), max_depth(3), use_packets(true) |
75 ao_samples(0), num_threads(4), max_depth(3), use_packets(true) |
75 { |
76 { |
76 pthread_mutex_init(&sample_queue_mutex, NULL); |
77 pthread_mutex_init(&sample_queue_mutex, NULL); |
77 pthread_mutex_init(&sampler_mutex, NULL); |
78 pthread_mutex_init(&sampler_mutex, NULL); |
78 pthread_cond_init (&sample_queue_cond, NULL); |
79 pthread_cond_init (&sample_queue_cond, NULL); |
79 pthread_cond_init (&worker_ready_cond, NULL); |
80 pthread_cond_init (&worker_ready_cond, NULL); |