From 783e5daaea8b6eba6318da945d1563043917ddfb Mon Sep 17 00:00:00 2001 From: Miguel Angel Astor Romero Date: Thu, 13 Jul 2017 09:43:50 -0400 Subject: [PATCH] Added define to skip photon file saving. --- Makefile | 2 +- photon_tracer.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b6dd867..124fe9b 100644 --- a/Makefile +++ b/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 \ 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 diff --git a/photon_tracer.cpp b/photon_tracer.cpp index 65cbd34..f3f32ad 100644 --- a/photon_tracer.cpp +++ b/photon_tracer.cpp @@ -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) {