Only in .: #dof.rib#
Only in .: #light.h#
Only in .: #log#
Only in .: #shapes.h#
diff ./Makefile ../lrt2/lrt/Makefile
53,56c53
< 	accel.cc image.cc scene.cc nurbs.cc film.cc mbdofcamera.cc \
< 	pmap.cc
< 	
< 	
---
> 	accel.cc image.cc scene.cc nurbs.cc film.cc mbdofcamera.cc
60,61c57,58
< 	nurbs.h film.h \
< 	pmap.h
---
> 	nurbs.h film.h
> 
Binary files ./api.o and ../lrt2/lrt/api.o differ
Only in .: balls.rib
Only in .: differ
Only in .: dof.rib
Only in .: dof.rib~
Only in .: dof2.tiff
Only in .: exec
Only in .: exec2
Only in .: exec~
Only in .: gears.rib
diff ./light.cc ../lrt2/lrt/light.cc
5,6d4
< #include "reflection.h"
< 
114,183d111
< 
< /*void Light::EmitPhotons(Scene *scene)
< {
<   int counter = 0;
<   for (int i = 0 ; i < nPhotons ; i++ ) {
<     Float u1 = RandomFloat(), u2 = RandomFloat();
<     Float x = 2*cos(2*M_PI*u2)*sqrtf(u1*(1-u1));
<     Float y = 2*sin(2*M_PI*u2)*sqrtf(u1*(1-u1));
<     Float z = (1 - 2 * u1);
<     Ray r = Ray(Point(0.,3.,0.),Vector(x,y,z));
<     //r.mint = 0.0f;
< 	//r.maxt = 1e8f;
< //    r = LightToWorld(r);
<     Surf s;
<     if (scene->Intersect(r,&s)) {
<       if (/*absorbed 1) {
< 	Float rgb[3];
< 	Power.ConvertToRGB(rgb);
< 	scene->pmap->Insert(s.dgGeom.P,rgb,r.D.Hat());
< 	counter++;
<      }
<     }
<   }
<   scene->pmap->ScalePow(1.0/10000.0f);
<   printf("\nPhoton Hits: %d out of %d",counter,nPhotons);
< }*/
< 
< void Light::EmitPhotons(Scene *scene)
< {
<   int counter = 0;
<   for (int i = 0 ; i < nPhotons ; i++ ) {
< 	while(1) {
<     	Float u1 = RandomFloat(), u2 = RandomFloat();
<     	Float x = 2*cos(2*M_PI*u2)*sqrtf(u1*(1-u1));
<     	Float y = 2*sin(2*M_PI*u2)*sqrtf(u1*(1-u1));
<     	Float z = (1 - 2 * u1);
<     	Ray r = Ray(Point(11.3000, 5.10000 ,8.80000),Vector(x,y,z));
<     	//r = LightToWorld(r);
< 
<     	Surf s;
<     	if (scene->Intersect(r,&s)) {
< 
< 		Spectrum L(0.);
< 		Spectrum LE = s.Le(-r.D);
< 		L += LE;
< 		BSDF *bsdf = s.getBSDF();
< 		Vector wi;
< 		Spectrum dE = ((PointLight*)this)->dE(scene, s.dgShading, &wi);
< 		Spectrum S = bsdf->f(-r.D, wi);
< 		L += dE*S;
< 		Float rgb1[3],rgb2[3],rgb3[3],rgb[3];
< 	//	L*=Power;
< 	//	Power.ConvertToRGB(rgb);
< 		L.ConvertToRGB(rgb);
< 		LE.ConvertToRGB(rgb1);
< 		dE.ConvertToRGB(rgb2);
< 		S.ConvertToRGB(rgb3);
< 		printf("Le:  %g %g %g\n", rgb1[0], rgb1[1], rgb1[2]);
< 		printf("S:   %g %g %g\n", rgb2[0], rgb2[1], rgb2[2]);
< 		printf("De:  %g %g %g\n", rgb3[0], rgb3[1], rgb3[2]);
< 		printf("RGB: %g %g %g\n", rgb[0], rgb[1], rgb[2]);
< 			scene->pmap->Insert(s.dgGeom.P,rgb,r.D.Hat());
< 			counter++;
< 			break;
<     	}
< 	}
<   }
<   scene->pmap->ScalePow(50.0f/counter);
<   printf("\nPhoton Hits: %d out of %d",counter,nPhotons);
< }
diff ./light.h ../lrt2/lrt/light.h
7d6
< #include "pmap.h"
34,43d32
< 
< 	//NEW STUFF
< 	void SetPhotonCount(int n) { nPhotons = n;}
< 	int GetPhotonCount() { return nPhotons;}
< 	float GetIntensity() { return Power.Intensity(); }
< 	void EmitPhotons( Scene *scene);
< 	int nPhotons;
< 	//END NEW STUFF
< 
< 
45d33
< 
Binary files ./light.o and ../lrt2/lrt/light.o differ
Only in .: log
Only in .: log2
Binary files ./lrt and ../lrt2/lrt/lrt differ
Binary files ./lrt.o and ../lrt2/lrt/lrt.o differ
diff ./mbdofcamera.cc ../lrt2/lrt/mbdofcamera.cc
39,49c39
<   if (sample[0] < film->GetImage()->SampleCropLeft ||
<       sample[0] > film->GetImage()->SampleCropRight ||
<       sample[1] < film->GetImage()->SampleCropBottom ||
<       sample[1] > film->GetImage()->SampleCropTop)
<     return false;
<   Point Pcamera = RasterToCamera(Point(sample[0], sample[1], 0));
<   ray = Ray(Point(0, 0, 0), Vector(Pcamera.x, Pcamera.y, Pcamera.z));
<   ray.D *= invClipHither;
<   ray = CameraToWorld(ray);
<   return true;     
<   
---
>         return false;
Binary files ./mbdofcamera.o and ../lrt2/lrt/mbdofcamera.o differ
Only in .: pmap.cc
Only in .: pmap.h
Only in .: pmap.o
Binary files ./primitives.o and ../lrt2/lrt/primitives.o differ
Binary files ./sampling.o and ../lrt2/lrt/sampling.o differ
diff ./scene.cc ../lrt2/lrt/scene.cc
8,9d7
< #include "reflection.h"
< 
31,35d28
< 
< 	//NEW STUFF
< 	SetPhotonCounts(50000);
< 	pmap = new PhotonMap(nPhotons+1);
< 	//END NEW STUFF
40,49d32
< 
< 
< 	//NEW STUFF
< 	EmitPhotons();
< 	pmap->BuildTree();
< 
< 	//END NEW STUFF
< 
< 
< 
61,75c44,48
< 		Spectrum L(0.);
< 		Spectrum S;
< 		Surf s;
< 		if (Intersect(ray,&s)) {
< 
< 		  	float ir[3];
< 		  	pmap->GetIrradiance(ir,s.dgGeom.P,0.1f,5000);
< 		  	L = Spectrum(ir[0],ir[1],ir[2]);
< 		  	printf("\nHit %f %f %f %f %f %f",s.dgGeom.P.x,s.dgGeom.P.y,s.dgGeom.P.z,ir[0],ir[1],ir[2]);
< 			//L = integrator->L(this, ray, &alpha);
< 
< 
< 
< 		} else {
< 		  L = Spectrum(0);
---
> 		Spectrum L = integrator->L(this, ray, &alpha);
> 		Float screenz = camera->WorldToScreen(ray(ray.maxt)).z;
> 		if (screenz > 1.) {
> 			L = 0.;
> 			alpha = 0.;
77,86c50,54
< 		  Float screenz = camera->WorldToScreen(ray(ray.maxt)).z;
< 		  if (screenz > 1.) {
< 		    L = 0.;
< 		    alpha = 0.;
< 		  }
< 		  Point Praster(sample[0], sample[1], screenz);
< 		  image->AddSample(Praster, L, alpha);
< 		}
< 		image->Write();
< 		cerr << endl;
---
> 		Point Praster(sample[0], sample[1], screenz);
> 		image->AddSample(Praster, L, alpha);
> 	}
> 	image->Write();
> 	cerr << endl;
88,89d55
< 
< 
93,117d58
< 
< 
< 
< void Scene::SetPhotonCounts(int total)
< {
<   nPhotons = total;
<   float totalint=0.f,localint=0.f;
<   int localphotons;
<   int i;
<   for (i=0;i<(int)lights.size();i++) {
<     totalint+=lights[i]->GetIntensity();
<   }
<   for (i=0;i<(int)lights.size();i++) {
<     localint = lights[i]->GetIntensity();
<     localphotons = (localint/totalint)*total;
<     lights[i]->SetPhotonCount(localphotons);
<   }
< }
< 
< void Scene::EmitPhotons()
< {
<   for (int i=0;i<(int)lights.size();i++) {
<     lights[i]->EmitPhotons(this);
<   }
< }
diff ./scene.h ../lrt2/lrt/scene.h
4,5d3
< #include "light.h"
< #include "pmap.h"
13,23d10
< 	
< 	//NEW STUFF
< 	void SetPhotonCounts(int nTotalPhotons);
< 	int GetPhotonCount() { return nPhotons;}
< 	void EmitPhotons();
< 	
< 	PhotonMap *pmap;
< 	int nPhotons;
< 	//END NEW STUFF
< 
< 
Binary files ./scene.o and ../lrt2/lrt/scene.o differ
Only in .: teapot.rib~
Binary files ./teapot.tiff and ../lrt2/lrt/teapot.tiff differ
diff ./transport.cc ../lrt2/lrt/transport.cc
36d35
< 
Binary files ./transport.o and ../lrt2/lrt/transport.o differ
