include/raytracer.h
branchpyrit
changeset 95 ca7d4c665531
parent 94 4c8abb8977dc
child 98 64638385798a
equal deleted inserted replaced
94:4c8abb8977dc 95:ca7d4c665531
    62 	Vector SphereDistribute(int i, int n, Float extent, const Vector &normal);
    62 	Vector SphereDistribute(int i, int n, Float extent, const Vector &normal);
    63 	Colour PhongShader(const Shape *shape,
    63 	Colour PhongShader(const Shape *shape,
    64 		const Vector &P, const Vector &N, const Vector &V);
    64 		const Vector &P, const Vector &N, const Vector &V);
    65 	void lightScatter(const Ray &ray, const Shape *shape, int depth,
    65 	void lightScatter(const Ray &ray, const Shape *shape, int depth,
    66 		const Vector &P, const Vector &normal, bool from_inside, Colour &col);
    66 		const Vector &P, const Vector &normal, bool from_inside, Colour &col);
       
    67 
    67 #ifndef NO_SIMD
    68 #ifndef NO_SIMD
    68 	VectorPacket PhongShader_packet(const Shape* const* shapes,
    69 	VectorPacket PhongShader_packet(const Shape* const* shapes,
    69 		const VectorPacket &P, const VectorPacket &N, const VectorPacket &V);
    70 		const VectorPacket &P, const VectorPacket &N, const VectorPacket &V);
    70 	void raytracePacket(RayPacket &rays, Colour *results);
    71 	void raytracePacket(RayPacket &rays, Colour *results);
    71 #endif
    72 #endif
    72 	static void *raytrace_worker(void *d);
    73 
       
    74 	NORETURN static void *raytrace_worker(void *d);
       
    75 
    73 public:
    76 public:
    74 	Raytracer(): top(NULL), camera(NULL), lights(), bg_colour(0., 0., 0.),
    77 	Raytracer(): top(NULL), camera(NULL), lights(), bg_colour(0., 0., 0.),
    75 		ao_samples(0), num_threads(4), max_depth(3), use_packets(true)
    78 		ao_samples(0), num_threads(4), max_depth(3), use_packets(true)
    76 	{
    79 	{
    77 		pthread_mutex_init(&sample_queue_mutex, NULL);
    80 		pthread_mutex_init(&sample_queue_mutex, NULL);