diff -r a4913301c626 -r 558fde7da82a src/raytracer.cc --- a/src/raytracer.cc Wed Mar 26 17:03:38 2008 +0100 +++ b/src/raytracer.cc Fri Mar 28 00:53:20 2008 +0100 @@ -238,54 +238,6 @@ } } -static inline void samplepixel(Colour &c, Vector3 &dir, RenderrowData* d, const int &oversample) -{ - if (oversample <= 0) - { - // no oversampling - dir.normalize(); - Ray ray(d->eye, dir); - c = d->rt->raytrace(ray, 0, NULL); - } - else - if (oversample <= 3) - { - // grid oversampling - c = Colour(0,0,0); - static const int gridsamples[] = {5,9,16}; - static const Float osa5x[] = {0.0, -0.4, +0.4, +0.4, -0.4}; - static const Float osa5y[] = {0.0, -0.4, -0.4, +0.4, +0.4}; - static const Float osa9x[] = {-0.34, 0.00, +0.34, - -0.34, 0.00, +0.34, -0.34, 0.00, +0.34}; - static const Float osa9y[] = {-0.34, -0.34, -0.34, - 0.00, 0.00, 0.00, +0.34, +0.34, +0.34}; - static const Float osa16x[] = {-0.375, -0.125, +0.125, +0.375, - -0.375, -0.125, +0.125, +0.375, -0.375, -0.125, +0.125, +0.375, - -0.375, -0.125, +0.125, +0.375}; - static const Float osa16y[] = {-0.375, -0.375, -0.375, -0.375, - -0.125, -0.125, -0.125, -0.125, +0.125, +0.125, +0.125, +0.125, - +0.375, +0.375, +0.375, +0.375}; - static const Float *osaSx[] = {osa5x, osa9x, osa16x}; - static const Float *osaSy[] = {osa5y, osa9y, osa16y}; - const int samples = gridsamples[oversample-1]; - const Float *osax = osaSx[oversample-1]; - const Float *osay = osaSy[oversample-1]; - for (int i = 0; i < samples; i++) - { - Vector3 tmpdir = dir + osax[i]*d->dx + osay[i]*d->dy; - tmpdir.normalize(); - Ray ray(d->eye, tmpdir); - c += d->rt->raytrace(ray, 0, NULL); - } - c = c * (1.0/samples); - } - else - { - // stochastic oversampling - // ...todo - } -} - #if 0 static void *renderrow(void *data) { @@ -468,7 +420,11 @@ delete prev; prev = sample; + sampnum--; + if ((sampnum % 1000) == 0) + dbgmsg(2, "\b\b\b\b\b\b\b\b%8d", sampnum); } + dbgmsg(2, "\n"); } // wait for workers