Added define to skip photon file saving.
This commit is contained in:
2
Makefile
2
Makefile
@@ -7,7 +7,7 @@ OBJECTS = main.o sampling.o camera.o environment.o disk.o plane.o sphere.o \
|
|||||||
path_tracer.o whitted_tracer.o rgbe.o kd_tree.o photon_tracer.o \
|
path_tracer.o whitted_tracer.o rgbe.o kd_tree.o photon_tracer.o \
|
||||||
photonmap.o
|
photonmap.o
|
||||||
DEPENDS = $(OBJECTS:.o=.d)
|
DEPENDS = $(OBJECTS:.o=.d)
|
||||||
CXXFLAGS = -std=c++11 -pedantic -Wall -DGLM_FORCE_RADIANS -fopenmp -DUSE_CPP11_RANDOM -fno-builtin #-DENABLE_KD_TREE
|
CXXFLAGS = -std=c++11 -pedantic -Wall -DGLM_FORCE_RADIANS -fopenmp -DUSE_CPP11_RANDOM -fno-builtin #-DENABLE_KD_TREE -DSAVE_FILES
|
||||||
LDLIBS = -lfreeimage -ljson_spirit
|
LDLIBS = -lfreeimage -ljson_spirit
|
||||||
|
|
||||||
.PHONY: all
|
.PHONY: all
|
||||||
|
@@ -326,6 +326,7 @@ void PhotonTracer::photon_tracing(Scene * s, const size_t n_photons_per_ligth, c
|
|||||||
cout << "Generated " << ANSI_BOLD_YELLOW << m_photon_map.stored_photons << ANSI_RESET_STYLE << " total photons." << endl;
|
cout << "Generated " << ANSI_BOLD_YELLOW << m_photon_map.stored_photons << ANSI_RESET_STYLE << " total photons." << endl;
|
||||||
//m_photon_map.save_photon_list(specular ? "caustics.txt" : "photons.txt");
|
//m_photon_map.save_photon_list(specular ? "caustics.txt" : "photons.txt");
|
||||||
|
|
||||||
|
#ifdef SAVE_FILES
|
||||||
string file_name = specular ? "caustics.txt" : "photons.txt";
|
string file_name = specular ? "caustics.txt" : "photons.txt";
|
||||||
|
|
||||||
cout << "Writing photons to \x1b[1;33m" << file_name << "\x1b[m" << endl;
|
cout << "Writing photons to \x1b[1;33m" << file_name << "\x1b[m" << endl;
|
||||||
@@ -340,6 +341,7 @@ void PhotonTracer::photon_tracing(Scene * s, const size_t n_photons_per_ligth, c
|
|||||||
r << " " << g << " " << b << " " << m_photon_map.photons[i].ref_index << endl;
|
r << " " << g << " " << b << " " << m_photon_map.photons[i].ref_index << endl;
|
||||||
}
|
}
|
||||||
ofs.close();
|
ofs.close();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void PhotonTracer::build_photon_map(const char * photons_file, const bool caustics) {
|
void PhotonTracer::build_photon_map(const char * photons_file, const bool caustics) {
|
||||||
|
Reference in New Issue
Block a user