Skip to content

Commit

Permalink
Fix windows error (#63)
Browse files Browse the repository at this point in the history
* Add write to file define

* reduce number of reflection tests
  • Loading branch information
tobre1 authored Feb 5, 2025
1 parent cee1fc3 commit 818fc90
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/reflection/reflection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@

#include <fstream>

// #define VR_WRITE_TO_FILE

using namespace viennaray;

int main() {

using NumericType = double;
constexpr int N = 50000;
constexpr int N = 5000;
RNG rngState(12351263);
Timer timer;

Expand All @@ -28,11 +30,13 @@ int main() {
<< " diffuse reflections: " << timer.currentDuration * 1e-6
<< " ms" << std::endl;

#ifdef VR_WRITE_TO_FILE
std::ofstream file("diffuse_reflection.txt");
for (auto const &dir : directions) {
file << dir[0] << " " << dir[1] << " " << dir[2] << std::endl;
}
file.close();
#endif
}

Vec3D<NumericType> normal = {0.0, 0.0, 1.0};
Expand Down Expand Up @@ -61,11 +65,13 @@ int main() {
<< " coned specular reflections: " << timer.currentDuration * 1e-6
<< " ms" << std::endl;

#ifdef VR_WRITE_TO_FILE
std::ofstream file("coned_specular_reflection.txt");
for (auto const &dir : directions) {
file << dir[0] << " " << dir[1] << " " << dir[2] << std::endl;
}
file.close();
#endif
}

{
Expand All @@ -82,11 +88,13 @@ int main() {
std::cout << "Time for " << N << " coned specular reflections (old): "
<< timer.currentDuration * 1e-6 << " ms" << std::endl;

#ifdef VR_WRITE_TO_FILE
std::ofstream file("coned_specular_reflection_old.txt");
for (auto const &dir : directions) {
file << dir[0] << " " << dir[1] << " " << dir[2] << std::endl;
}
file.close();
#endif
}

return 0;
Expand Down

0 comments on commit 818fc90

Please sign in to comment.