--- a/include/raytracer.h Tue Apr 29 23:31:08 2008 +0200
+++ b/include/raytracer.h Fri May 02 13:27:47 2008 +0200
@@ -39,7 +39,7 @@
struct RenderrowData {
Raytracer *rt;
int w;
- Vector3 eye, dfix, dx, dy;
+ Vector eye, dfix, dx, dy;
Float *iter;
};
@@ -59,17 +59,22 @@
int max_depth;
bool use_packets;
- Vector3 SphereDistribute(int i, int n, Float extent, Vector3 &normal);
-
Sample *sample_queue;
int sample_queue_pos, sample_queue_size, sample_queue_count;
bool end_of_samples;
pthread_mutex_t sample_queue_mutex, sampler_mutex;
pthread_cond_t sample_queue_cond, worker_ready_cond;
- Colour shader_evalulate(const Ray &ray, int depth, Shape *origin_shape,
- Float nearest_distance, Shape *nearest_shape);
+ Vector SphereDistribute(int i, int n, Float extent, const Vector &normal);
+ Colour PhongShader(const Shape *shape,
+ const Vector &P, const Vector &N, const Vector &V);
+ void lightScatter(const Ray &ray, const Shape *shape, int depth,
+ const Vector &P, const Vector &normal, bool from_inside, Colour &col);
+#ifndef NO_SSE
+ VectorPacket PhongShader_packet(const Shape **shapes,
+ const VectorPacket &P, const VectorPacket &N, const VectorPacket &V);
void raytracePacket(RayPacket &rays, Colour *results);
+#endif
static void *raytrace_worker(void *d);
public:
Raytracer(): top(NULL), camera(NULL), lights(), bg_colour(0., 0., 0.),
@@ -89,7 +94,7 @@
}
void render();
- Colour raytrace(Ray &ray, int depth, Shape *origin_shape);
+ Colour raytrace(Ray &ray, int depth, const Shape *origin_shape);
void addShape(Shape *shape) { top->addShape(shape); };
void addLight(Light *light) { lights.push_back(light); };
void setSampler(Sampler *sampl) { sampler = sampl; };