src/raytracermodule.cc
branchpyrit
changeset 47 320d5d466864
parent 44 3763b26244f0
child 48 a4913301c626
equal deleted inserted replaced
46:6493fb65f0b1 47:320d5d466864
   620 		return NULL;
   620 		return NULL;
   621 
   621 
   622 	printf("[pyrit] Running ray tracer\n");
   622 	printf("[pyrit] Running ray tracer\n");
   623 	((RaytracerObject *)self)->raytracer->getTop()->optimize();
   623 	((RaytracerObject *)self)->raytracer->getTop()->optimize();
   624 	data = (Float *) malloc(w*h*3*sizeof(Float));
   624 	data = (Float *) malloc(w*h*3*sizeof(Float));
   625 	((RaytracerObject *)self)->raytracer->render(w, h, data);
   625 	DefaultSampler sampler(data, w, h);
       
   626 	((RaytracerObject *)self)->raytracer->setSampler(&sampler);
       
   627 	((RaytracerObject *)self)->raytracer->render();
   626 	if (!data) {
   628 	if (!data) {
   627 		Py_INCREF(Py_None);
   629 		Py_INCREF(Py_None);
   628 		return Py_None;
   630 		return Py_None;
   629 	}
   631 	}
   630 
   632