File: motion_blur_geometry.cpp

package info (click to toggle)
embree 4.3.3%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 100,656 kB
  • sloc: cpp: 228,918; xml: 40,944; ansic: 2,685; python: 812; sh: 635; makefile: 228; csh: 42
file content (54 lines) | stat: -rw-r--r-- 1,778 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0

#include "../common/tutorial/tutorial.h"
#include "../common/tutorial/benchmark_render.h"

#if defined(EMBREE_SYCL_TUTORIAL)
#  define NAME "motion_blur_geometry_sycl"
#  define FEATURES FEATURE_RTCORE | FEATURE_SYCL
#else
#  define NAME "motion_blur_geometry"
#  define FEATURES FEATURE_RTCORE
#endif

namespace embree
{
  extern "C" {
    float g_time = -1.0f;
    unsigned g_num_time_steps = 8;
    unsigned g_num_time_steps2 = 30;
  }

  struct Tutorial : public TutorialApplication 
  {
    Tutorial()
      : TutorialApplication(NAME,FEATURES) 
    {
      registerOption("time", [] (Ref<ParseStream> cin, const FileName& path) {
        g_time = cin->getFloat();
      }, "--time <float>: time to render image at");

      registerOption("time-steps", [] (Ref<ParseStream> cin, const FileName& path) {
        g_num_time_steps = cin->getInt();
        if (g_num_time_steps < 2) throw std::runtime_error("at least 2 time steps have to be used");
      }, "--time-steps <int>: number of time steps to use");

      registerOption("time-steps2", [] (Ref<ParseStream> cin, const FileName& path) {
        g_num_time_steps2 = cin->getInt();
        if (g_num_time_steps2 < 2) throw std::runtime_error("at least 2 time steps have to be used");
      }, "--time-steps2 <int>: number of time steps to use");
    
      /* set default camera */
      camera.from = Vec3fa(8,13,2.5);
      camera.to   = Vec3fa(0,0,2.5);
    }
  };
}

int main(int argc, char** argv) {
  if (embree::TutorialBenchmark::benchmark(argc, argv)) {
    return embree::TutorialBenchmark(embree::renderBenchFunc<embree::Tutorial>).main(argc, argv, "motion_blur_geometry");
  }
  return embree::Tutorial().main(argc,argv);
}