Added define to skip photon file saving.

This commit is contained in:
2017-07-13 09:43:50 -04:00
parent c97a2d4fe3
commit 783e5daaea
2 changed files with 3 additions and 1 deletions

View File

@@ -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 \
photonmap.o
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
.PHONY: all

View File

@@ -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;
//m_photon_map.save_photon_list(specular ? "caustics.txt" : "photons.txt");
#ifdef SAVE_FILES
string file_name = specular ? "caustics.txt" : "photons.txt";
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;
}
ofs.close();
#endif
}
void PhotonTracer::build_photon_map(const char * photons_file, const bool caustics) {