├── .gitattributes ├── .gitignore ├── CHANGELOG.md ├── CMakeLists.txt ├── CTestConfig.cmake ├── LICENSE.txt ├── README.md ├── common ├── CMakeLists.txt ├── algorithms │ ├── CMakeLists.txt │ ├── parallel_for.cpp │ ├── parallel_for.h │ ├── parallel_for_for.cpp │ ├── parallel_for_for.h │ ├── parallel_for_for_prefix_sum.cpp │ ├── parallel_for_for_prefix_sum.h │ ├── parallel_map.cpp │ ├── parallel_map.h │ ├── parallel_partition.cpp │ ├── parallel_partition.h │ ├── parallel_prefix_sum.cpp │ ├── parallel_prefix_sum.h │ ├── parallel_reduce.cpp │ ├── parallel_reduce.h │ ├── parallel_set.cpp │ ├── parallel_set.h │ ├── parallel_sort.cpp │ └── parallel_sort.h ├── cmake │ ├── FindPNG.cmake │ ├── FindTBB.cmake │ ├── basictutorial.cmake │ ├── clang.cmake │ ├── create_isa_dummy_file.cmake │ ├── embree-config-default.cmake │ ├── embree-config-linux.cmake │ ├── embree-config-macosx.cmake │ ├── embree-config-version.cmake │ ├── embree-config-windows.cmake │ ├── gcc.cmake │ ├── icc.cmake │ ├── ispc.cmake │ ├── msvc.cmake │ ├── package.cmake │ ├── rpm_ldconfig.sh │ ├── test.cmake │ ├── tutorial.cmake │ └── uninstall.cmake.in ├── lexers │ ├── CMakeLists.txt │ ├── parsestream.h │ ├── stream.h │ ├── streamfilters.h │ ├── stringstream.cpp │ ├── stringstream.h │ ├── tokenstream.cpp │ └── tokenstream.h ├── math │ ├── SSE2NEON.h │ ├── affinespace.h │ ├── bbox.h │ ├── col3.h │ ├── col4.h │ ├── color.h │ ├── constants.h │ ├── lbbox.h │ ├── linearspace2.h │ ├── linearspace3.h │ ├── math.h │ ├── obbox.h │ ├── quaternion.h │ ├── range.h │ ├── vec2.h │ ├── vec3.h │ ├── vec3ba.h │ ├── vec3fa.h │ ├── vec3ia.h │ └── vec4.h ├── simd │ ├── CMakeLists.txt │ ├── avx.h │ ├── avx512.h │ ├── simd.h │ ├── sse.cpp │ ├── sse.h │ ├── varying.h │ ├── vboold4_avx.h │ ├── vboold4_avx512.h │ ├── vboold8_avx512.h │ ├── vboolf16_avx512.h │ ├── vboolf4_avx512.h │ ├── vboolf4_sse2.h │ ├── vboolf8_avx.h │ ├── vboolf8_avx512.h │ ├── vdouble4_avx.h │ ├── vdouble8_avx512.h │ ├── vfloat16_avx512.h │ ├── vfloat4_sse2.h │ ├── vfloat8_avx.h │ ├── vint16_avx512.h │ ├── vint4_sse2.h │ ├── vint8_avx.h │ ├── vint8_avx2.h │ ├── vlong4_avx2.h │ ├── vlong8_avx512.h │ └── vuint16_avx512.h ├── sys │ ├── CMakeLists.txt │ ├── SSE2NEON.h │ ├── alloc.cpp │ ├── alloc.h │ ├── array.h │ ├── atomic.h │ ├── barrier.cpp │ ├── barrier.h │ ├── condition.cpp │ ├── condition.h │ ├── filename.cpp │ ├── filename.h │ ├── intrinsics.h │ ├── library.cpp │ ├── library.h │ ├── mutex.cpp │ ├── mutex.h │ ├── network.cpp │ ├── network.h │ ├── platform.h │ ├── ref.h │ ├── regression.cpp │ ├── regression.h │ ├── string.cpp │ ├── string.h │ ├── sysinfo.cpp │ ├── sysinfo.h │ ├── thread.cpp │ ├── thread.h │ ├── vector.h │ └── vector_t.h └── tasking │ ├── CMakeLists.txt │ ├── taskscheduler.h │ ├── taskschedulerinternal.cpp │ ├── taskschedulerinternal.h │ ├── taskschedulerppl.cpp │ ├── taskschedulerppl.h │ ├── taskschedulertbb.cpp │ └── taskschedulertbb.h ├── include └── embree2 │ ├── rtcore.h │ ├── rtcore.isph │ ├── rtcore_geometry.h │ ├── rtcore_geometry.isph │ ├── rtcore_geometry_user.h │ ├── rtcore_geometry_user.isph │ ├── rtcore_ray.h │ ├── rtcore_ray.isph │ ├── rtcore_scene.h │ └── rtcore_scene.isph ├── kernels ├── CMakeLists.txt ├── builders │ ├── bvh_builder_morton.h │ ├── bvh_builder_sah.h │ ├── heuristic_binning.h │ ├── heuristic_binning_array_aligned.h │ ├── heuristic_binning_array_unaligned.h │ ├── heuristic_spatial.h │ ├── heuristic_spatial_array.h │ ├── heuristic_strand_array.h │ ├── heuristic_sweep_array_aligned.h │ ├── presplit.h │ ├── priminfo.h │ ├── primrefgen.cpp │ ├── primrefgen.h │ └── splitter.h ├── bvh │ ├── bvh.cpp │ ├── bvh.h │ ├── bvh4_factory.cpp │ ├── bvh4_factory.h │ ├── bvh8_factory.cpp │ ├── bvh8_factory.h │ ├── bvh_builder.cpp │ ├── bvh_builder.h │ ├── bvh_builder_hair.cpp │ ├── bvh_builder_hair.h │ ├── bvh_builder_instancing.cpp │ ├── bvh_builder_instancing.h │ ├── bvh_builder_morton.cpp │ ├── bvh_builder_sah.cpp │ ├── bvh_builder_subdiv.cpp │ ├── bvh_builder_twolevel.cpp │ ├── bvh_builder_twolevel.h │ ├── bvh_intersector1.cpp │ ├── bvh_intersector1.h │ ├── bvh_intersector_hybrid.cpp │ ├── bvh_intersector_hybrid.h │ ├── bvh_intersector_hybrid_bvh4.cpp │ ├── bvh_intersector_hybrid_bvh8.cpp │ ├── bvh_intersector_node.h │ ├── bvh_intersector_single.cpp │ ├── bvh_intersector_single.h │ ├── bvh_intersector_stream.cpp │ ├── bvh_intersector_stream.h │ ├── bvh_intersector_stream_filters.cpp │ ├── bvh_intersector_stream_filters.h │ ├── bvh_refit.cpp │ ├── bvh_refit.h │ ├── bvh_rotate.cpp │ ├── bvh_rotate.h │ ├── bvh_statistics.cpp │ ├── bvh_statistics.h │ └── bvh_traverser1.h ├── common │ ├── accel.cpp │ ├── accel.h │ ├── accelinstance.h │ ├── acceln.cpp │ ├── acceln.h │ ├── accelset.cpp │ ├── accelset.h │ ├── alloc.cpp │ ├── alloc.h │ ├── buffer.cpp │ ├── buffer.h │ ├── builder.h │ ├── context.h │ ├── default.h │ ├── device.cpp │ ├── device.h │ ├── geometry.cpp │ ├── geometry.h │ ├── hit.h │ ├── isa.h │ ├── primref.h │ ├── profile.h │ ├── ray.h │ ├── rtcore.cpp │ ├── rtcore.h │ ├── rtcore_ispc.cpp │ ├── rtcore_ispc.ispc │ ├── scene.cpp │ ├── scene.h │ ├── scene_bezier_curves.cpp │ ├── scene_bezier_curves.h │ ├── scene_geometry_instance.cpp │ ├── scene_geometry_instance.h │ ├── scene_instance.cpp │ ├── scene_instance.h │ ├── scene_line_segments.cpp │ ├── scene_line_segments.h │ ├── scene_quad_mesh.cpp │ ├── scene_quad_mesh.h │ ├── scene_subdiv_mesh.cpp │ ├── scene_subdiv_mesh.h │ ├── scene_subdiv_mesh_avx.cpp │ ├── scene_triangle_mesh.cpp │ ├── scene_triangle_mesh.h │ ├── scene_user_geometry.cpp │ ├── scene_user_geometry.h │ ├── stack_item.h │ ├── stat.cpp │ ├── stat.h │ ├── state.cpp │ ├── state.h │ ├── tasksys.cpp │ └── vector.h ├── config.h.in ├── embree.rc ├── export.linux.map ├── export.macosx.map ├── geometry │ ├── bezier1i.h │ ├── bezier1i_intersector.h │ ├── bezier1v.h │ ├── bezier1v_intersector.h │ ├── bezier_geometry_intersector.h │ ├── bezier_intersector.h │ ├── cone.h │ ├── cylinder.h │ ├── fillcone.h │ ├── filter.h │ ├── grid_soa.cpp │ ├── grid_soa.h │ ├── grid_soa_intersector.h │ ├── grid_soa_intersector1.h │ ├── instance_intersector.cpp │ ├── instance_intersector.h │ ├── instance_intersector1.cpp │ ├── instance_intersector1.h │ ├── intersector_epilog.h │ ├── intersector_iterators.h │ ├── line_intersector.h │ ├── linei.h │ ├── linei_intersector.h │ ├── object.h │ ├── object_intersector.h │ ├── plane.h │ ├── primitive.cpp │ ├── primitive.h │ ├── quad_intersector_moeller.h │ ├── quad_intersector_pluecker.h │ ├── quadi.h │ ├── quadi_intersector.h │ ├── quadi_mb.h │ ├── quadi_mb_intersector.h │ ├── quadv.h │ ├── quadv_intersector.h │ ├── subdivpatch1cached.h │ ├── subdivpatch1cached_intersector.h │ ├── subdivpatch1eager_intersector.h │ ├── triangle.h │ ├── triangle_intersector.h │ ├── triangle_intersector_moeller.h │ ├── triangle_intersector_pluecker.h │ ├── trianglei.h │ ├── trianglei_intersector.h │ ├── trianglei_mb.h │ ├── trianglei_mb_intersector.h │ ├── trianglev.h │ ├── trianglev_intersector.h │ ├── trianglev_mb.h │ └── trianglev_mb_intersector.h ├── subdiv │ ├── bezier_curve.cpp │ ├── bezier_curve.h │ ├── bezier_patch.h │ ├── bilinear_patch.h │ ├── bspline_patch.h │ ├── catmullclark_coefficients.cpp │ ├── catmullclark_coefficients.h │ ├── catmullclark_patch.h │ ├── catmullclark_ring.h │ ├── feature_adaptive_eval.h │ ├── feature_adaptive_eval_grid.h │ ├── feature_adaptive_eval_simd.h │ ├── gregory_patch.h │ ├── gregory_patch_dense.h │ ├── gridrange.h │ ├── half_edge.h │ ├── patch.h │ ├── patch_eval.h │ ├── patch_eval_grid.h │ ├── patch_eval_simd.h │ ├── subdivpatch1base.cpp │ ├── subdivpatch1base.h │ ├── subdivpatch1base_eval.cpp │ ├── tessellation.h │ ├── tessellation_cache.cpp │ └── tessellation_cache.h └── version.h.in ├── readme.pdf ├── scripts ├── benchmark.py ├── install_linux │ ├── embree-vars.csh │ └── embree-vars.sh ├── install_linux_gcc.sh ├── install_macosx │ ├── embree-vars.csh │ ├── embree-vars.sh │ └── uninstall.command ├── install_windows │ └── icon32.ico ├── invoke_test.py ├── package_linux.sh ├── package_macosx.sh ├── package_win.bat ├── regression.py ├── release_linux.sh ├── release_macosx.sh └── release_win.bat └── tutorials ├── CMakeLists.txt ├── Makefile ├── buildbench ├── CMakeLists.txt ├── buildbench.cpp └── buildbench_device.cpp ├── bvh_access ├── CMakeLists.txt └── bvh_access.cpp ├── bvh_builder ├── CMakeLists.txt ├── bvh_builder.cpp └── bvh_builder_device.cpp ├── common ├── CMakeLists.txt ├── common.isph ├── core │ ├── differential_geometry.h │ ├── differential_geometry.isph │ ├── ray.h │ └── ray.isph ├── default.h ├── freeglut │ ├── LICENSE.txt │ ├── Win32 │ │ ├── freeglut.dll │ │ └── freeglut.lib │ ├── include │ │ └── GL │ │ │ ├── freeglut.h │ │ │ ├── freeglut_ext.h │ │ │ ├── freeglut_std.h │ │ │ ├── glext.h │ │ │ ├── glut.h │ │ │ ├── glxext.h │ │ │ └── wglext.h │ └── x64 │ │ ├── freeglut.dll │ │ └── freeglut.lib ├── image │ ├── CMakeLists.txt │ ├── LICENSE-ImageMagick.txt │ ├── LICENSE-libjpeg.txt │ ├── LICENSE-libpng.txt │ ├── image.cpp │ ├── image.h │ ├── jpeg.cpp │ ├── magick.cpp │ ├── pfm.cpp │ ├── png.cpp │ ├── ppm.cpp │ └── tga.cpp ├── lights │ ├── CMakeLists.txt │ ├── ambient_light.cpp │ ├── ambient_light.h │ ├── ambient_light.ispc │ ├── directional_light.cpp │ ├── directional_light.h │ ├── directional_light.ispc │ ├── light.cpp │ ├── light.h │ ├── light.ispc │ ├── light.isph │ ├── point_light.cpp │ ├── point_light.h │ ├── point_light.ispc │ ├── quad_light.cpp │ ├── quad_light.h │ ├── quad_light.ispc │ ├── spot_light.cpp │ ├── spot_light.h │ └── spot_light.ispc ├── math │ ├── affinespace.h │ ├── affinespace.isph │ ├── linearspace.h │ ├── linearspace.isph │ ├── math.h │ ├── math.isph │ ├── random_sampler.h │ ├── random_sampler.isph │ ├── sampling.h │ ├── sampling.isph │ ├── vec.h │ └── vec.isph ├── scenegraph │ ├── CMakeLists.txt │ ├── corona_loader.cpp │ ├── corona_loader.h │ ├── hair_loader.cpp │ ├── hair_loader.h │ ├── lights.h │ ├── materials.h │ ├── obj_loader.cpp │ ├── obj_loader.h │ ├── ply_loader.cpp │ ├── ply_loader.h │ ├── scenegraph.cpp │ ├── scenegraph.h │ ├── texture.cpp │ ├── texture.h │ ├── xml_loader.cpp │ ├── xml_loader.h │ ├── xml_parser.cpp │ ├── xml_parser.h │ ├── xml_writer.cpp │ └── xml_writer.h ├── texture │ ├── CMakeLists.txt │ ├── texture.h │ ├── texture2d.cpp │ ├── texture2d.h │ ├── texture2d.ispc │ ├── texture2d.isph │ ├── texture_param.h │ └── texture_param.isph └── tutorial │ ├── CMakeLists.txt │ ├── application.cpp │ ├── application.h │ ├── camera.h │ ├── camera.isph │ ├── noise.cpp │ ├── noise.h │ ├── noise.ispc │ ├── noise.isph │ ├── optics.h │ ├── optics.isph │ ├── scene.cpp │ ├── scene.h │ ├── scene_device.h │ ├── scene_device.isph │ ├── statistics.h │ ├── tutorial.cpp │ ├── tutorial.h │ ├── tutorial_device.cpp │ ├── tutorial_device.h │ ├── tutorial_device.ispc │ └── tutorial_device.isph ├── convert ├── CMakeLists.txt ├── convert.cpp ├── default.h ├── distribution1d.cpp ├── distribution1d.h ├── distribution2d.cpp └── distribution2d.h ├── curve_geometry ├── CMakeLists.txt ├── curve_geometry.cpp ├── curve_geometry_device.cpp └── curve_geometry_device.ispc ├── displacement_geometry ├── CMakeLists.txt ├── displacement_geometry.cpp ├── displacement_geometry_device.cpp └── displacement_geometry_device.ispc ├── dynamic_scene ├── CMakeLists.txt ├── dynamic_scene.cpp ├── dynamic_scene_device.cpp └── dynamic_scene_device.ispc ├── find_embree ├── CMakeLists.txt ├── find_embree.cpp ├── find_embree_ispc.cpp └── find_embree_ispc.ispc ├── hair_geometry ├── CMakeLists.txt ├── hair_geometry.cpp ├── hair_geometry_device.cpp └── hair_geometry_device.ispc ├── instanced_geometry ├── CMakeLists.txt ├── instanced_geometry.cpp ├── instanced_geometry_device.cpp └── instanced_geometry_device.ispc ├── interpolation ├── CMakeLists.txt ├── interpolation.cpp ├── interpolation_device.cpp └── interpolation_device.ispc ├── intersection_filter ├── CMakeLists.txt ├── intersection_filter.cpp ├── intersection_filter_device.cpp └── intersection_filter_device.ispc ├── ispc2cpp.sh ├── lazy_geometry ├── CMakeLists.txt ├── lazy_geometry.cpp ├── lazy_geometry_device.cpp └── lazy_geometry_device.ispc ├── models ├── cornell_box.ecs ├── cornell_box.mtl ├── cornell_box.obj ├── curve0.xml ├── curve1.xml ├── linesegments.ecs ├── linesegments.xml ├── subdiv0.xml ├── subdiv1.xml ├── subdiv2.xml ├── subdiv3.xml ├── subdiv4.xml ├── subdiv5.xml ├── subdiv6.xml ├── subdiv7.xml ├── subdiv8.xml └── subdiv9.xml ├── motion_blur_geometry ├── CMakeLists.txt ├── motion_blur_geometry.cpp ├── motion_blur_geometry_device.cpp └── motion_blur_geometry_device.ispc ├── osp2emb.sh ├── pathtracer ├── CMakeLists.txt ├── pathtracer.cpp ├── pathtracer_device.cpp └── pathtracer_device.ispc ├── subdivision_geometry ├── CMakeLists.txt ├── subdivision_geometry.cpp ├── subdivision_geometry_device.cpp └── subdivision_geometry_device.ispc ├── triangle_geometry ├── CMakeLists.txt ├── triangle_geometry.cpp ├── triangle_geometry_device.cpp └── triangle_geometry_device.ispc ├── user_geometry ├── CMakeLists.txt ├── user_geometry.cpp ├── user_geometry_device.cpp └── user_geometry_device.ispc ├── verify ├── CMakeLists.txt ├── rtcore_helpers.h ├── verify.cpp └── verify.h ├── viewer ├── CMakeLists.txt ├── viewer.cpp ├── viewer_device.cpp └── viewer_device.ispc └── viewer_stream ├── CMakeLists.txt ├── viewer_stream.cpp ├── viewer_stream_device.cpp └── viewer_stream_device.ispc /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | 3 | *.txt text 4 | *.ivl text 5 | *.ispc text 6 | *.cpp text 7 | *.h text 8 | *.cc text 9 | *.cxx text 10 | *.c text 11 | *.jpg binary 12 | *.png binary 13 | *.pdf binary 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.user 2 | Win32 3 | x64 4 | *.suo 5 | *.ncb 6 | .*sw? 7 | .DS_Store 8 | -------------------------------------------------------------------------------- /CTestConfig.cmake: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2016 Intel Corporation ## 3 | ## ## 4 | ## Licensed under the Apache License, Version 2.0 (the "License"); ## 5 | ## you may not use this file except in compliance with the License. ## 6 | ## You may obtain a copy of the License at ## 7 | ## ## 8 | ## http://www.apache.org/licenses/LICENSE-2.0 ## 9 | ## ## 10 | ## Unless required by applicable law or agreed to in writing, software ## 11 | ## distributed under the License is distributed on an "AS IS" BASIS, ## 12 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ## 13 | ## See the License for the specific language governing permissions and ## 14 | ## limitations under the License. ## 15 | ## ======================================================================== ## 16 | 17 | set(CTEST_PROJECT_NAME "Embree") 18 | set(CTEST_NIGHTLY_START_TIME "22:00:00 UTC") 19 | set(TEST_MODELS_HASH 99ec031b11b08afec271357e4cb9326cf8ac9942) 20 | 21 | IF (NOT CTEST_DROP_SITE) 22 | set(CTEST_DROP_METHOD "http") 23 | set(CTEST_DROP_SITE "cdash") 24 | set(CTEST_DROP_LOCATION "/CDash/submit.php?project=Embree") 25 | set(CTEST_DROP_SITE_CDASH TRUE) 26 | endif() 27 | 28 | list (APPEND CTEST_CUSTOM_WARNING_EXCEPTION "warning #1478") # deprecated function used 29 | list (APPEND CTEST_CUSTOM_WARNING_EXCEPTION "warning #10237") # -lcilkrts linked in dynamically, static library not available") 30 | list (APPEND CTEST_CUSTOM_WARNING_EXCEPTION "-Wextern-initializer") 31 | -------------------------------------------------------------------------------- /common/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2016 Intel Corporation ## 3 | ## ## 4 | ## Licensed under the Apache License, Version 2.0 (the "License"); ## 5 | ## you may not use this file except in compliance with the License. ## 6 | ## You may obtain a copy of the License at ## 7 | ## ## 8 | ## http://www.apache.org/licenses/LICENSE-2.0 ## 9 | ## ## 10 | ## Unless required by applicable law or agreed to in writing, software ## 11 | ## distributed under the License is distributed on an "AS IS" BASIS, ## 12 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ## 13 | ## See the License for the specific language governing permissions and ## 14 | ## limitations under the License. ## 15 | ## ======================================================================== ## 16 | 17 | ADD_SUBDIRECTORY(sys) 18 | ADD_SUBDIRECTORY(simd) 19 | ADD_SUBDIRECTORY(lexers) 20 | ADD_SUBDIRECTORY(tasking) 21 | ADD_SUBDIRECTORY(algorithms) 22 | -------------------------------------------------------------------------------- /common/algorithms/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2016 Intel Corporation ## 3 | ## ## 4 | ## Licensed under the Apache License, Version 2.0 (the "License"); ## 5 | ## you may not use this file except in compliance with the License. ## 6 | ## You may obtain a copy of the License at ## 7 | ## ## 8 | ## http://www.apache.org/licenses/LICENSE-2.0 ## 9 | ## ## 10 | ## Unless required by applicable law or agreed to in writing, software ## 11 | ## distributed under the License is distributed on an "AS IS" BASIS, ## 12 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ## 13 | ## See the License for the specific language governing permissions and ## 14 | ## limitations under the License. ## 15 | ## ======================================================================== ## 16 | 17 | ADD_LIBRARY(algorithms OBJECT 18 | parallel_for.cpp 19 | parallel_reduce.cpp 20 | parallel_prefix_sum.cpp 21 | parallel_for_for.cpp 22 | parallel_for_for_prefix_sum.cpp 23 | parallel_partition.cpp 24 | parallel_sort.cpp 25 | parallel_set.cpp 26 | parallel_map.cpp 27 | ) 28 | 29 | SET_PROPERTY(TARGET algorithms PROPERTY FOLDER common) 30 | 31 | 32 | -------------------------------------------------------------------------------- /common/cmake/FindPNG.cmake: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2016 Intel Corporation ## 3 | ## ## 4 | ## Licensed under the Apache License, Version 2.0 (the "License"); ## 5 | ## you may not use this file except in compliance with the License. ## 6 | ## You may obtain a copy of the License at ## 7 | ## ## 8 | ## http://www.apache.org/licenses/LICENSE-2.0 ## 9 | ## ## 10 | ## Unless required by applicable law or agreed to in writing, software ## 11 | ## distributed under the License is distributed on an "AS IS" BASIS, ## 12 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ## 13 | ## See the License for the specific language governing permissions and ## 14 | ## limitations under the License. ## 15 | ## ======================================================================== ## 16 | 17 | FIND_PATH( PNG_INCLUDE_DIR NAMES png.h ) 18 | FIND_LIBRARY( PNG_LIBRARIES NAMES png ) 19 | 20 | INCLUDE(FindPackageHandleStandardArgs) 21 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(PNG DEFAULT_MSG PNG_INCLUDE_DIR PNG_LIBRARIES) 22 | 23 | MARK_AS_ADVANCED(PNG_INCLUDE_DIR) 24 | MARK_AS_ADVANCED(PNG_LIBRARIES) 25 | -------------------------------------------------------------------------------- /common/cmake/basictutorial.cmake: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2016 Intel Corporation ## 3 | ## ## 4 | ## Licensed under the Apache License, Version 2.0 (the "License"); ## 5 | ## you may not use this file except in compliance with the License. ## 6 | ## You may obtain a copy of the License at ## 7 | ## ## 8 | ## http://www.apache.org/licenses/LICENSE-2.0 ## 9 | ## ## 10 | ## Unless required by applicable law or agreed to in writing, software ## 11 | ## distributed under the License is distributed on an "AS IS" BASIS, ## 12 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ## 13 | ## See the License for the specific language governing permissions and ## 14 | ## limitations under the License. ## 15 | ## ======================================================================== ## 16 | 17 | # additional parameters (beyond the name) are treated as additional dependencies 18 | # if ADDITIONAL_LIBRARIES is set these will be included during linking 19 | 20 | MACRO (ADD_TUTORIAL TUTORIAL_NAME) 21 | 22 | ADD_EXECUTABLE(${TUTORIAL_NAME} ${TUTORIAL_NAME}.cpp ${TUTORIAL_NAME}_device.cpp ${ARGN}) 23 | TARGET_LINK_LIBRARIES(${TUTORIAL_NAME} embree tutorial image tutorial_device noise ${ADDITIONAL_LIBRARIES}) 24 | SET_PROPERTY(TARGET ${TUTORIAL_NAME} PROPERTY FOLDER tutorials/single) 25 | INSTALL(TARGETS ${TUTORIAL_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT examples) 26 | SET(CPACK_NSIS_MENU_LINKS ${CPACK_NSIS_MENU_LINKS} "${CMAKE_INSTALL_BINDIR}/${TUTORIAL_NAME}" "${TUTORIAL_NAME}") 27 | 28 | SET(CPACK_NSIS_MENU_LINKS ${CPACK_NSIS_MENU_LINKS} PARENT_SCOPE) 29 | 30 | ENDMACRO () 31 | -------------------------------------------------------------------------------- /common/cmake/create_isa_dummy_file.cmake: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2016 Intel Corporation ## 3 | ## ## 4 | ## Licensed under the Apache License, Version 2.0 (the "License"); ## 5 | ## you may not use this file except in compliance with the License. ## 6 | ## You may obtain a copy of the License at ## 7 | ## ## 8 | ## http://www.apache.org/licenses/LICENSE-2.0 ## 9 | ## ## 10 | ## Unless required by applicable law or agreed to in writing, software ## 11 | ## distributed under the License is distributed on an "AS IS" BASIS, ## 12 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ## 13 | ## See the License for the specific language governing permissions and ## 14 | ## limitations under the License. ## 15 | ## ======================================================================== ## 16 | 17 | file(WRITE ${dst} "#include \"${src}\"\n") 18 | -------------------------------------------------------------------------------- /common/cmake/embree-config-linux.cmake: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2016 Intel Corporation ## 3 | ## ## 4 | ## Licensed under the Apache License, Version 2.0 (the "License"); ## 5 | ## you may not use this file except in compliance with the License. ## 6 | ## You may obtain a copy of the License at ## 7 | ## ## 8 | ## http://www.apache.org/licenses/LICENSE-2.0 ## 9 | ## ## 10 | ## Unless required by applicable law or agreed to in writing, software ## 11 | ## distributed under the License is distributed on an "AS IS" BASIS, ## 12 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ## 13 | ## See the License for the specific language governing permissions and ## 14 | ## limitations under the License. ## 15 | ## ======================================================================== ## 16 | 17 | SET(EMBREE_INCLUDE_DIRS ${CMAKE_CURRENT_LIST_DIR}/../../../@CMAKE_INSTALL_INCLUDEDIR@) 18 | SET(EMBREE_LIBRARY ${CMAKE_CURRENT_LIST_DIR}/../../@CMAKE_SHARED_LIBRARY_PREFIX@embree@CMAKE_SHARED_LIBRARY_SUFFIX@.@EMBREE_CONFIG_VERSION@) 19 | 20 | SET(EMBREE_TASKING_TBB @TASKING_TBB@) 21 | SET(EMBREE_USE_PACKAGED_TBB @EMBREE_ZIP_MODE@) 22 | 23 | IF (${EMBREE_TASKING_TBB} AND ${EMBREE_USE_PACKAGED_TBB}) 24 | SET(EMBREE_TBB_LIBRARY ${CMAKE_CURRENT_LIST_DIR}/../../@CMAKE_SHARED_LIBRARY_PREFIX@tbb@CMAKE_SHARED_LIBRARY_SUFFIX@.2) 25 | SET(EMBREE_TBB_LIBRARY_MALLOC ${CMAKE_CURRENT_LIST_DIR}/../../@CMAKE_SHARED_LIBRARY_PREFIX@tbbmalloc@CMAKE_SHARED_LIBRARY_SUFFIX@.2) 26 | ELSE() 27 | SET(EMBREE_USE_PACKAGED_TBB OFF) 28 | UNSET(EMBREE_TBB_LIBRARY) 29 | UNSET(EMBREE_TBB_LIBRARY_MALLOC) 30 | ENDIF() 31 | 32 | SET(EMBREE_LIBRARIES 33 | ${EMBREE_LIBRARY} 34 | ${EMBREE_TBB_LIBRARY} 35 | ${EMBREE_TBB_LIBRARY_MALLOC} 36 | ) 37 | 38 | MARK_AS_ADVANCED(embree_DIR) 39 | 40 | INCLUDE(${CMAKE_CURRENT_LIST_DIR}/embree-config-default.cmake) 41 | -------------------------------------------------------------------------------- /common/cmake/embree-config-macosx.cmake: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2016 Intel Corporation ## 3 | ## ## 4 | ## Licensed under the Apache License, Version 2.0 (the "License"); ## 5 | ## you may not use this file except in compliance with the License. ## 6 | ## You may obtain a copy of the License at ## 7 | ## ## 8 | ## http://www.apache.org/licenses/LICENSE-2.0 ## 9 | ## ## 10 | ## Unless required by applicable law or agreed to in writing, software ## 11 | ## distributed under the License is distributed on an "AS IS" BASIS, ## 12 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ## 13 | ## See the License for the specific language governing permissions and ## 14 | ## limitations under the License. ## 15 | ## ======================================================================== ## 16 | 17 | SET(EMBREE_INCLUDE_DIRS ${CMAKE_CURRENT_LIST_DIR}/../../../@CMAKE_INSTALL_INCLUDEDIR@) 18 | SET(EMBREE_LIBRARY ${CMAKE_CURRENT_LIST_DIR}/../../libembree.@EMBREE_CONFIG_VERSION@.dylib) 19 | 20 | MARK_AS_ADVANCED(embree_DIR) 21 | 22 | INCLUDE(${CMAKE_CURRENT_LIST_DIR}/embree-config-default.cmake) 23 | -------------------------------------------------------------------------------- /common/cmake/embree-config-version.cmake: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2016 Intel Corporation ## 3 | ## ## 4 | ## Licensed under the Apache License, Version 2.0 (the "License"); ## 5 | ## you may not use this file except in compliance with the License. ## 6 | ## You may obtain a copy of the License at ## 7 | ## ## 8 | ## http://www.apache.org/licenses/LICENSE-2.0 ## 9 | ## ## 10 | ## Unless required by applicable law or agreed to in writing, software ## 11 | ## distributed under the License is distributed on an "AS IS" BASIS, ## 12 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ## 13 | ## See the License for the specific language governing permissions and ## 14 | ## limitations under the License. ## 15 | ## ======================================================================== ## 16 | 17 | SET(PACKAGE_VERSION @EMBREE_VERSION@) 18 | 19 | IF (${PACKAGE_FIND_VERSION_MAJOR} EQUAL @EMBREE_VERSION_MAJOR@) 20 | IF (${PACKAGE_FIND_VERSION} VERSION_LESS @EMBREE_VERSION@) 21 | SET(PACKAGE_VERSION_COMPATIBLE 1) 22 | ENDIF() 23 | IF (${PACKAGE_FIND_VERSION} VERSION_EQUAL @EMBREE_VERSION@) 24 | SET(PACKAGE_VERSION_EXACT 1) 25 | ENDIF() 26 | ELSE() 27 | SET(PACKAGE_VERSION_UNSUITABLE 1) 28 | ENDIF() 29 | -------------------------------------------------------------------------------- /common/cmake/embree-config-windows.cmake: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2016 Intel Corporation ## 3 | ## ## 4 | ## Licensed under the Apache License, Version 2.0 (the "License"); ## 5 | ## you may not use this file except in compliance with the License. ## 6 | ## You may obtain a copy of the License at ## 7 | ## ## 8 | ## http://www.apache.org/licenses/LICENSE-2.0 ## 9 | ## ## 10 | ## Unless required by applicable law or agreed to in writing, software ## 11 | ## distributed under the License is distributed on an "AS IS" BASIS, ## 12 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ## 13 | ## See the License for the specific language governing permissions and ## 14 | ## limitations under the License. ## 15 | ## ======================================================================== ## 16 | 17 | SET(EMBREE_INCLUDE_DIRS ${CMAKE_CURRENT_LIST_DIR}/../../../@CMAKE_INSTALL_INCLUDEDIR@) 18 | SET(EMBREE_LIBRARY ${CMAKE_CURRENT_LIST_DIR}/../../embree.lib) 19 | 20 | MARK_AS_ADVANCED(embree_DIR) 21 | 22 | INCLUDE(${CMAKE_CURRENT_LIST_DIR}/embree-config-default.cmake) 23 | -------------------------------------------------------------------------------- /common/cmake/gcc.cmake: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2016 Intel Corporation ## 3 | ## ## 4 | ## Licensed under the Apache License, Version 2.0 (the "License"); ## 5 | ## you may not use this file except in compliance with the License. ## 6 | ## You may obtain a copy of the License at ## 7 | ## ## 8 | ## http://www.apache.org/licenses/LICENSE-2.0 ## 9 | ## ## 10 | ## Unless required by applicable law or agreed to in writing, software ## 11 | ## distributed under the License is distributed on an "AS IS" BASIS, ## 12 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ## 13 | ## See the License for the specific language governing permissions and ## 14 | ## limitations under the License. ## 15 | ## ======================================================================== ## 16 | 17 | SET(FLAGS_SSE2 "-msse2") 18 | SET(FLAGS_SSE3 "-msse3") 19 | SET(FLAGS_SSSE3 "-mssse3") 20 | SET(FLAGS_SSE41 "-msse4.1") 21 | SET(FLAGS_SSE42 "-msse4.2") 22 | SET(FLAGS_AVX "-mavx") 23 | SET(FLAGS_AVX2 "-mf16c -mavx2 -mfma -mlzcnt -mbmi -mbmi2") 24 | SET(FLAGS_AVX512KNL "-mavx512f -mavx512pf -mavx512er -mavx512cd") 25 | SET(FLAGS_AVX512SKX "-mavx512f -mavx512dq -mavx512cd -mavx512bw -mavx512vl") 26 | 27 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__SSE__ -D__X86_64__ -Wall -fPIC -std=c++11 -fvisibility-inlines-hidden -fvisibility=hidden -fno-strict-aliasing") 28 | SET(CMAKE_CXX_FLAGS_DEBUG "-DDEBUG -DTBB_USE_DEBUG -g -O0") 29 | SET(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG -O3") 30 | SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-DDEBUG -DTBB_USE_DEBUG -g -O3") 31 | SET(CMAKE_EXE_LINKER_FLAGS "") 32 | 33 | IF (APPLE) 34 | SET (CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS_INIT} -dynamiclib) 35 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.7 -stdlib=libc++") 36 | ENDIF (APPLE) 37 | 38 | -------------------------------------------------------------------------------- /common/cmake/rpm_ldconfig.sh: -------------------------------------------------------------------------------- 1 | /sbin/ldconfig 2 | -------------------------------------------------------------------------------- /common/cmake/uninstall.cmake.in: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2015 Intel Corporation ## 3 | ## ## 4 | ## Licensed under the Apache License, Version 2.0 (the "License"); ## 5 | ## you may not use this file except in compliance with the License. ## 6 | ## You may obtain a copy of the License at ## 7 | ## ## 8 | ## http://www.apache.org/licenses/LICENSE-2.0 ## 9 | ## ## 10 | ## Unless required by applicable law or agreed to in writing, software ## 11 | ## distributed under the License is distributed on an "AS IS" BASIS, ## 12 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ## 13 | ## See the License for the specific language governing permissions and ## 14 | ## limitations under the License. ## 15 | ## ======================================================================== ## 16 | 17 | IF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 18 | MESSAGE(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 19 | ENDIF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 20 | 21 | FILE(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) 22 | STRING(REGEX REPLACE "\n" ";" files "${files}") 23 | FOREACH(file ${files}) 24 | MESSAGE(STATUS "Uninstalling $ENV{DESTDIR}${file}") 25 | IF(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") 26 | EXEC_PROGRAM( 27 | "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" 28 | OUTPUT_VARIABLE rm_out 29 | RETURN_VALUE rm_retval 30 | ) 31 | IF(NOT "${rm_retval}" STREQUAL 0) 32 | MESSAGE(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}") 33 | ENDIF(NOT "${rm_retval}" STREQUAL 0) 34 | ELSE(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") 35 | MESSAGE(STATUS "File $ENV{DESTDIR}${file} does not exist.") 36 | ENDIF(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") 37 | ENDFOREACH(file) 38 | -------------------------------------------------------------------------------- /common/lexers/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2016 Intel Corporation ## 3 | ## ## 4 | ## Licensed under the Apache License, Version 2.0 (the "License"); ## 5 | ## you may not use this file except in compliance with the License. ## 6 | ## You may obtain a copy of the License at ## 7 | ## ## 8 | ## http://www.apache.org/licenses/LICENSE-2.0 ## 9 | ## ## 10 | ## Unless required by applicable law or agreed to in writing, software ## 11 | ## distributed under the License is distributed on an "AS IS" BASIS, ## 12 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ## 13 | ## See the License for the specific language governing permissions and ## 14 | ## limitations under the License. ## 15 | ## ======================================================================== ## 16 | 17 | ADD_LIBRARY(lexers STATIC 18 | stringstream.cpp 19 | tokenstream.cpp 20 | ) 21 | 22 | TARGET_LINK_LIBRARIES(lexers sys) 23 | SET_PROPERTY(TARGET lexers PROPERTY FOLDER common) 24 | -------------------------------------------------------------------------------- /common/lexers/streamfilters.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #pragma once 18 | 19 | #include "stream.h" 20 | 21 | namespace embree 22 | { 23 | /* removes all line comments from a stream */ 24 | class LineCommentFilter : public Stream 25 | { 26 | public: 27 | LineCommentFilter (const FileName& fileName, const std::string& lineComment) 28 | : cin(new FileStream(fileName)), lineComment(lineComment) {} 29 | LineCommentFilter (Ref > cin, const std::string& lineComment) 30 | : cin(cin), lineComment(lineComment) {} 31 | 32 | ParseLocation location() { return cin->loc(); } 33 | 34 | int next() 35 | { 36 | /* look if the line comment starts here */ 37 | for (size_t j=0; jpeek() != lineComment[j]) { cin->unget(j); goto not_found; } 39 | cin->get(); 40 | } 41 | /* eat all characters until the end of the line (or file) */ 42 | while (cin->peek() != '\n' && cin->peek() != EOF) cin->get(); 43 | 44 | not_found: 45 | return cin->get(); 46 | } 47 | 48 | private: 49 | Ref > cin; 50 | std::string lineComment; 51 | }; 52 | } 53 | -------------------------------------------------------------------------------- /common/lexers/stringstream.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #pragma once 18 | 19 | #include "stream.h" 20 | 21 | namespace embree 22 | { 23 | /*! simple tokenizer that produces a string stream */ 24 | class StringStream : public Stream 25 | { 26 | public: 27 | StringStream(const Ref >& cin, const std::string& seps = "\n\t\r ", 28 | const std::string& endl = "", bool multiLine = false); 29 | public: 30 | ParseLocation location() { return cin->loc(); } 31 | std::string next(); 32 | private: 33 | __forceinline bool isSeparator(int c) const { return isSepMap[c]; } 34 | private: 35 | Ref > cin; /*! source character stream */ 36 | bool isSepMap[256]; /*! map for fast classification of separators */ 37 | std::string endl; /*! the token of the end of line */ 38 | bool multiLine; /*! whether to parse lines wrapped with \ */ 39 | }; 40 | } 41 | -------------------------------------------------------------------------------- /common/math/obbox.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #pragma once 18 | 19 | #include "bbox.h" 20 | #include "linearspace3.h" 21 | 22 | namespace embree 23 | { 24 | /*! Oriented bounding box */ 25 | template 26 | struct OBBox 27 | { 28 | public: 29 | 30 | __forceinline OBBox () {} 31 | 32 | __forceinline OBBox (EmptyTy) 33 | : space(one), bounds(empty) {} 34 | 35 | __forceinline OBBox (const BBox& bounds) 36 | : space(one), bounds(bounds) {} 37 | 38 | __forceinline OBBox (const LinearSpace3& space, const BBox& bounds) 39 | : space(space), bounds(bounds) {} 40 | 41 | friend std::ostream& operator<<(std::ostream& cout, const OBBox& p) { 42 | return std::cout << "{ space = " << p.space << ", bounds = " << p.bounds << "}"; 43 | } 44 | 45 | public: 46 | LinearSpace3 space; //!< orthonormal transformation 47 | BBox bounds; //!< bounds in transformed space 48 | }; 49 | 50 | typedef OBBox OBBox3f; 51 | typedef OBBox OBBox3fa; 52 | } 53 | -------------------------------------------------------------------------------- /common/simd/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2016 Intel Corporation ## 3 | ## ## 4 | ## Licensed under the Apache License, Version 2.0 (the "License"); ## 5 | ## you may not use this file except in compliance with the License. ## 6 | ## You may obtain a copy of the License at ## 7 | ## ## 8 | ## http://www.apache.org/licenses/LICENSE-2.0 ## 9 | ## ## 10 | ## Unless required by applicable law or agreed to in writing, software ## 11 | ## distributed under the License is distributed on an "AS IS" BASIS, ## 12 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ## 13 | ## See the License for the specific language governing permissions and ## 14 | ## limitations under the License. ## 15 | ## ======================================================================== ## 16 | 17 | ADD_LIBRARY(simd STATIC sse.cpp) 18 | SET_PROPERTY(TARGET simd PROPERTY FOLDER common) 19 | 20 | -------------------------------------------------------------------------------- /common/simd/avx.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #pragma once 18 | 19 | #include "sse.h" 20 | 21 | #if defined(__AVX512VL__) 22 | #include "vboolf8_avx512.h" 23 | #include "vboold4_avx512.h" 24 | #else 25 | #include "vboolf8_avx.h" 26 | #include "vboold4_avx.h" 27 | #endif 28 | 29 | #if defined(__AVX2__) 30 | #include "vint8_avx2.h" 31 | #if defined(__X86_64__) 32 | #include "vlong4_avx2.h" 33 | #endif 34 | #else 35 | #include "vint8_avx.h" 36 | #endif 37 | #include "vfloat8_avx.h" 38 | #if defined(__X86_64__) 39 | #include "vdouble4_avx.h" 40 | #endif 41 | 42 | #if defined(__AVX512F__) 43 | #include "avx512.h" 44 | #endif 45 | 46 | -------------------------------------------------------------------------------- /common/simd/sse.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #pragma once 18 | 19 | #include "../sys/platform.h" 20 | #include "../sys/intrinsics.h" 21 | #include "../math/constants.h" 22 | #include "varying.h" 23 | 24 | namespace embree 25 | { 26 | #if defined(__SSE4_1__) 27 | __forceinline __m128 blendv_ps( __m128 f, __m128 t, __m128 mask ) { 28 | return _mm_blendv_ps(f,t,mask); 29 | } 30 | #else 31 | __forceinline __m128 blendv_ps( __m128 f, __m128 t, __m128 mask ) { 32 | return _mm_or_ps(_mm_and_ps(mask, t), _mm_andnot_ps(mask, f)); 33 | } 34 | #endif 35 | 36 | extern const __m128 _mm_lookupmask_ps[16]; 37 | extern const __m128d _mm_lookupmask_pd[4]; 38 | } 39 | 40 | #if defined(__AVX512VL__) 41 | #include "vboolf4_avx512.h" 42 | #else 43 | #include "vboolf4_sse2.h" 44 | #endif 45 | #include "vint4_sse2.h" 46 | #include "vfloat4_sse2.h" 47 | -------------------------------------------------------------------------------- /common/sys/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2016 Intel Corporation ## 3 | ## ## 4 | ## Licensed under the Apache License, Version 2.0 (the "License"); ## 5 | ## you may not use this file except in compliance with the License. ## 6 | ## You may obtain a copy of the License at ## 7 | ## ## 8 | ## http://www.apache.org/licenses/LICENSE-2.0 ## 9 | ## ## 10 | ## Unless required by applicable law or agreed to in writing, software ## 11 | ## distributed under the License is distributed on an "AS IS" BASIS, ## 12 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ## 13 | ## See the License for the specific language governing permissions and ## 14 | ## limitations under the License. ## 15 | ## ======================================================================== ## 16 | 17 | SET(CMAKE_THREAD_PREFER_PTHREAD TRUE) 18 | FIND_PACKAGE(Threads REQUIRED) 19 | 20 | ADD_LIBRARY(sys STATIC 21 | sysinfo.cpp 22 | alloc.cpp 23 | filename.cpp 24 | library.cpp 25 | thread.cpp 26 | network.cpp 27 | string.cpp 28 | regression.cpp 29 | mutex.cpp 30 | condition.cpp 31 | barrier.cpp 32 | ) 33 | 34 | TARGET_LINK_LIBRARIES(sys ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS}) 35 | SET_PROPERTY(TARGET sys PROPERTY FOLDER common) 36 | -------------------------------------------------------------------------------- /common/sys/SSE2NEON.h: -------------------------------------------------------------------------------- 1 | ../math/SSE2NEON.h -------------------------------------------------------------------------------- /common/sys/condition.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #pragma once 18 | 19 | #include "mutex.h" 20 | 21 | namespace embree 22 | { 23 | class ConditionSys 24 | { 25 | public: 26 | ConditionSys(); 27 | ~ConditionSys(); 28 | void wait( class MutexSys& mutex ); 29 | void notify_all(); 30 | 31 | template 32 | __forceinline void wait( class MutexSys& mutex, const Predicate& pred ) 33 | { 34 | while (!pred()) wait(mutex); 35 | } 36 | 37 | protected: 38 | void* cond; 39 | }; 40 | } 41 | -------------------------------------------------------------------------------- /common/sys/library.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #pragma once 18 | 19 | #include "platform.h" 20 | 21 | namespace embree 22 | { 23 | /*! type for shared library */ 24 | typedef struct opaque_lib_t* lib_t; 25 | 26 | /*! loads a shared library */ 27 | lib_t openLibrary(const std::string& file); 28 | 29 | /*! returns address of a symbol from the library */ 30 | void* getSymbol(lib_t lib, const std::string& sym); 31 | 32 | /*! unloads a shared library */ 33 | void closeLibrary(lib_t lib); 34 | } 35 | -------------------------------------------------------------------------------- /common/sys/regression.cpp: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #include "regression.h" 18 | 19 | namespace embree 20 | { 21 | static std::unique_ptr> regression_tests; 22 | 23 | void registerRegressionTest(RegressionTest* test) 24 | { 25 | if (!regression_tests) 26 | regression_tests = std::unique_ptr>(new std::vector); 27 | 28 | regression_tests->push_back(test); 29 | } 30 | 31 | RegressionTest* getRegressionTest(size_t index) 32 | { 33 | if (!regression_tests) 34 | return nullptr; 35 | 36 | if (index >= regression_tests->size()) 37 | return nullptr; 38 | 39 | return (*regression_tests)[index]; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /common/sys/regression.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #pragma once 18 | 19 | #include "platform.h" 20 | 21 | #include 22 | 23 | namespace embree 24 | { 25 | /*! virtual interface for all regression tests */ 26 | struct RegressionTest 27 | { 28 | RegressionTest (std::string name) : name(name) {} 29 | virtual bool run() = 0; 30 | std::string name; 31 | }; 32 | 33 | /*! registers a regression test */ 34 | void registerRegressionTest(RegressionTest* test); 35 | 36 | /*! run all regression tests */ 37 | RegressionTest* getRegressionTest(size_t index); 38 | } 39 | -------------------------------------------------------------------------------- /common/sys/string.cpp: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #include "string.h" 18 | 19 | #include 20 | #include 21 | 22 | namespace embree 23 | { 24 | char to_lower(char c) { return char(tolower(int(c))); } 25 | char to_upper(char c) { return char(toupper(int(c))); } 26 | std::string toLowerCase(const std::string& s) { std::string dst(s); std::transform(dst.begin(), dst.end(), dst.begin(), to_lower); return dst; } 27 | std::string toUpperCase(const std::string& s) { std::string dst(s); std::transform(dst.begin(), dst.end(), dst.begin(), to_upper); return dst; } 28 | } 29 | -------------------------------------------------------------------------------- /common/sys/string.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #pragma once 18 | 19 | #include "platform.h" 20 | 21 | namespace embree 22 | { 23 | class IOStreamStateRestorer 24 | { 25 | public: 26 | IOStreamStateRestorer(std::ostream& iostream) 27 | : iostream(iostream), flags(iostream.flags()), precision(iostream.precision()) { 28 | } 29 | 30 | ~IOStreamStateRestorer() { 31 | iostream.flags(flags); 32 | iostream.precision(precision); 33 | } 34 | 35 | private: 36 | std::ostream& iostream; 37 | std::ios::fmtflags flags; 38 | std::streamsize precision; 39 | }; 40 | 41 | std::string toLowerCase(const std::string& s); 42 | std::string toUpperCase(const std::string& s); 43 | } 44 | -------------------------------------------------------------------------------- /common/sys/vector.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #pragma once 18 | 19 | #include "alloc.h" 20 | 21 | /*! instantiate vector using default allocator */ 22 | #define vector_t vector 23 | #define allocator_t std::allocator 24 | #include "vector_t.h" 25 | #undef vector_t 26 | #undef allocator_t 27 | 28 | /*! instantiate vector using aligned malloc */ 29 | #define vector_t avector 30 | #define allocator_t aligned_allocator::value> 31 | #include "vector_t.h" 32 | #undef vector_t 33 | #undef allocator_t 34 | 35 | /*! instantiate vector using os_malloc */ 36 | #define vector_t ovector 37 | #define allocator_t os_allocator 38 | #include "vector_t.h" 39 | #undef vector_t 40 | #undef allocator_t 41 | 42 | namespace embree 43 | { 44 | /*! vector class that performs aligned allocations */ 45 | //template // FIXME: unfortunately not supported in VS2012 46 | // using avector = vector_t::value> >; 47 | 48 | /*! vector class that performs OS allocations */ 49 | //template // FIXME: unfortunately not supported in VS2012 50 | // using ovector = vector_t >; 51 | } 52 | -------------------------------------------------------------------------------- /common/tasking/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2016 Intel Corporation ## 3 | ## ## 4 | ## Licensed under the Apache License, Version 2.0 (the "License"); ## 5 | ## you may not use this file except in compliance with the License. ## 6 | ## You may obtain a copy of the License at ## 7 | ## ## 8 | ## http://www.apache.org/licenses/LICENSE-2.0 ## 9 | ## ## 10 | ## Unless required by applicable law or agreed to in writing, software ## 11 | ## distributed under the License is distributed on an "AS IS" BASIS, ## 12 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ## 13 | ## See the License for the specific language governing permissions and ## 14 | ## limitations under the License. ## 15 | ## ======================================================================== ## 16 | 17 | IF (TASKING_INTERNAL) 18 | ADD_LIBRARY(tasking STATIC taskschedulerinternal.cpp) 19 | ENDIF() 20 | 21 | IF (TASKING_TBB) 22 | ADD_LIBRARY(tasking STATIC taskschedulertbb.cpp) 23 | TARGET_LINK_LIBRARIES(tasking sys ${TBB_LIBRARIES}) 24 | ENDIF() 25 | 26 | IF (TASKING_PPL) 27 | ADD_LIBRARY(tasking STATIC taskschedulerppl.cpp) 28 | TARGET_LINK_LIBRARIES(tasking sys ${PPL_LIBRARIES}) 29 | ENDIF() 30 | 31 | SET_PROPERTY(TARGET tasking PROPERTY FOLDER common) 32 | -------------------------------------------------------------------------------- /common/tasking/taskscheduler.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #pragma once 18 | 19 | #if defined(TASKING_INTERNAL) 20 | # include "taskschedulerinternal.h" 21 | #elif defined(TASKING_TBB) 22 | # include "taskschedulertbb.h" 23 | #elif defined(TASKING_PPL) 24 | # include "taskschedulerppl.h" 25 | #else 26 | # error "no tasking system enabled" 27 | #endif 28 | 29 | -------------------------------------------------------------------------------- /kernels/builders/primrefgen.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #pragma once 18 | 19 | #include "../common/scene.h" 20 | #include "../common/primref.h" 21 | #include "priminfo.h" 22 | #include "../geometry/bezier1v.h" 23 | 24 | namespace embree 25 | { 26 | namespace isa 27 | { 28 | template 29 | PrimInfo createPrimRefArray(Mesh* mesh, mvector& prims, BuildProgressMonitor& progressMonitor); 30 | 31 | template 32 | PrimInfo createPrimRefArray(Scene* scene, mvector& prims, BuildProgressMonitor& progressMonitor); 33 | 34 | template 35 | PrimInfo createPrimRefArrayMBlur(size_t timeSegment, size_t numTimeSteps, Scene* scene, mvector& prims, BuildProgressMonitor& progressMonitor); 36 | 37 | PrimInfo createBezierRefArray(Scene* scene, mvector& prims, BuildProgressMonitor& progressMonitor); 38 | PrimInfo createBezierRefArrayMBlur(size_t timeSegment, size_t numTimeSteps, Scene* scene, mvector& prims, BuildProgressMonitor& progressMonitor); 39 | } 40 | } 41 | 42 | -------------------------------------------------------------------------------- /kernels/bvh/bvh_intersector_stream_filters.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #pragma once 18 | 19 | #include "../common/default.h" 20 | #include "../common/ray.h" 21 | #include "../common/scene.h" 22 | 23 | namespace embree 24 | { 25 | namespace isa 26 | { 27 | class RayStream 28 | { 29 | public: 30 | 31 | static void filterAOS(Scene* scene, RTCRay* rays, const size_t N, const size_t stride, IntersectContext* context, const bool intersect); 32 | static void filterAOP(Scene* scene, RTCRay** rays, const size_t N, IntersectContext* context, const bool intersect); 33 | static void filterSOA(Scene* scene, char* rays, const size_t N, const size_t streams, const size_t stream_offset, IntersectContext* context, const bool intersect); 34 | static void filterSOP(Scene* scene, const RTCRayNp& rays, const size_t N, IntersectContext* context, const bool intersect); 35 | }; 36 | } 37 | }; 38 | -------------------------------------------------------------------------------- /kernels/bvh/bvh_rotate.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #pragma once 18 | 19 | #include "bvh.h" 20 | 21 | namespace embree 22 | { 23 | namespace isa 24 | { 25 | template 26 | class BVHNRotate 27 | { 28 | typedef typename BVHN::NodeRef NodeRef; 29 | 30 | public: 31 | static const bool enabled = false; 32 | 33 | static __forceinline size_t rotate(NodeRef parentRef, size_t depth = 1) { return 0; } 34 | static __forceinline void restructure(NodeRef ref, size_t depth = 1) {} 35 | }; 36 | 37 | /* BVH4 tree rotations */ 38 | template<> 39 | class BVHNRotate<4> 40 | { 41 | typedef BVH4::AlignedNode AlignedNode; 42 | typedef BVH4::NodeRef NodeRef; 43 | 44 | public: 45 | static const bool enabled = true; 46 | 47 | static size_t rotate(NodeRef parentRef, size_t depth = 1); 48 | }; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /kernels/common/accelinstance.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #pragma once 18 | 19 | #include "accel.h" 20 | #include "builder.h" 21 | 22 | namespace embree 23 | { 24 | class AccelInstance : public Accel 25 | { 26 | public: 27 | AccelInstance (AccelData* accel, Builder* builder, Intersectors& intersectors) 28 | : Accel(AccelData::TY_ACCEL_INSTANCE,intersectors), accel(accel), builder(builder) {} 29 | 30 | void immutable () { 31 | delete builder; builder = nullptr; 32 | } 33 | 34 | ~AccelInstance() { 35 | delete builder; builder = nullptr; 36 | delete accel; accel = nullptr; 37 | } 38 | 39 | public: 40 | void build (size_t threadIndex, size_t threadCount) { 41 | if (builder) builder->build(threadIndex,threadCount); 42 | bounds = accel->bounds; 43 | } 44 | 45 | void deleteGeometry(size_t geomID) { 46 | if (accel ) accel->deleteGeometry(geomID); 47 | if (builder) builder->deleteGeometry(geomID); 48 | } 49 | 50 | void clear() { 51 | accel->clear(); 52 | builder->clear(); 53 | } 54 | 55 | private: 56 | AccelData* accel; 57 | Builder* builder; 58 | }; 59 | } 60 | -------------------------------------------------------------------------------- /kernels/common/buffer.cpp: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #include "buffer.h" 18 | 19 | namespace embree 20 | { 21 | // FIXME: remove this file 22 | } 23 | -------------------------------------------------------------------------------- /kernels/common/context.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #pragma once 18 | 19 | #include "default.h" 20 | #include "rtcore.h" 21 | 22 | namespace embree 23 | { 24 | class Scene; 25 | 26 | struct IntersectContext 27 | { 28 | enum { 29 | INPUT_RAY_DATA_AOS = 0, 30 | INPUT_RAY_DATA_SOA4 = 4, 31 | INPUT_RAY_DATA_SOA8 = 8, 32 | INPUT_RAY_DATA_SOA16 = 16 33 | }; 34 | 35 | public: 36 | __forceinline IntersectContext(Scene* scene, const RTCIntersectContext* user_context) 37 | : scene(scene), user(user_context), flags(INPUT_RAY_DATA_AOS), geomID_to_instID(nullptr) {} 38 | 39 | public: 40 | Scene* scene; 41 | const RTCIntersectContext* user; 42 | size_t flags; 43 | const unsigned* geomID_to_instID; // required for xfm node handling 44 | 45 | static __forceinline size_t encodeSIMDWidth(const size_t width) 46 | { 47 | assert(width == 4 || width == 8 || width == 16); 48 | return width; 49 | } 50 | 51 | __forceinline size_t getInputSIMDWidth() 52 | { 53 | return flags; 54 | } 55 | 56 | }; 57 | } 58 | -------------------------------------------------------------------------------- /kernels/common/scene_geometry_instance.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #pragma once 18 | 19 | #include "geometry.h" 20 | 21 | namespace embree 22 | { 23 | /*! Instanced geometry */ 24 | struct GeometryInstance : public Geometry 25 | { 26 | ALIGNED_STRUCT; 27 | public: 28 | GeometryInstance (Scene* parent, Geometry* geom); 29 | virtual void build(size_t threadIndex, size_t threadCount) {} 30 | virtual void enabling (); 31 | virtual void disabling(); 32 | virtual void setMask (unsigned mask); 33 | virtual void setTransform(const AffineSpace3fa& local2world, size_t timeStep); 34 | 35 | void count(ssize_t f); 36 | public: 37 | AffineSpace3fa local2world; //!< transforms from local space to world space 38 | AffineSpace3fa world2local; //!< transforms from world space to local space 39 | Geometry* geom; //!< pointer to instanced acceleration structure 40 | }; 41 | } 42 | -------------------------------------------------------------------------------- /kernels/embree.rc: -------------------------------------------------------------------------------- 1 | #include "version.h" 2 | 3 | 1 VERSIONINFO 4 | FILEVERSION __EMBREE_VERSION_MAJOR__,__EMBREE_VERSION_MINOR__,__EMBREE_VERSION_PATCH__,0 5 | PRODUCTVERSION __EMBREE_VERSION_MAJOR__,__EMBREE_VERSION_MINOR__,__EMBREE_VERSION_PATCH__,0 6 | FILEFLAGSMASK 0x3fL 7 | #ifdef _DEBUG 8 | FILEFLAGS 0x1L 9 | #else 10 | FILEFLAGS 0x0L 11 | #endif 12 | FILEOS 0x40004L 13 | FILETYPE 0x2L 14 | FILESUBTYPE 0x0L 15 | BEGIN 16 | BLOCK "StringFileInfo" 17 | BEGIN 18 | BLOCK "040904b0" 19 | BEGIN 20 | VALUE "CompanyName", "Intel" 21 | VALUE "FileDescription", "Embree Ray Tracing Kernels" 22 | VALUE "FileVersion", __EMBREE_VERSION__ 23 | VALUE "ProductVersion", __EMBREE_VERSION__ 24 | VALUE "LegalCopyright", "www.apache.org/licenses/LICENSE-2.0" 25 | VALUE "OriginalFilename", "embree.dll" 26 | VALUE "InternalName", "Embree" 27 | VALUE "ProductName", "Embree Ray Tracing Kernels" 28 | END 29 | END 30 | BLOCK "VarFileInfo" 31 | BEGIN 32 | VALUE "Translation", 0x409, 1200 33 | END 34 | END 35 | -------------------------------------------------------------------------------- /kernels/export.linux.map: -------------------------------------------------------------------------------- 1 | { 2 | global: 3 | rtc*; 4 | ISPC*; 5 | _ZN6embree13TaskScheduler*; 6 | local: 7 | *; 8 | }; 9 | -------------------------------------------------------------------------------- /kernels/export.macosx.map: -------------------------------------------------------------------------------- 1 | _rtc* 2 | _ISPC* 3 | __ZN6embree13TaskScheduler10swapThreadEPNS0_6ThreadE* 4 | __ZN6embree13TaskScheduler11threadCountEv* 5 | __ZN6embree13TaskScheduler11threadIndexEv* 6 | __ZN6embree13TaskScheduler12addSchedulerERKNS_3RefIS0_EE* 7 | __ZN6embree13TaskScheduler12startThreadsEv* 8 | __ZN6embree13TaskScheduler15removeSchedulerERKNS_3RefIS0_EE* 9 | __ZN6embree13TaskScheduler16allocThreadIndexEv* 10 | __ZN6embree13TaskScheduler4waitEv* 11 | __ZN6embree13TaskScheduler6threadEv* 12 | __ZN6embree13TaskScheduler8instanceEv* 13 | __ZN6embree13TaskScheduler9TaskQueue13execute_localERNS0_6ThreadEPNS0_4TaskE* 14 | -------------------------------------------------------------------------------- /kernels/geometry/instance_intersector.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #pragma once 18 | 19 | #include "../common/scene_instance.h" 20 | #include "../common/ray.h" 21 | 22 | namespace embree 23 | { 24 | namespace isa 25 | { 26 | template 27 | struct FastInstanceIntersectorK 28 | { 29 | static void intersect(vint* valid, const Instance* instance, RayK& ray, size_t item); 30 | static void occluded (vint* valid, const Instance* instance, RayK& ray, size_t item); 31 | }; 32 | 33 | typedef FastInstanceIntersectorK<4> FastInstanceIntersector4; 34 | typedef FastInstanceIntersectorK<8> FastInstanceIntersector8; 35 | typedef FastInstanceIntersectorK<16> FastInstanceIntersector16; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /kernels/geometry/instance_intersector1.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #pragma once 18 | 19 | #include "../common/scene_instance.h" 20 | #include "../common/ray.h" 21 | 22 | namespace embree 23 | { 24 | namespace isa 25 | { 26 | struct FastInstanceIntersector1 27 | { 28 | static void intersect(const Instance* instance, Ray& ray, size_t item); 29 | static void occluded (const Instance* instance, Ray& ray, size_t item); 30 | }; 31 | 32 | struct FastInstanceIntersector1M 33 | { 34 | static void intersect(const Instance* instance, RTCIntersectContext* context, Ray** rays, size_t M, size_t item); 35 | static void occluded (const Instance* instance, RTCIntersectContext* context, Ray** rays, size_t M, size_t item); 36 | }; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /kernels/subdiv/bezier_curve.cpp: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #include "bezier_curve.h" 18 | 19 | namespace embree 20 | { 21 | BezierCoefficients::BezierCoefficients(int dj) 22 | { 23 | for (size_t i=0; i<=N; i++) 24 | { 25 | for (size_t j=0; j<=N; j++) 26 | { 27 | const float t1 = float(j+dj)/float(i); 28 | const float t0 = 1.0f-t1; 29 | 30 | c0[i][j] = t0 * t0 * t0; 31 | c1[i][j] = 3.0f * t1 * t0 * t0; 32 | c2[i][j] = 3.0f * t1 * t1 * t0; 33 | c3[i][j] = t1 * t1 * t1; 34 | 35 | d0[i][j] = -3.0f*(t0*t0); 36 | d1[i][j] = -6.0f*(t0*t1) + 3.0f*(t0*t0); 37 | d2[i][j] = +6.0f*(t0*t1) - 3.0f*(t1*t1); 38 | d3[i][j] = +3.0f*(t1*t1); 39 | } 40 | } 41 | } 42 | BezierCoefficients bezier_coeff0(0); 43 | BezierCoefficients bezier_coeff1(1); 44 | } 45 | -------------------------------------------------------------------------------- /kernels/version.h.in: -------------------------------------------------------------------------------- 1 | #define __EMBREE_VERSION_MAJOR__ @EMBREE_VERSION_MAJOR@ 2 | #define __EMBREE_VERSION_MINOR__ @EMBREE_VERSION_MINOR@ 3 | #define __EMBREE_VERSION_PATCH__ @EMBREE_VERSION_PATCH@ 4 | #define __EMBREE_VERSION_NUMBER__ @EMBREE_VERSION_NUMBER@ 5 | #define __EMBREE_VERSION__ "@EMBREE_VERSION_MAJOR@.@EMBREE_VERSION_MINOR@.@EMBREE_VERSION_PATCH@@EMBREE_VERSION_NOTE@" 6 | #define __EMBREE_HASH__ "@EMBREE_HASH@" 7 | -------------------------------------------------------------------------------- /readme.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marty1885/embree-arm/60651db1eb56a5ef2c9c56e49eeca175ff05a112/readme.pdf -------------------------------------------------------------------------------- /scripts/install_linux/embree-vars.csh: -------------------------------------------------------------------------------- 1 | #!/bin/tcsh 2 | pushd . > /dev/null 3 | set SCRIPT_PATH=($_) 4 | set SCRIPT_PATH="$SCRIPT_PATH[2]" 5 | if ( -l "${SCRIPT_PATH}" ) then 6 | while( -l "${SCRIPT_PATH}" ) do cd `dirname "$SCRIPT_PATH"`; SCRIPT_PATH=`readlink "${SCRIPT_PATH}"`; done 7 | endif 8 | cd "`dirname "$SCRIPT_PATH"`" > /dev/null 9 | set SCRIPT_PATH=`pwd` 10 | popd > /dev/null 11 | 12 | if (!($?CPATH)) then 13 | setenv CPATH 14 | endif 15 | 16 | if (!($?LIBRARY_PATH)) then 17 | setenv LIBRARY_PATH 18 | endif 19 | 20 | if (!($?LD_LIBRARY_PATH)) then 21 | setenv LD_LIBRARY_PATH 22 | endif 23 | 24 | if (!($?SINK_LD_LIBRARY_PATH)) then 25 | setenv SINK_LD_LIBRARY_PATH 26 | endif 27 | 28 | setenv CPATH "$SCRIPT_PATH/@CMAKE_INSTALL_INCLUDEDIR@:${CPATH}" 29 | 30 | setenv LIBRARY_PATH "$SCRIPT_PATH/@CMAKE_INSTALL_LIBDIR@:${LIBRARY_PATH}" 31 | 32 | setenv LD_LIBRARY_PATH "$SCRIPT_PATH/@CMAKE_INSTALL_LIBDIR@:${LD_LIBRARY_PATH}" 33 | 34 | setenv SINK_LD_LIBRARY_PATH "$SCRIPT_PATH/@CMAKE_INSTALL_LIBDIR@:${SINK_LD_LIBRARY_PATH}" 35 | -------------------------------------------------------------------------------- /scripts/install_linux/embree-vars.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | pushd . > /dev/null 4 | SCRIPT_PATH="${BASH_SOURCE[0]}"; 5 | if ([ -h "${SCRIPT_PATH}" ]) then 6 | while([ -h "${SCRIPT_PATH}" ]) do cd `dirname "$SCRIPT_PATH"`; SCRIPT_PATH=`readlink "${SCRIPT_PATH}"`; done 7 | fi 8 | cd "`dirname "$SCRIPT_PATH"`" > /dev/null 9 | SCRIPT_PATH=`pwd`; 10 | popd > /dev/null 11 | 12 | CPATH="$SCRIPT_PATH/@CMAKE_INSTALL_INCLUDEDIR@:${CPATH}" 13 | export CPATH 14 | 15 | LIBRARY_PATH="$SCRIPT_PATH/@CMAKE_INSTALL_LIBDIR@:${LIBRARY_PATH}" 16 | export LIBRARY_PATH 17 | 18 | LD_LIBRARY_PATH="$SCRIPT_PATH/@CMAKE_INSTALL_LIBDIR@:${LD_LIBRARY_PATH}" 19 | export LD_LIBRARY_PATH 20 | 21 | SINK_LD_LIBRARY_PATH="$SCRIPT_PATH/@CMAKE_INSTALL_LIBDIR@:${SINK_LD_LIBRARY_PATH}" 22 | export SINK_LD_LIBRARY_PATH 23 | -------------------------------------------------------------------------------- /scripts/install_macosx/embree-vars.csh: -------------------------------------------------------------------------------- 1 | #!/bin/tcsh 2 | pushd . > /dev/null 3 | set SCRIPT_PATH=($_) 4 | set SCRIPT_PATH="$SCRIPT_PATH[2]" 5 | if ( -l "${SCRIPT_PATH}" ) then 6 | while( -l "${SCRIPT_PATH}" ) do cd `dirname "$SCRIPT_PATH"`; SCRIPT_PATH=`readlink "${SCRIPT_PATH}"`; done 7 | endif 8 | cd "`dirname "$SCRIPT_PATH"`" > /dev/null 9 | set SCRIPT_PATH=`pwd` 10 | popd > /dev/null 11 | 12 | if (!($?CPATH)) then 13 | setenv CPATH 14 | endif 15 | 16 | if (!($?LIBRARY_PATCH)) then 17 | setenv LIBRARY_PATH 18 | endif 19 | 20 | if (!($?DYLD_LIBRARY_PATH)) then 21 | setenv DYLD_LIBRARY_PATH 22 | endif 23 | 24 | setenv CPATH "$SCRIPT_PATH/@CMAKE_INSTALL_INCLUDEDIR@":${CPATH} 25 | 26 | setenv LIBRARY_PATH "$SCRIPT_PATH/@CMAKE_INSTALL_LIBDIR@":${LIBRARY_PATH} 27 | 28 | setenv DYLD_LIBRARY_PATH "$SCRIPT_PATH/@CMAKE_INSTALL_LIBDIR@":${DYLD_LIBRARY_PATH} 29 | 30 | -------------------------------------------------------------------------------- /scripts/install_macosx/embree-vars.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | pushd . > /dev/null 4 | SCRIPT_PATH="${BASH_SOURCE[0]}"; 5 | if ([ -h "${SCRIPT_PATH}" ]) then 6 | while([ -h "${SCRIPT_PATH}" ]) do cd `dirname "$SCRIPT_PATH"`; SCRIPT_PATH=`readlink "${SCRIPT_PATH}"`; done 7 | fi 8 | cd "`dirname "$SCRIPT_PATH"`" > /dev/null 9 | SCRIPT_PATH=`pwd`; 10 | popd > /dev/null 11 | 12 | CPATH="$SCRIPT_PATH/@CMAKE_INSTALL_INCLUDEDIR@:${CPATH}" 13 | export CPATH 14 | 15 | LIBRARY_PATH="$SCRIPT_PATH/@CMAKE_INSTALL_LIBDIR@:${LIBRARY_PATH}" 16 | export LIBRARY_PATH 17 | 18 | DYLD_LIBRARY_PATH="$SCRIPT_PATH/@CMAKE_INSTALL_LIBDIR@:${DYLD_LIBRARY_PATH}" 19 | export DYLD_LIBRARY_PATH 20 | -------------------------------------------------------------------------------- /scripts/install_macosx/uninstall.command: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo Uninstalling Embree ... 3 | DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) 4 | cd $DIR 5 | cd .. 6 | cd .. 7 | pkgutil --only-files --files com.intel.embree-@EMBREE_VERSION@| tr '\n' '\0' | xargs -n 1 -0 sudo rm -v 8 | pkgutil --only-dirs --files com.intel.embree-@EMBREE_VERSION@ | grep -e 'opt/local/include/\|opt/local/lib/\|Applications/' | tail -r | tr '\n' '\0' | xargs -n 1 -0 sudo rm -vd 9 | sudo pkgutil --forget com.intel.embree-@EMBREE_VERSION@ 10 | -------------------------------------------------------------------------------- /scripts/install_windows/icon32.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marty1885/embree-arm/60651db1eb56a5ef2c9c56e49eeca175ff05a112/scripts/install_windows/icon32.ico -------------------------------------------------------------------------------- /scripts/package_macosx.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # read embree version 4 | #EMBREE_VERSION_MAJOR=`sed -n 's/#define __EMBREE_VERSION_MAJOR__ \(.*\)/\1/p' version.h` 5 | #EMBREE_VERSION_MINOR=`sed -n 's/#define __EMBREE_VERSION_MINOR__ \(.*\)/\1/p' version.h` 6 | #EMBREE_VERSION_PATCH=`sed -n 's/#define __EMBREE_VERSION_PATCH__ \(.*\)/\1/p' version.h` 7 | #EMBREE_VERSION=${EMBREE_VERSION_MAJOR}.${EMBREE_VERSION_MINOR}.${EMBREE_VERSION_PATCH} 8 | EMBREE_VERSION=$2 9 | 10 | # create package 11 | cmake --build . --config $1 --target package 12 | 13 | echo "$2" 14 | -------------------------------------------------------------------------------- /scripts/package_win.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | set build_type=%2 4 | if "%build_type%" == "" ( 5 | set build_type=Release 6 | ) 7 | 8 | cmake --build . --config %build_type% --target PACKAGE -- /m /nologo /verbosity:n 9 | 10 | @echo "%1" 11 | 12 | -------------------------------------------------------------------------------- /scripts/release_macosx.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # to make sure we do not include nor link against wrong TBB 4 | export CPATH= 5 | export LIBRARY_PATH= 6 | export DYLD_LIBRARY_PATH= 7 | TBB_PATH_LOCAL=$PWD/tbb 8 | 9 | mkdir -p build 10 | cd build 11 | rm CMakeCache.txt # make sure to use default settings 12 | rm version.h 13 | 14 | # set compiler 15 | cmake \ 16 | -D CMAKE_C_COMPILER:FILEPATH=icc \ 17 | -D CMAKE_CXX_COMPILER:FILEPATH=icpc \ 18 | .. 19 | 20 | # set release settings 21 | cmake \ 22 | -D EMBREE_MAX_ISA=AVX2 \ 23 | -D EMBREE_TUTORIALS_IMAGE_MAGICK=OFF \ 24 | -D EMBREE_TUTORIALS_LIBJPEG=OFF \ 25 | -D EMBREE_TUTORIALS_LIBPNG=OFF \ 26 | -D EMBREE_TUTORIALS_OPENEXR=OFF \ 27 | .. 28 | 29 | # create installers 30 | cmake \ 31 | -D EMBREE_ZIP_MODE=OFF \ 32 | -D CMAKE_SKIP_INSTALL_RPATH=OFF \ 33 | -D CMAKE_INSTALL_PREFIX=/opt/local \ 34 | -D CMAKE_INSTALL_INCLUDEDIR=include \ 35 | -D CMAKE_INSTALL_LIBDIR=lib \ 36 | -D CMAKE_INSTALL_DOCDIR=../../Applications/Embree2/doc \ 37 | -D CMAKE_INSTALL_BINDIR=../../Applications/Embree2/bin \ 38 | -D EMBREE_TBB_ROOT=/opt/local \ 39 | .. 40 | make -j 4 package 41 | 42 | # create ZIP files 43 | cmake \ 44 | -D EMBREE_ZIP_MODE=ON \ 45 | -D CMAKE_SKIP_INSTALL_RPATH=ON \ 46 | -D CMAKE_MACOSX_RPATH=ON \ 47 | -D CMAKE_INSTALL_INCLUDEDIR=include \ 48 | -D CMAKE_INSTALL_LIBDIR=lib \ 49 | -D CMAKE_INSTALL_DOCDIR=doc \ 50 | -D CMAKE_INSTALL_BINDIR=bin \ 51 | -D EMBREE_TBB_ROOT=$TBB_PATH_LOCAL \ 52 | .. 53 | make -j 4 package 54 | 55 | rm CMakeCache.txt # reset settings 56 | cd .. 57 | -------------------------------------------------------------------------------- /tutorials/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2016 Intel Corporation ## 3 | ## ## 4 | ## Licensed under the Apache License, Version 2.0 (the "License"); ## 5 | ## you may not use this file except in compliance with the License. ## 6 | ## You may obtain a copy of the License at ## 7 | ## ## 8 | ## http://www.apache.org/licenses/LICENSE-2.0 ## 9 | ## ## 10 | ## Unless required by applicable law or agreed to in writing, software ## 11 | ## distributed under the License is distributed on an "AS IS" BASIS, ## 12 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ## 13 | ## See the License for the specific language governing permissions and ## 14 | ## limitations under the License. ## 15 | ## ======================================================================== ## 16 | 17 | ADD_SUBDIRECTORY(common) 18 | 19 | ADD_SUBDIRECTORY(verify) 20 | ADD_SUBDIRECTORY(triangle_geometry) 21 | ADD_SUBDIRECTORY(dynamic_scene) 22 | ADD_SUBDIRECTORY(user_geometry) 23 | ADD_SUBDIRECTORY(viewer) 24 | ADD_SUBDIRECTORY(instanced_geometry) 25 | ADD_SUBDIRECTORY(intersection_filter) 26 | ADD_SUBDIRECTORY(pathtracer) 27 | ADD_SUBDIRECTORY(hair_geometry) 28 | ADD_SUBDIRECTORY(subdivision_geometry) 29 | ADD_SUBDIRECTORY(displacement_geometry) 30 | ADD_SUBDIRECTORY(bvh_builder) 31 | ADD_SUBDIRECTORY(lazy_geometry) 32 | ADD_SUBDIRECTORY(bvh_access) 33 | ADD_SUBDIRECTORY(motion_blur_geometry) 34 | ADD_SUBDIRECTORY(interpolation) 35 | ADD_SUBDIRECTORY(convert) 36 | ADD_SUBDIRECTORY(curve_geometry) 37 | ADD_SUBDIRECTORY(buildbench) 38 | 39 | IF (EMBREE_RAY_PACKETS) 40 | ADD_SUBDIRECTORY(viewer_stream) 41 | ENDIF() 42 | 43 | # propagate menu links up 44 | SET(CPACK_NSIS_MENU_LINKS ${CPACK_NSIS_MENU_LINKS} PARENT_SCOPE) 45 | 46 | -------------------------------------------------------------------------------- /tutorials/buildbench/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2016 Intel Corporation ## 3 | ## ## 4 | ## Licensed under the Apache License, Version 2.0 (the "License"); ## 5 | ## you may not use this file except in compliance with the License. ## 6 | ## You may obtain a copy of the License at ## 7 | ## ## 8 | ## http://www.apache.org/licenses/LICENSE-2.0 ## 9 | ## ## 10 | ## Unless required by applicable law or agreed to in writing, software ## 11 | ## distributed under the License is distributed on an "AS IS" BASIS, ## 12 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ## 13 | ## See the License for the specific language governing permissions and ## 14 | ## limitations under the License. ## 15 | ## ======================================================================== ## 16 | INCLUDE(basictutorial) 17 | ADD_TUTORIAL(buildbench) 18 | -------------------------------------------------------------------------------- /tutorials/buildbench/buildbench.cpp: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #include "../common/tutorial/tutorial.h" 18 | 19 | namespace embree 20 | { 21 | extern "C" { int g_instancing_mode = 0; } 22 | 23 | struct Tutorial : public SceneLoadingTutorialApplication 24 | { 25 | Tutorial() 26 | : SceneLoadingTutorialApplication("build_bench",FEATURE_RTCORE) 27 | { 28 | interactive = false; 29 | } 30 | 31 | void postParseCommandLine() 32 | { 33 | /* load default scene if none specified */ 34 | if (sceneFilename.ext() == "") { 35 | FileName file = FileName::executableFolder() + FileName("models/cornell_box.ecs"); 36 | parseCommandLine(new ParseStream(new LineCommentFilter(file, "#")), file.path()); 37 | } 38 | 39 | g_instancing_mode = instancing_mode; 40 | } 41 | }; 42 | 43 | } 44 | 45 | int main(int argc, char** argv) { 46 | return embree::Tutorial().main(argc,argv); 47 | } 48 | -------------------------------------------------------------------------------- /tutorials/bvh_access/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2016 Intel Corporation ## 3 | ## ## 4 | ## Licensed under the Apache License, Version 2.0 (the "License"); ## 5 | ## you may not use this file except in compliance with the License. ## 6 | ## You may obtain a copy of the License at ## 7 | ## ## 8 | ## http://www.apache.org/licenses/LICENSE-2.0 ## 9 | ## ## 10 | ## Unless required by applicable law or agreed to in writing, software ## 11 | ## distributed under the License is distributed on an "AS IS" BASIS, ## 12 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ## 13 | ## See the License for the specific language governing permissions and ## 14 | ## limitations under the License. ## 15 | ## ======================================================================== ## 16 | 17 | ADD_EXECUTABLE(bvh_access bvh_access.cpp) 18 | TARGET_LINK_LIBRARIES(bvh_access embree) 19 | SET_PROPERTY(TARGET bvh_access PROPERTY FOLDER tutorials/single) 20 | INSTALL(TARGETS bvh_access DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT examples) 21 | ADD_TEST(NAME bvh_access COMMAND bvh_access) 22 | -------------------------------------------------------------------------------- /tutorials/bvh_builder/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2016 Intel Corporation ## 3 | ## ## 4 | ## Licensed under the Apache License, Version 2.0 (the "License"); ## 5 | ## you may not use this file except in compliance with the License. ## 6 | ## You may obtain a copy of the License at ## 7 | ## ## 8 | ## http://www.apache.org/licenses/LICENSE-2.0 ## 9 | ## ## 10 | ## Unless required by applicable law or agreed to in writing, software ## 11 | ## distributed under the License is distributed on an "AS IS" BASIS, ## 12 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ## 13 | ## See the License for the specific language governing permissions and ## 14 | ## limitations under the License. ## 15 | ## ======================================================================== ## 16 | 17 | SET(EMBREE_ISPC_SUPPORT OFF) 18 | 19 | IF (TASKING_TBB) 20 | SET(ADDITIONAL_LIBRARIES ${TBB_LIBRARIES}) 21 | ENDIF() 22 | 23 | INCLUDE(tutorial) 24 | ADD_TUTORIAL(bvh_builder) 25 | ADD_TEST(NAME bvh_builder COMMAND bvh_builder) 26 | -------------------------------------------------------------------------------- /tutorials/bvh_builder/bvh_builder.cpp: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #include "../common/tutorial/tutorial.h" 18 | 19 | namespace embree 20 | { 21 | struct Tutorial : public TutorialApplication 22 | { 23 | Tutorial() 24 | : TutorialApplication("bvh_builder",FEATURE_RTCORE) 25 | { 26 | interactive = false; 27 | } 28 | }; 29 | 30 | } 31 | 32 | int main(int argc, char** argv) { 33 | return embree::Tutorial().main(argc,argv); 34 | } 35 | -------------------------------------------------------------------------------- /tutorials/common/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2016 Intel Corporation ## 3 | ## ## 4 | ## Licensed under the Apache License, Version 2.0 (the "License"); ## 5 | ## you may not use this file except in compliance with the License. ## 6 | ## You may obtain a copy of the License at ## 7 | ## ## 8 | ## http://www.apache.org/licenses/LICENSE-2.0 ## 9 | ## ## 10 | ## Unless required by applicable law or agreed to in writing, software ## 11 | ## distributed under the License is distributed on an "AS IS" BASIS, ## 12 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ## 13 | ## See the License for the specific language governing permissions and ## 14 | ## limitations under the License. ## 15 | ## ======================================================================== ## 16 | 17 | ADD_SUBDIRECTORY(image) 18 | #ADD_SUBDIRECTORY(transport) 19 | ADD_SUBDIRECTORY(tutorial) 20 | ADD_SUBDIRECTORY(scenegraph) 21 | ADD_SUBDIRECTORY(lights) 22 | ADD_SUBDIRECTORY(texture) 23 | -------------------------------------------------------------------------------- /tutorials/common/common.isph: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #pragma once 18 | 19 | typedef unsigned int64 uint64; 20 | typedef unsigned int32 uint32; 21 | typedef unsigned int16 uint16; 22 | typedef unsigned int8 uint8; 23 | -------------------------------------------------------------------------------- /tutorials/common/core/differential_geometry.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #pragma once 18 | 19 | #include "../math/vec.h" 20 | 21 | namespace embree { 22 | 23 | struct DifferentialGeometry 24 | { 25 | int geomID; 26 | int primID; 27 | float u,v; 28 | Vec3fa P; 29 | Vec3fa Ng; 30 | Vec3fa Ns; 31 | Vec3fa Tx; //direction along hair 32 | Vec3fa Ty; 33 | float tnear_eps; 34 | }; 35 | 36 | } // namespace embree 37 | -------------------------------------------------------------------------------- /tutorials/common/core/differential_geometry.isph: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #pragma once 18 | 19 | #include "../math/vec.isph" 20 | 21 | struct DifferentialGeometry 22 | { 23 | int geomID; 24 | int primID; 25 | float u,v; 26 | Vec3f P; 27 | Vec3f Ng; 28 | Vec3f Ns; 29 | Vec3f Tx; //direction along hair 30 | Vec3f Ty; 31 | float tnear_eps; 32 | }; 33 | -------------------------------------------------------------------------------- /tutorials/common/default.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #pragma once 18 | 19 | #include "../../common/sys/platform.h" 20 | #include "../../common/sys/ref.h" 21 | #include "../../common/sys/vector.h" 22 | #include "../../common/math/vec2.h" 23 | #include "../../common/math/vec3.h" 24 | #include "../../common/math/vec4.h" 25 | #include "../../common/math/bbox.h" 26 | #include "../../common/math/lbbox.h" 27 | #include "../../common/math/affinespace.h" 28 | #include "../../common/sys/filename.h" 29 | #include "../../common/sys/string.h" 30 | #include "../../common/lexers/tokenstream.h" 31 | #include "../../common/lexers/streamfilters.h" 32 | #include "../../common/lexers/parsestream.h" 33 | 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | 40 | -------------------------------------------------------------------------------- /tutorials/common/freeglut/LICENSE.txt: -------------------------------------------------------------------------------- 1 | 2 | Freeglut Copyright 3 | ------------------ 4 | 5 | Freeglut code without an explicit copyright is covered by the following 6 | copyright: 7 | 8 | Copyright (c) 1999-2000 Pawel W. Olszta. All Rights Reserved. 9 | Permission is hereby granted, free of charge, to any person obtaining a copy 10 | of this software and associated documentation files (the "Software"), to deal 11 | in the Software without restriction, including without limitation the rights 12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | copies or substantial portions of the Software. 14 | 15 | The above copyright notice and this permission notice shall be included in 16 | all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 21 | PAWEL W. OLSZTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 22 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 23 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | 25 | Except as contained in this notice, the name of Pawel W. Olszta shall not be 26 | used in advertising or otherwise to promote the sale, use or other dealings 27 | in this Software without prior written authorization from Pawel W. Olszta. 28 | -------------------------------------------------------------------------------- /tutorials/common/freeglut/Win32/freeglut.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marty1885/embree-arm/60651db1eb56a5ef2c9c56e49eeca175ff05a112/tutorials/common/freeglut/Win32/freeglut.dll -------------------------------------------------------------------------------- /tutorials/common/freeglut/Win32/freeglut.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marty1885/embree-arm/60651db1eb56a5ef2c9c56e49eeca175ff05a112/tutorials/common/freeglut/Win32/freeglut.lib -------------------------------------------------------------------------------- /tutorials/common/freeglut/include/GL/freeglut.h: -------------------------------------------------------------------------------- 1 | #ifndef __FREEGLUT_H__ 2 | #define __FREEGLUT_H__ 3 | 4 | /* 5 | * freeglut.h 6 | * 7 | * The freeglut library include file 8 | * 9 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 10 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 11 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 12 | * PAWEL W. OLSZTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 13 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 14 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | */ 16 | 17 | #include "freeglut_std.h" 18 | #include "freeglut_ext.h" 19 | 20 | /*** END OF FILE ***/ 21 | 22 | #endif /* __FREEGLUT_H__ */ 23 | -------------------------------------------------------------------------------- /tutorials/common/freeglut/include/GL/glut.h: -------------------------------------------------------------------------------- 1 | #ifndef __GLUT_H__ 2 | #define __GLUT_H__ 3 | 4 | /* 5 | * glut.h 6 | * 7 | * The freeglut library include file 8 | * 9 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 10 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 11 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 12 | * PAWEL W. OLSZTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 13 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 14 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | */ 16 | 17 | #include "freeglut_std.h" 18 | 19 | /*** END OF FILE ***/ 20 | 21 | #endif /* __GLUT_H__ */ 22 | -------------------------------------------------------------------------------- /tutorials/common/freeglut/x64/freeglut.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marty1885/embree-arm/60651db1eb56a5ef2c9c56e49eeca175ff05a112/tutorials/common/freeglut/x64/freeglut.dll -------------------------------------------------------------------------------- /tutorials/common/freeglut/x64/freeglut.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marty1885/embree-arm/60651db1eb56a5ef2c9c56e49eeca175ff05a112/tutorials/common/freeglut/x64/freeglut.lib -------------------------------------------------------------------------------- /tutorials/common/lights/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2016 Intel Corporation ## 3 | ## ## 4 | ## Licensed under the Apache License, Version 2.0 (the "License"); ## 5 | ## you may not use this file except in compliance with the License. ## 6 | ## You may obtain a copy of the License at ## 7 | ## ## 8 | ## http://www.apache.org/licenses/LICENSE-2.0 ## 9 | ## ## 10 | ## Unless required by applicable law or agreed to in writing, software ## 11 | ## distributed under the License is distributed on an "AS IS" BASIS, ## 12 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ## 13 | ## See the License for the specific language governing permissions and ## 14 | ## limitations under the License. ## 15 | ## ======================================================================== ## 16 | 17 | ADD_LIBRARY(lights STATIC 18 | light.cpp 19 | ambient_light.cpp 20 | directional_light.cpp 21 | point_light.cpp 22 | quad_light.cpp 23 | spot_light.cpp 24 | ) 25 | TARGET_LINK_LIBRARIES(lights sys) 26 | SET_PROPERTY(TARGET lights PROPERTY FOLDER tutorials/common) 27 | 28 | IF (EMBREE_ISPC_SUPPORT) 29 | ADD_ISPC_LIBRARY(lights_ispc STATIC 30 | light.ispc 31 | ambient_light.ispc 32 | directional_light.ispc 33 | point_light.ispc 34 | quad_light.ispc 35 | spot_light.ispc 36 | ) 37 | TARGET_LINK_LIBRARIES(lights_ispc sys) 38 | SET_TARGET_PROPERTIES(lights_ispc PROPERTIES LINKER_LANGUAGE C) 39 | SET_PROPERTY(TARGET lights_ispc PROPERTY FOLDER tutorials/common) 40 | ENDIF() 41 | -------------------------------------------------------------------------------- /tutorials/common/lights/ambient_light.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #pragma once 18 | 19 | #include "../math/vec.h" 20 | 21 | namespace embree 22 | { 23 | extern "C" void* AmbientLight_create(); 24 | 25 | extern "C" void AmbientLight_set(void* super, 26 | const Vec3fa& radiance); 27 | } 28 | -------------------------------------------------------------------------------- /tutorials/common/lights/directional_light.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #pragma once 18 | 19 | #include "../math/vec.h" 20 | 21 | namespace embree 22 | { 23 | extern "C" void* DirectionalLight_create(); 24 | 25 | extern "C" void DirectionalLight_set(void* super, 26 | const Vec3fa& direction, 27 | const Vec3fa& radiance, 28 | float cosAngle); 29 | } 30 | -------------------------------------------------------------------------------- /tutorials/common/lights/light.cpp: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #include "light.h" 18 | 19 | namespace embree { 20 | 21 | Light_EvalRes Light_eval(const Light* uniform, 22 | const DifferentialGeometry&, 23 | const Vec3fa&) 24 | { 25 | Light_EvalRes res; 26 | res.value = Vec3fa(0.f); 27 | res.dist = inf; 28 | res.pdf = 0.f; 29 | return res; 30 | } 31 | extern "C" void dummy() {} // just to avoid linker warning under MacOSX 32 | 33 | } // namespace embree 34 | -------------------------------------------------------------------------------- /tutorials/common/lights/light.ispc: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #include "light.isph" 18 | 19 | Light_EvalRes Light_eval(const uniform Light* uniform, 20 | const DifferentialGeometry&, 21 | const Vec3f&) 22 | { 23 | Light_EvalRes res; 24 | res.value = make_Vec3f(0.f); 25 | res.dist = inf; 26 | res.pdf = 0.f; 27 | return res; 28 | } 29 | export void dummy() {} // just to avoid linker warning under MacOSX 30 | -------------------------------------------------------------------------------- /tutorials/common/lights/point_light.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #pragma once 18 | 19 | #include "../math/vec.h" 20 | 21 | namespace embree 22 | { 23 | extern "C" void* PointLight_create(); 24 | 25 | extern "C" void PointLight_set(void* super, 26 | const Vec3fa& position, 27 | const Vec3fa& power, 28 | float radius); 29 | } 30 | -------------------------------------------------------------------------------- /tutorials/common/lights/quad_light.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #pragma once 18 | 19 | #include "../math/vec.h" 20 | 21 | namespace embree 22 | { 23 | extern "C" void* QuadLight_create(); 24 | 25 | extern "C" void QuadLight_set(void* super, 26 | const Vec3fa& position, 27 | const Vec3fa& edge2, 28 | const Vec3fa& edge1, 29 | const Vec3fa& radiance); 30 | } 31 | 32 | -------------------------------------------------------------------------------- /tutorials/common/lights/spot_light.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #pragma once 18 | 19 | #include "../math/vec.h" 20 | 21 | namespace embree 22 | { 23 | extern "C" void* SpotLight_create(); 24 | 25 | extern "C" void SpotLight_set(void* super, 26 | const Vec3fa& position, 27 | const Vec3fa& direction, 28 | const Vec3fa& power, 29 | float cosAngleMax, 30 | float cosAngleScale, 31 | float radius); 32 | } 33 | -------------------------------------------------------------------------------- /tutorials/common/math/affinespace.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #pragma once 18 | 19 | #include "../../../common/math/affinespace.h" 20 | 21 | namespace embree 22 | { 23 | __forceinline bool eq (const AffineSpace3fa& a, const AffineSpace3fa& b) { return a == b; } 24 | } 25 | 26 | -------------------------------------------------------------------------------- /tutorials/common/math/linearspace.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #pragma once 18 | 19 | #include "../../../common/math/linearspace3.h" 20 | 21 | -------------------------------------------------------------------------------- /tutorials/common/math/math.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #pragma once 18 | 19 | #include "../../../common/math/math.h" 20 | -------------------------------------------------------------------------------- /tutorials/common/scenegraph/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2016 Intel Corporation ## 3 | ## ## 4 | ## Licensed under the Apache License, Version 2.0 (the "License"); ## 5 | ## you may not use this file except in compliance with the License. ## 6 | ## You may obtain a copy of the License at ## 7 | ## ## 8 | ## http://www.apache.org/licenses/LICENSE-2.0 ## 9 | ## ## 10 | ## Unless required by applicable law or agreed to in writing, software ## 11 | ## distributed under the License is distributed on an "AS IS" BASIS, ## 12 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ## 13 | ## See the License for the specific language governing permissions and ## 14 | ## limitations under the License. ## 15 | ## ======================================================================== ## 16 | 17 | ADD_LIBRARY(scenegraph STATIC 18 | xml_parser.cpp 19 | xml_loader.cpp 20 | xml_writer.cpp 21 | obj_loader.cpp 22 | ply_loader.cpp 23 | hair_loader.cpp 24 | corona_loader.cpp 25 | texture.cpp 26 | scenegraph.cpp) 27 | 28 | TARGET_LINK_LIBRARIES(scenegraph sys lexers image) 29 | SET_PROPERTY(TARGET scenegraph PROPERTY FOLDER tutorials/common) 30 | -------------------------------------------------------------------------------- /tutorials/common/scenegraph/corona_loader.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #pragma once 18 | 19 | #include "scenegraph.h" 20 | 21 | namespace embree 22 | { 23 | namespace SceneGraph 24 | { 25 | Ref loadCorona(const FileName& fileName, const AffineSpace3fa& space = one); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /tutorials/common/scenegraph/hair_loader.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #pragma once 18 | 19 | #include "scenegraph.h" 20 | 21 | namespace embree 22 | { 23 | namespace SceneGraph 24 | { 25 | Ref loadBinHair(const FileName& fileName); 26 | Ref loadTxtHair(const FileName& fileName); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /tutorials/common/scenegraph/obj_loader.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #pragma once 18 | 19 | #include "scenegraph.h" 20 | 21 | namespace embree 22 | { 23 | Ref loadOBJ(const FileName& fileName, const bool subdivMode = false); 24 | } 25 | -------------------------------------------------------------------------------- /tutorials/common/scenegraph/ply_loader.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #pragma once 18 | 19 | #include "scenegraph.h" 20 | 21 | namespace embree 22 | { 23 | namespace SceneGraph 24 | { 25 | Ref loadPLY(const FileName& fileName); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /tutorials/common/scenegraph/texture.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #pragma once 18 | 19 | #include "../default.h" 20 | #include "../image/image.h" 21 | 22 | namespace embree 23 | { 24 | struct Texture // FIXME: should be derived from SceneGraph::Node 25 | { 26 | enum Format { 27 | INVALID = 0, 28 | RGBA8 = 1, 29 | RGB8 = 2, 30 | FLOAT32 = 3, 31 | }; 32 | 33 | public: 34 | Texture (); 35 | Texture (Ref image, const std::string fileName); 36 | Texture (unsigned width, unsigned height, const Format format, const char* in = nullptr); 37 | ~Texture (); 38 | 39 | static const char* format_to_string(const Format format); 40 | static Format string_to_format(const std::string& str); 41 | static unsigned getFormatBytesPerTexel(const Format format); 42 | 43 | static Texture* load(const FileName& fileName); // FIXME: return reference 44 | 45 | public: 46 | unsigned width; 47 | unsigned height; 48 | Format format; 49 | unsigned bytesPerTexel; 50 | unsigned width_mask; 51 | unsigned height_mask; 52 | void* data; 53 | std::string fileName; 54 | }; 55 | } 56 | -------------------------------------------------------------------------------- /tutorials/common/scenegraph/xml_loader.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #pragma once 18 | 19 | #include "scenegraph.h" 20 | 21 | namespace embree 22 | { 23 | namespace SceneGraph 24 | { 25 | Ref loadXML(const FileName& fileName, const AffineSpace3fa& space = one); 26 | } 27 | } 28 | 29 | -------------------------------------------------------------------------------- /tutorials/common/scenegraph/xml_writer.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #pragma once 18 | 19 | #include "scenegraph.h" 20 | 21 | namespace embree 22 | { 23 | namespace SceneGraph 24 | { 25 | void storeXML(Ref root, const FileName& fileName, bool embedTextures); 26 | } 27 | } 28 | 29 | -------------------------------------------------------------------------------- /tutorials/common/texture/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2016 Intel Corporation ## 3 | ## ## 4 | ## Licensed under the Apache License, Version 2.0 (the "License"); ## 5 | ## you may not use this file except in compliance with the License. ## 6 | ## You may obtain a copy of the License at ## 7 | ## ## 8 | ## http://www.apache.org/licenses/LICENSE-2.0 ## 9 | ## ## 10 | ## Unless required by applicable law or agreed to in writing, software ## 11 | ## distributed under the License is distributed on an "AS IS" BASIS, ## 12 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ## 13 | ## See the License for the specific language governing permissions and ## 14 | ## limitations under the License. ## 15 | ## ======================================================================== ## 16 | 17 | ADD_LIBRARY(texture STATIC 18 | texture2d.cpp 19 | ) 20 | TARGET_LINK_LIBRARIES(texture sys) 21 | SET_PROPERTY(TARGET texture PROPERTY FOLDER tutorials/common) 22 | 23 | IF (EMBREE_ISPC_SUPPORT) 24 | ADD_ISPC_LIBRARY(texture_ispc STATIC 25 | texture2d.ispc 26 | ) 27 | TARGET_LINK_LIBRARIES(texture_ispc sys) 28 | SET_TARGET_PROPERTIES(texture_ispc PROPERTIES LINKER_LANGUAGE C) 29 | SET_PROPERTY(TARGET texture_ispc PROPERTY FOLDER tutorials/common) 30 | ENDIF() 31 | -------------------------------------------------------------------------------- /tutorials/common/texture/texture.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | /*! This header is shared with ISPC. */ 18 | #pragma once 19 | 20 | /*! Embree format constants for Texture creation */ 21 | typedef enum { 22 | TEXTURE_RGBA8, 23 | TEXTURE_SRGBA, 24 | TEXTURE_RGBA32F, 25 | TEXTURE_RGB8, 26 | TEXTURE_SRGB, 27 | TEXTURE_RGB32F, 28 | TEXTURE_R8, 29 | TEXTURE_R32F, 30 | /* TODO 31 | LogLuv, 32 | RGBA16F 33 | RGB16F 34 | RGBE, // radiance hdr 35 | compressed (RGTC, BPTC, ETC, ...) 36 | */ 37 | } TextureFormat; 38 | 39 | /*! flags that can be passed to ospNewTexture2D(); can be OR'ed together */ 40 | typedef enum { 41 | TEXTURE_SHARED_BUFFER = (1<<0), 42 | TEXTURE_FILTER_NEAREST = (1<<1) /*!< use nearest-neighbor interpolation rather than the default bilinear interpolation */ 43 | } TextureCreationFlags; 44 | 45 | -------------------------------------------------------------------------------- /tutorials/common/tutorial/camera.isph: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #pragma once 18 | 19 | #include "../math/affinespace.isph" 20 | 21 | struct ISPCCamera 22 | { 23 | AffineSpace3fa xfm; 24 | }; 25 | -------------------------------------------------------------------------------- /tutorials/common/tutorial/noise.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #pragma once 18 | 19 | #include "../math/vec.h" 20 | 21 | namespace embree 22 | { 23 | /* noise functions */ 24 | float noise(const Vec3fa& p); 25 | Vec3fa noise3D(const Vec3fa& p); 26 | } 27 | -------------------------------------------------------------------------------- /tutorials/common/tutorial/noise.isph: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #pragma once 18 | 19 | #include "../math/vec.isph" 20 | 21 | /* noise functions */ 22 | float noise(const Vec3f& p); 23 | Vec3f noise3D(const Vec3f& p); 24 | -------------------------------------------------------------------------------- /tutorials/convert/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2016 Intel Corporation ## 3 | ## ## 4 | ## Licensed under the Apache License, Version 2.0 (the "License"); ## 5 | ## you may not use this file except in compliance with the License. ## 6 | ## You may obtain a copy of the License at ## 7 | ## ## 8 | ## http://www.apache.org/licenses/LICENSE-2.0 ## 9 | ## ## 10 | ## Unless required by applicable law or agreed to in writing, software ## 11 | ## distributed under the License is distributed on an "AS IS" BASIS, ## 12 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ## 13 | ## See the License for the specific language governing permissions and ## 14 | ## limitations under the License. ## 15 | ## ======================================================================== ## 16 | 17 | ADD_EXECUTABLE(convert convert.cpp distribution1d.cpp distribution2d.cpp) 18 | TARGET_LINK_LIBRARIES(convert scenegraph image) 19 | SET_PROPERTY(TARGET convert PROPERTY FOLDER tutorials/single) 20 | INSTALL(TARGETS convert DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT examples) 21 | -------------------------------------------------------------------------------- /tutorials/convert/default.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #pragma once 18 | 19 | #include "../../common/sys/platform.h" 20 | #include "../../common/sys/ref.h" 21 | #include "../../common/sys/vector.h" 22 | #include "../../common/math/vec2.h" 23 | #include "../../common/math/vec3.h" 24 | #include "../../common/math/affinespace.h" 25 | #include "../../common/sys/filename.h" 26 | #include "../../common/sys/string.h" 27 | #include "../common/tutorial/tutorial.h" 28 | -------------------------------------------------------------------------------- /tutorials/curve_geometry/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2016 Intel Corporation ## 3 | ## ## 4 | ## Licensed under the Apache License, Version 2.0 (the "License"); ## 5 | ## you may not use this file except in compliance with the License. ## 6 | ## You may obtain a copy of the License at ## 7 | ## ## 8 | ## http://www.apache.org/licenses/LICENSE-2.0 ## 9 | ## ## 10 | ## Unless required by applicable law or agreed to in writing, software ## 11 | ## distributed under the License is distributed on an "AS IS" BASIS, ## 12 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ## 13 | ## See the License for the specific language governing permissions and ## 14 | ## limitations under the License. ## 15 | ## ======================================================================== ## 16 | 17 | INCLUDE(tutorial) 18 | ADD_TUTORIAL(curve_geometry) 19 | ADD_EMBREE_TEST(curve_geometry) 20 | -------------------------------------------------------------------------------- /tutorials/curve_geometry/curve_geometry.cpp: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #include "../common/tutorial/tutorial.h" 18 | 19 | namespace embree 20 | { 21 | struct Tutorial : public TutorialApplication 22 | { 23 | Tutorial() 24 | : TutorialApplication("curve_geometry",FEATURE_RTCORE) 25 | { 26 | /* set default camera */ 27 | camera.from = Vec3fa(2.244145155f, 1.310973883f, 0.09447964281f); 28 | camera.to = Vec3fa(0.0f,0.0f,0.0f); 29 | } 30 | }; 31 | 32 | } 33 | 34 | int main(int argc, char** argv) { 35 | return embree::Tutorial().main(argc,argv); 36 | } 37 | -------------------------------------------------------------------------------- /tutorials/displacement_geometry/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2016 Intel Corporation ## 3 | ## ## 4 | ## Licensed under the Apache License, Version 2.0 (the "License"); ## 5 | ## you may not use this file except in compliance with the License. ## 6 | ## You may obtain a copy of the License at ## 7 | ## ## 8 | ## http://www.apache.org/licenses/LICENSE-2.0 ## 9 | ## ## 10 | ## Unless required by applicable law or agreed to in writing, software ## 11 | ## distributed under the License is distributed on an "AS IS" BASIS, ## 12 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ## 13 | ## See the License for the specific language governing permissions and ## 14 | ## limitations under the License. ## 15 | ## ======================================================================== ## 16 | 17 | INCLUDE(tutorial) 18 | ADD_TUTORIAL(displacement_geometry) 19 | ADD_EMBREE_TEST(displacement_geometry) 20 | 21 | -------------------------------------------------------------------------------- /tutorials/displacement_geometry/displacement_geometry.cpp: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #include "../common/tutorial/tutorial.h" 18 | 19 | namespace embree 20 | { 21 | struct Tutorial : public TutorialApplication 22 | { 23 | Tutorial() 24 | : TutorialApplication("displacement_geometry",FEATURE_RTCORE) 25 | { 26 | /* set default camera */ 27 | camera.from = Vec3fa(1.5f,1.5f,-1.5f); 28 | camera.to = Vec3fa(0.0f,0.0f,0.0f); 29 | } 30 | }; 31 | 32 | } 33 | 34 | int main(int argc, char** argv) { 35 | return embree::Tutorial().main(argc,argv); 36 | } 37 | -------------------------------------------------------------------------------- /tutorials/dynamic_scene/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2016 Intel Corporation ## 3 | ## ## 4 | ## Licensed under the Apache License, Version 2.0 (the "License"); ## 5 | ## you may not use this file except in compliance with the License. ## 6 | ## You may obtain a copy of the License at ## 7 | ## ## 8 | ## http://www.apache.org/licenses/LICENSE-2.0 ## 9 | ## ## 10 | ## Unless required by applicable law or agreed to in writing, software ## 11 | ## distributed under the License is distributed on an "AS IS" BASIS, ## 12 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ## 13 | ## See the License for the specific language governing permissions and ## 14 | ## limitations under the License. ## 15 | ## ======================================================================== ## 16 | 17 | INCLUDE(tutorial) 18 | ADD_TUTORIAL(dynamic_scene) 19 | ADD_EMBREE_TEST(dynamic_scene) 20 | -------------------------------------------------------------------------------- /tutorials/dynamic_scene/dynamic_scene.cpp: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #include "../common/tutorial/tutorial.h" 18 | 19 | namespace embree 20 | { 21 | struct Tutorial : public TutorialApplication 22 | { 23 | Tutorial() 24 | : TutorialApplication("dynamic_scene",FEATURE_RTCORE) 25 | { 26 | /* set start camera */ 27 | camera.from = Vec3f(2,2,2); 28 | camera.to = Vec3f(0,0,0); 29 | } 30 | }; 31 | 32 | } 33 | 34 | int main(int argc, char** argv) { 35 | return embree::Tutorial().main(argc,argv); 36 | } 37 | -------------------------------------------------------------------------------- /tutorials/find_embree/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2016 Intel Corporation ## 3 | ## ## 4 | ## Licensed under the Apache License, Version 2.0 (the "License"); ## 5 | ## you may not use this file except in compliance with the License. ## 6 | ## You may obtain a copy of the License at ## 7 | ## ## 8 | ## http://www.apache.org/licenses/LICENSE-2.0 ## 9 | ## ## 10 | ## Unless required by applicable law or agreed to in writing, software ## 11 | ## distributed under the License is distributed on an "AS IS" BASIS, ## 12 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ## 13 | ## See the License for the specific language governing permissions and ## 14 | ## limitations under the License. ## 15 | ## ======================================================================== ## 16 | 17 | PROJECT(find_embree) 18 | CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11) 19 | 20 | FIND_PACKAGE(embree 2.0 REQUIRED) 21 | 22 | INCLUDE_DIRECTORIES(${EMBREE_INCLUDE_DIRS}) 23 | ADD_EXECUTABLE(find_embree find_embree.cpp) 24 | TARGET_LINK_LIBRARIES(find_embree ${EMBREE_LIBRARY}) 25 | 26 | OPTION(EMBREE_ISPC_SUPPORT "Build Embree with support for ISPC applications." OFF) 27 | 28 | # this configures the ADD_EMBREE_ISPC_EXECUTABLE from Embree 29 | IF (EMBREE_ISPC_SUPPORT) 30 | SET(ISPC_TARGETS "sse2;sse4;avx;avx2") 31 | SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../common/cmake ${CMAKE_MODULE_PATH}) 32 | INCLUDE(ispc) 33 | 34 | INCLUDE_DIRECTORIES_ISPC(${EMBREE_INCLUDE_DIRS}) 35 | ADD_EMBREE_ISPC_EXECUTABLE(find_embree_ispc find_embree_ispc.cpp find_embree_ispc.ispc) 36 | TARGET_LINK_LIBRARIES(find_embree_ispc ${EMBREE_LIBRARY}) 37 | ENDIF() 38 | -------------------------------------------------------------------------------- /tutorials/find_embree/find_embree.cpp: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #include 18 | 19 | #include 20 | //#include // use this to get _MM_SET_DENORMALS_ZERO_MODE when compiling for SSE3 or higher 21 | 22 | #if !defined(_MM_SET_DENORMALS_ZERO_MODE) 23 | #define _MM_DENORMALS_ZERO_ON (0x0040) 24 | #define _MM_DENORMALS_ZERO_OFF (0x0000) 25 | #define _MM_DENORMALS_ZERO_MASK (0x0040) 26 | #define _MM_SET_DENORMALS_ZERO_MODE(x) (_mm_setcsr((_mm_getcsr() & ~_MM_DENORMALS_ZERO_MASK) | (x))) 27 | #endif 28 | 29 | int main(int argc, char* argv[]) 30 | { 31 | /* for best performance set FTZ and DAZ flags in MXCSR control and status register */ 32 | _MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON); 33 | _MM_SET_DENORMALS_ZERO_MODE(_MM_DENORMALS_ZERO_ON); 34 | 35 | /* create new Embree device */ 36 | RTCDevice device = rtcNewDevice("verbose=1"); 37 | 38 | /* ddelete device again */ 39 | rtcDeleteDevice(device); 40 | 41 | return 0; 42 | } 43 | -------------------------------------------------------------------------------- /tutorials/find_embree/find_embree_ispc.cpp: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #include 18 | 19 | #include 20 | //#include // use this to get _MM_SET_DENORMALS_ZERO_MODE when compiling for SSE3 or higher 21 | 22 | #if !defined(_MM_SET_DENORMALS_ZERO_MODE) 23 | #define _MM_DENORMALS_ZERO_ON (0x0040) 24 | #define _MM_DENORMALS_ZERO_OFF (0x0000) 25 | #define _MM_DENORMALS_ZERO_MASK (0x0040) 26 | #define _MM_SET_DENORMALS_ZERO_MODE(x) (_mm_setcsr((_mm_getcsr() & ~_MM_DENORMALS_ZERO_MASK) | (x))) 27 | #endif 28 | 29 | extern "C" void ispcEntry(); 30 | 31 | int main(int argc, char* argv[]) 32 | { 33 | /* for best performance set FTZ and DAZ flags in MXCSR control and status register */ 34 | _MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON); 35 | _MM_SET_DENORMALS_ZERO_MODE(_MM_DENORMALS_ZERO_ON); 36 | 37 | ispcEntry(); 38 | 39 | return 0; 40 | } 41 | -------------------------------------------------------------------------------- /tutorials/find_embree/find_embree_ispc.ispc: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #include 18 | 19 | export void ispcEntry() 20 | { 21 | /* create new Embree device */ 22 | RTCDevice device = rtcNewDevice(); 23 | 24 | /* delete Embree device again */ 25 | rtcDeleteDevice(device); 26 | } 27 | -------------------------------------------------------------------------------- /tutorials/hair_geometry/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2016 Intel Corporation ## 3 | ## ## 4 | ## Licensed under the Apache License, Version 2.0 (the "License"); ## 5 | ## you may not use this file except in compliance with the License. ## 6 | ## You may obtain a copy of the License at ## 7 | ## ## 8 | ## http://www.apache.org/licenses/LICENSE-2.0 ## 9 | ## ## 10 | ## Unless required by applicable law or agreed to in writing, software ## 11 | ## distributed under the License is distributed on an "AS IS" BASIS, ## 12 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ## 13 | ## See the License for the specific language governing permissions and ## 14 | ## limitations under the License. ## 15 | ## ======================================================================== ## 16 | 17 | INCLUDE(tutorial) 18 | ADD_TUTORIAL(hair_geometry) 19 | ADD_EMBREE_TEST(hair_geometry) 20 | -------------------------------------------------------------------------------- /tutorials/instanced_geometry/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2016 Intel Corporation ## 3 | ## ## 4 | ## Licensed under the Apache License, Version 2.0 (the "License"); ## 5 | ## you may not use this file except in compliance with the License. ## 6 | ## You may obtain a copy of the License at ## 7 | ## ## 8 | ## http://www.apache.org/licenses/LICENSE-2.0 ## 9 | ## ## 10 | ## Unless required by applicable law or agreed to in writing, software ## 11 | ## distributed under the License is distributed on an "AS IS" BASIS, ## 12 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ## 13 | ## See the License for the specific language governing permissions and ## 14 | ## limitations under the License. ## 15 | ## ======================================================================== ## 16 | 17 | INCLUDE(tutorial) 18 | ADD_TUTORIAL(instanced_geometry) 19 | ADD_EMBREE_TEST(instanced_geometry) 20 | ADD_EMBREE_TEST2(instanced_geometry_stream_coherent instanced_geometry "--mode stream-coherent") 21 | ADD_EMBREE_TEST2(instanced_geometry_stream_incoherent instanced_geometry "--mode stream-incoherent") 22 | -------------------------------------------------------------------------------- /tutorials/instanced_geometry/instanced_geometry.cpp: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #include "../common/tutorial/tutorial.h" 18 | 19 | namespace embree 20 | { 21 | struct Tutorial : public TutorialApplication 22 | { 23 | Tutorial() 24 | : TutorialApplication("instanced_geometry", FEATURE_RTCORE | FEATURE_STREAM) 25 | { 26 | /* set default camera */ 27 | camera.from = Vec3fa(2.5f,2.5f,2.5f); 28 | camera.to = Vec3fa(0.0f,0.0f,0.0f); 29 | } 30 | }; 31 | 32 | } 33 | 34 | int main(int argc, char** argv) { 35 | return embree::Tutorial().main(argc,argv); 36 | } 37 | -------------------------------------------------------------------------------- /tutorials/interpolation/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2016 Intel Corporation ## 3 | ## ## 4 | ## Licensed under the Apache License, Version 2.0 (the "License"); ## 5 | ## you may not use this file except in compliance with the License. ## 6 | ## You may obtain a copy of the License at ## 7 | ## ## 8 | ## http://www.apache.org/licenses/LICENSE-2.0 ## 9 | ## ## 10 | ## Unless required by applicable law or agreed to in writing, software ## 11 | ## distributed under the License is distributed on an "AS IS" BASIS, ## 12 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ## 13 | ## See the License for the specific language governing permissions and ## 14 | ## limitations under the License. ## 15 | ## ======================================================================== ## 16 | 17 | INCLUDE(tutorial) 18 | ADD_TUTORIAL(interpolation) 19 | ADD_EMBREE_TEST(interpolation) 20 | -------------------------------------------------------------------------------- /tutorials/interpolation/interpolation.cpp: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #include "../common/tutorial/tutorial.h" 18 | 19 | namespace embree 20 | { 21 | struct Tutorial : public TutorialApplication 22 | { 23 | Tutorial() 24 | : TutorialApplication("interpolation",FEATURE_RTCORE) 25 | { 26 | /* set default camera */ 27 | camera.from = Vec3fa(9.0f,4.0f,1.0f); 28 | camera.to = Vec3fa(0.0f,0.0f,1.0f); 29 | } 30 | }; 31 | 32 | } 33 | 34 | int main(int argc, char** argv) { 35 | return embree::Tutorial().main(argc,argv); 36 | } 37 | -------------------------------------------------------------------------------- /tutorials/intersection_filter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2016 Intel Corporation ## 3 | ## ## 4 | ## Licensed under the Apache License, Version 2.0 (the "License"); ## 5 | ## you may not use this file except in compliance with the License. ## 6 | ## You may obtain a copy of the License at ## 7 | ## ## 8 | ## http://www.apache.org/licenses/LICENSE-2.0 ## 9 | ## ## 10 | ## Unless required by applicable law or agreed to in writing, software ## 11 | ## distributed under the License is distributed on an "AS IS" BASIS, ## 12 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ## 13 | ## See the License for the specific language governing permissions and ## 14 | ## limitations under the License. ## 15 | ## ======================================================================== ## 16 | 17 | INCLUDE(tutorial) 18 | ADD_TUTORIAL(intersection_filter) 19 | ADD_EMBREE_TEST(intersection_filter) 20 | ADD_EMBREE_TEST2(intersection_filter_stream_coherent intersection_filter "--mode stream-coherent") 21 | ADD_EMBREE_TEST2(intersection_filter_stream_incoherent intersection_filter "--mode stream-incoherent") 22 | -------------------------------------------------------------------------------- /tutorials/intersection_filter/intersection_filter.cpp: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #include "../common/tutorial/tutorial.h" 18 | 19 | namespace embree 20 | { 21 | struct Tutorial : public TutorialApplication 22 | { 23 | Tutorial() 24 | : TutorialApplication("intersection_filter",FEATURE_RTCORE | FEATURE_STREAM) 25 | { 26 | /* set default camera */ 27 | camera.from = Vec3fa(1.4f,1.3f,-1.5f); 28 | camera.to = Vec3fa(0.0f,0.0f,0.0f); 29 | } 30 | }; 31 | } 32 | 33 | int main(int argc, char** argv) { 34 | return embree::Tutorial().main(argc,argv); 35 | } 36 | -------------------------------------------------------------------------------- /tutorials/lazy_geometry/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2016 Intel Corporation ## 3 | ## ## 4 | ## Licensed under the Apache License, Version 2.0 (the "License"); ## 5 | ## you may not use this file except in compliance with the License. ## 6 | ## You may obtain a copy of the License at ## 7 | ## ## 8 | ## http://www.apache.org/licenses/LICENSE-2.0 ## 9 | ## ## 10 | ## Unless required by applicable law or agreed to in writing, software ## 11 | ## distributed under the License is distributed on an "AS IS" BASIS, ## 12 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ## 13 | ## See the License for the specific language governing permissions and ## 14 | ## limitations under the License. ## 15 | ## ======================================================================== ## 16 | 17 | INCLUDE(tutorial) 18 | ADD_TUTORIAL(lazy_geometry) 19 | ADD_EMBREE_TEST(lazy_geometry) 20 | -------------------------------------------------------------------------------- /tutorials/lazy_geometry/lazy_geometry.cpp: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #include "../common/tutorial/tutorial.h" 18 | 19 | namespace embree 20 | { 21 | struct Tutorial : public TutorialApplication 22 | { 23 | Tutorial() 24 | : TutorialApplication("intersection_filter",FEATURE_RTCORE) 25 | { 26 | /* set default camera */ 27 | camera.from = Vec3fa(2.5f,2.5f,2.5f); 28 | camera.to = Vec3fa(0.0f,0.0f,0.0f); 29 | } 30 | }; 31 | 32 | } 33 | 34 | int main(int argc, char** argv) { 35 | return embree::Tutorial().main(argc,argv); 36 | } 37 | -------------------------------------------------------------------------------- /tutorials/models/cornell_box.ecs: -------------------------------------------------------------------------------- 1 | -i cornell_box.obj 2 | -pointlight 213 300 227 100000 100000 100000 3 | -vp 278 273 -800 -vi 278 273 0 -vu 0 1 0 -fov 37 4 | -------------------------------------------------------------------------------- /tutorials/models/cornell_box.mtl: -------------------------------------------------------------------------------- 1 | newmtl white 2 | Ka 0 0 0 3 | Kd 1 1 1 4 | Ks 0 0 0 5 | 6 | newmtl red 7 | Ka 0 0 0 8 | Kd 1 0 0 9 | Ks 0 0 0 10 | 11 | newmtl green 12 | Ka 0 0 0 13 | Kd 0 1 0 14 | Ks 0 0 0 15 | 16 | newmtl blue 17 | Ka 0 0 0 18 | Kd 0 0 1 19 | Ks 0 0 0 20 | 21 | newmtl light 22 | Ka 20 20 20 23 | Kd 1 1 1 24 | Ks 0 0 0 25 | -------------------------------------------------------------------------------- /tutorials/models/curve0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -20 0 -20 8 | -20 0 +20 9 | +20 0 +20 10 | +20 0 -20 11 | 12 | 13 | 0 2 1 14 | 0 3 2 15 | 16 | 17 | "OBJ" 18 | 19 | 1 1 1 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 0 0 0 0.3 28 | 0 1 0 0.3 29 | 0 1 1 0.3 30 | 1 1 1 0.3 31 | 2 1 1 0.3 32 | 2 3 1 0.3 33 | 4 3 1 0.1 34 | 4 0 1 0.1 35 | 2 1 2 0.5 36 | 2 2 5 0.7 37 | 38 | 5 0 0 0.3 39 | 5 1 0 0.3 40 | 5 2 0 0.0 41 | nan nan nan nan 42 | 43 | 5 0 -2 3.0 44 | 5 1 -2 0.3 45 | 5 2 -2 0.0 46 | nan nan nan nan 47 | 48 | 49 | 50 | 1 2 3 4 5 6 7 51 | 11 52 | 15 53 | 54 | 55 | 56 | "OBJ" 57 | 58 | 1 1 1 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 0 0 -2 0.2 68 | 8 4 -2 0.2 69 | -4 4 -2 0.2 70 | 4 0 -3 0.2 71 | 72 | 73 | 74 | 0 0 75 | 76 | 77 | 78 | "OBJ" 79 | 80 | 1 0 0 81 | 82 | 83 | 84 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /tutorials/models/curve1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -20 0 -20 8 | -20 0 +20 9 | +20 0 +20 10 | +20 0 -20 11 | 12 | 13 | 0 2 1 14 | 0 3 2 15 | 16 | 17 | "OBJ" 18 | 19 | 1 1 1 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -2.0 1.0 -1.0 0.2 28 | +0.0 0.0 +0.0 0.2 29 | +2.0 1.0 +1.0 0.2 30 | +2.0 1.0 -1.0 0.6 31 | +0.0 +2.0 +0.0 0.2 32 | -2.0 1.0 +1.0 0.2 33 | -2.0 1.0 -1.0 0.2 34 | +0.0 0.0 +0.0 0.2 35 | +2.0 1.0 +1.0 0.2 36 | 37 | 38 | 39 | 1 2 3 4 5 6 40 | 41 | 42 | 43 | "OBJ" 44 | 45 | 1 1 1 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /tutorials/models/linesegments.ecs: -------------------------------------------------------------------------------- 1 | -i linesegments.xml 2 | -vp 9.850966454 6.304291725 -2.479717255 -vi 5.498634815 5.664068222 1.207814217 -vu 0 1 0 -fov 90 3 | -dirlight 1 -1 1 3 3 3 4 | 5 | -------------------------------------------------------------------------------- /tutorials/models/linesegments.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -20 0 -20 8 | -20 0 +20 9 | +20 0 +20 10 | +20 0 -20 11 | 12 | 13 | 0 2 1 14 | 0 3 2 15 | 16 | 17 | "OBJ" 18 | 19 | 1 1 1 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 33 | 34 | 42 | 43 | 0 -4 0 0.02 44 | 0 0 0 0.02 45 | 0 5 0 1 46 | 5 5 0 1 47 | 5 5 5 1 48 | 5 10 5 2 49 | 5 10 3 0 50 | 51 | 52 | 53 | 54 | 0 1 2 3 4 5 55 | 56 | 57 | 58 | "OBJ" 59 | 60 | 1 1 1 61 | 62 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /tutorials/models/subdiv0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -1.0 0.0 -1.0 9 | 0.0 0.0 -1.0 10 | +1.0 0.0 -1.0 11 | -1.0 1.0 0.0 12 | 0.0 1.0 0.0 13 | +1.0 1.0 0.0 14 | -1.0 0.0 +1.0 15 | 0.0 0.0 +1.0 16 | +1.0 0.0 +1.0 17 | 18 | 19 | 20 | 0 1 4 3 21 | 1 2 5 4 22 | 3 4 7 6 23 | 4 5 8 7 24 | 25 | 26 | 27 | 4 4 4 4 28 | 29 | 30 | 31 | 3 4 4 5 32 | 33 | 34 | 35 | 1 10 36 | 37 | 38 | 39 | 0 2 6 8 40 | 41 | 42 | 43 | 0 +inf 0 +inf 44 | 45 | 46 | 47 | "OBJ" 48 | 49 | 1 1 1 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /tutorials/models/subdiv1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -1.0 -1.0 -1.0 9 | 1.0 -1.0 -1.0 10 | 1.0 -1.0 1.0 11 | -1.0 -1.0 1.0 12 | -1.0 1.0 -1.0 13 | 1.0 1.0 -1.0 14 | 1.0 1.0 1.0 15 | -1.0 1.0 1.0 16 | 17 | 18 | 19 | 0 1 5 4 20 | 1 2 6 5 21 | 2 3 7 6 22 | 0 4 7 3 23 | 4 5 6 7 24 | 0 3 2 1 25 | 26 | 27 | 28 | 4 4 4 4 4 4 29 | 30 | 31 | 32 | "OBJ" 33 | 34 | 1 1 1 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /tutorials/models/subdiv2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -1.0 -1.0 -1.0 9 | 1.0 -1.0 -1.0 10 | 1.0 -1.0 1.0 11 | -1.0 -1.0 1.0 12 | -1.0 1.0 -1.0 13 | 1.0 1.0 -1.0 14 | 1.0 1.0 1.0 15 | -1.0 1.0 1.0 16 | 17 | 18 | 19 | 0 1 5 4 20 | 1 2 6 5 21 | 2 3 7 6 22 | 0 4 7 3 23 | 4 5 6 7 24 | 0 3 2 1 25 | 26 | 27 | 28 | 4 4 4 4 4 4 29 | 30 | 31 | 32 | 0 1 1 2 2 3 3 0 33 | 4 5 5 6 6 7 7 4 34 | 35 | 36 | 37 | 4 4 4 4 38 | 4 4 4 4 39 | 40 | 41 | 42 | "OBJ" 43 | 44 | 1 1 1 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /tutorials/models/subdiv3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -1.0 -1.0 -1.0 9 | 1.0 -1.0 -1.0 10 | 1.0 -1.0 1.0 11 | -1.0 -1.0 1.0 12 | -1.0 1.0 -1.0 13 | 1.0 1.0 -1.0 14 | 1.0 1.0 1.0 15 | -1.0 1.0 1.0 16 | 17 | 18 | 19 | 0 1 4 5 20 | 1 2 6 5 21 | 2 3 7 6 22 | 0 4 7 3 23 | 4 5 6 7 24 | 0 3 2 1 25 | 26 | 27 | 28 | 4 4 4 4 4 4 29 | 30 | 31 | 32 | 0 33 | 34 | 35 | 36 | "OBJ" 37 | 38 | 1 1 1 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /tutorials/models/subdiv4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0.0 0.0 +1.0 10 | 0.0 0.0 -1.0 11 | 12 | +1.0 0.0 +1.0 13 | +1.0 0.0 -1.0 14 | 15 | -1.0 0.0 +1.0 16 | -1.0 0.0 -1.0 17 | 18 | 0.0 +1.0 +1.0 19 | 0.0 +1.0 -1.0 20 | 21 | 0.0 -1.0 +1.0 22 | 0.0 -1.0 -1.0 23 | 24 | 25 | 26 | 27 | 2 3 1 0 28 | 4 5 1 0 29 | 6 7 1 0 30 | 8 9 1 0 31 | 32 | 33 | 34 | 4 4 4 4 35 | 36 | 37 | 38 | "OBJ" 39 | 40 | 1 1 1 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /tutorials/models/subdiv6.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -1.0 -1.0 0.0 9 | 0.0 -1.0 0.0 10 | +1.0 -1.0 0.0 11 | +2.0 -1.0 0.0 12 | 13 | -1.0 0.0 0.0 14 | 0.0 0.0 0.0 15 | +1.0 0.0 0.0 16 | +2.0 0.0 0.0 17 | 18 | -1.0 +1.0 0.0 19 | 0.0 +1.0 0.0 20 | +1.0 +1.0 0.0 21 | +2.0 +1.0 0.0 22 | 23 | -1.0 +2.0 0.0 24 | 0.0 +2.0 0.0 25 | +1.0 +2.0 0.0 26 | +2.0 +2.0 0.0 27 | 28 | 29 | 30 | 31 | 0 1 5 4 32 | 1 2 6 5 33 | 2 3 7 6 34 | 4 5 9 8 35 | 5 6 10 9 36 | 6 7 11 10 37 | 8 9 13 12 38 | 9 10 14 13 39 | 10 11 15 14 40 | 41 | 42 | 43 | 4 4 4 4 4 4 4 4 4 44 | 45 | 46 | 47 | "OBJ" 48 | 49 | 1 1 1 50 | 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /tutorials/models/subdiv7.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -1.0 -1.0 0.0 9 | 0.0 -1.0 0.0 10 | +1.0 -1.0 0.0 11 | +2.0 -1.0 0.0 12 | 13 | -1.0 0.0 0.0 14 | 0.0 0.0 0.0 15 | +1.0 0.0 0.0 16 | +2.0 0.0 0.0 17 | 18 | -1.0 +1.0 0.0 19 | 0.0 +1.0 0.0 20 | +1.0 +1.0 0.0 21 | +2.0 +1.0 0.0 22 | 23 | -1.0 +2.0 0.0 24 | 0.0 +2.0 0.0 25 | +1.0 +2.0 0.0 26 | +2.0 +2.0 0.0 27 | 28 | 29 | 30 | 31 | 0 1 5 4 32 | 1 2 6 5 33 | 2 3 7 6 34 | 4 5 9 8 35 | 6 7 11 10 36 | 8 9 13 12 37 | 9 10 14 13 38 | 10 11 15 14 39 | 40 | 41 | 42 | 4 4 4 4 4 4 4 4 43 | 44 | 45 | 46 | 0 3 12 15 47 | 5 6 9 10 48 | 49 | 50 | 51 | +inf +inf +inf +inf 52 | +inf +inf +inf +inf 53 | 54 | 55 | 56 | "OBJ" 57 | 58 | 1 1 1 59 | 60 | 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /tutorials/models/subdiv8.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -1.0 -1.0 0.0 9 | 0.0 -1.0 0.0 10 | +1.0 -1.0 0.0 11 | +2.0 -1.0 0.0 12 | 13 | -1.0 0.0 0.0 14 | 0.0 0.0 0.0 15 | +1.0 0.0 0.0 16 | +2.0 0.0 0.0 17 | 18 | -1.0 +1.0 0.0 19 | 0.0 +1.0 0.0 20 | +1.0 +1.0 0.0 21 | +2.0 +1.0 0.0 22 | 23 | -1.0 +2.0 0.0 24 | 0.0 +2.0 0.0 25 | +1.0 +2.0 0.0 26 | +2.0 +2.0 0.0 27 | 28 | 29 | 30 | 31 | 1 2 6 5 32 | 4 5 9 8 33 | 5 6 10 9 34 | 6 7 11 10 35 | 9 10 14 13 36 | 37 | 38 | 39 | 4 4 4 4 4 40 | 41 | 42 | 43 | "OBJ" 44 | 45 | 1 1 1 46 | 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /tutorials/models/subdiv9.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -1.0 -1.0 0.0 9 | 0.0 -1.0 0.0 10 | +1.0 -1.0 0.0 11 | +2.0 -1.0 0.0 12 | 13 | -1.0 0.0 0.0 14 | 0.0 0.0 0.0 15 | +1.0 0.0 0.0 16 | +2.0 0.0 0.0 17 | 18 | -1.0 +1.0 0.0 19 | 0.0 +1.0 0.0 20 | +1.0 +1.0 0.0 21 | +2.0 +1.0 0.0 22 | 23 | -1.0 +2.0 0.0 24 | 0.0 +2.0 0.0 25 | +1.0 +2.0 0.0 26 | +2.0 +2.0 0.0 27 | 28 | 29 | 30 | 31 | 0 1 5 4 32 | 33 | 34 | 35 | 4 36 | 37 | 38 | 39 | "OBJ" 40 | 41 | 1 1 1 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /tutorials/motion_blur_geometry/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2016 Intel Corporation ## 3 | ## ## 4 | ## Licensed under the Apache License, Version 2.0 (the "License"); ## 5 | ## you may not use this file except in compliance with the License. ## 6 | ## You may obtain a copy of the License at ## 7 | ## ## 8 | ## http://www.apache.org/licenses/LICENSE-2.0 ## 9 | ## ## 10 | ## Unless required by applicable law or agreed to in writing, software ## 11 | ## distributed under the License is distributed on an "AS IS" BASIS, ## 12 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ## 13 | ## See the License for the specific language governing permissions and ## 14 | ## limitations under the License. ## 15 | ## ======================================================================== ## 16 | 17 | INCLUDE(tutorial) 18 | ADD_TUTORIAL(motion_blur_geometry) 19 | ADD_EMBREE_TEST2(motion_blur_geometry motion_blur_geometry "--time 0.5") 20 | -------------------------------------------------------------------------------- /tutorials/osp2emb.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo Converting OSPRay code $1 to Embree code $2 4 | cp $1 $2 5 | 6 | sed -i.backup 's/math.ih/math.isph/g' $2 7 | sed -i.backup 's/ospray\/math\/vec.ih/..\/math\/vec.isph/g' $2 8 | sed -i.backup 's/Light.ih/light.isph/g' $2 9 | sed -i.backup 's/ospray\/common\/OSPCommon.ih/..\/common.isph/g' $2 10 | sed -i.backup 's/ospray\/math\/sampling.ih/..\/math\/sampling.isph/g' $2 11 | sed -i.backup 's/ospray\/math\/LinearSpace.ih/..\/math\/linearspace.isph/g' $2 12 | sed -i.backup 's/ospray\/common\/DifferentialGeometry.ih/..\/core\/differential_geometry.isph/g' $2 13 | sed -i.backup 's/ospray\/OSPTexture.h/texture.h/g' $2 14 | sed -i.backup 's/Texture2D.ih/texture2d.isph/g' $2 15 | 16 | sed -i.backup 's/vec2/Vec2/g' $2 17 | sed -i.backup 's/vec3/Vec3/g' $2 18 | sed -i.backup 's/vec4/Vec4/g' $2 19 | sed -i.backup 's/linear3/LinearSpace3/g' $2 20 | 21 | sed -i.backup 's/OSPRay/Embree/g' $2 22 | sed -i.backup 's/OSP_//g' $2 23 | sed -i.backup 's/OSPTexture/Texture/g' $2 24 | 25 | sed -i.backup 's/floatbits(0x7F800000)/(1e100f)/g' $2 26 | sed -i.backup 's/floatbits(0xFF800000)/(-1e100f)/g' $2 27 | -------------------------------------------------------------------------------- /tutorials/pathtracer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2016 Intel Corporation ## 3 | ## ## 4 | ## Licensed under the Apache License, Version 2.0 (the "License"); ## 5 | ## you may not use this file except in compliance with the License. ## 6 | ## You may obtain a copy of the License at ## 7 | ## ## 8 | ## http://www.apache.org/licenses/LICENSE-2.0 ## 9 | ## ## 10 | ## Unless required by applicable law or agreed to in writing, software ## 11 | ## distributed under the License is distributed on an "AS IS" BASIS, ## 12 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ## 13 | ## See the License for the specific language governing permissions and ## 14 | ## limitations under the License. ## 15 | ## ======================================================================== ## 16 | 17 | INCLUDE(tutorial) 18 | ADD_TUTORIAL(pathtracer) 19 | ADD_EMBREE_MODELS_TEST(pathtracer pathtracer pathtracer) 20 | -------------------------------------------------------------------------------- /tutorials/pathtracer/pathtracer.cpp: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #include "../common/tutorial/tutorial.h" 18 | 19 | namespace embree 20 | { 21 | extern "C" { int g_instancing_mode = 0; } 22 | 23 | struct Tutorial : public SceneLoadingTutorialApplication 24 | { 25 | Tutorial() 26 | : SceneLoadingTutorialApplication("pathtracer",FEATURE_RTCORE) {} 27 | 28 | void postParseCommandLine() 29 | { 30 | /* load default scene if none specified */ 31 | if (scene->size() == 0 && sceneFilename.ext() == "") { 32 | FileName file = FileName::executableFolder() + FileName("models/cornell_box.ecs"); 33 | parseCommandLine(new ParseStream(new LineCommentFilter(file, "#")), file.path()); 34 | } 35 | 36 | g_instancing_mode = instancing_mode; 37 | } 38 | }; 39 | 40 | } 41 | 42 | int main(int argc, char** argv) { 43 | return embree::Tutorial().main(argc,argv); 44 | } 45 | -------------------------------------------------------------------------------- /tutorials/subdivision_geometry/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2016 Intel Corporation ## 3 | ## ## 4 | ## Licensed under the Apache License, Version 2.0 (the "License"); ## 5 | ## you may not use this file except in compliance with the License. ## 6 | ## You may obtain a copy of the License at ## 7 | ## ## 8 | ## http://www.apache.org/licenses/LICENSE-2.0 ## 9 | ## ## 10 | ## Unless required by applicable law or agreed to in writing, software ## 11 | ## distributed under the License is distributed on an "AS IS" BASIS, ## 12 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ## 13 | ## See the License for the specific language governing permissions and ## 14 | ## limitations under the License. ## 15 | ## ======================================================================== ## 16 | 17 | INCLUDE(tutorial) 18 | ADD_TUTORIAL(subdivision_geometry) 19 | ADD_EMBREE_TEST(subdivision_geometry) 20 | -------------------------------------------------------------------------------- /tutorials/subdivision_geometry/subdivision_geometry.cpp: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #include "../common/tutorial/tutorial.h" 18 | 19 | namespace embree 20 | { 21 | struct Tutorial : public TutorialApplication 22 | { 23 | Tutorial() 24 | : TutorialApplication("subdivision_geometry",FEATURE_RTCORE) 25 | { 26 | /* set default camera */ 27 | camera.from = Vec3fa(1.5f,1.5f,-1.5f); 28 | camera.to = Vec3fa(0.0f,0.0f,0.0f); 29 | } 30 | }; 31 | 32 | } 33 | 34 | int main(int argc, char** argv) { 35 | return embree::Tutorial().main(argc,argv); 36 | } 37 | -------------------------------------------------------------------------------- /tutorials/triangle_geometry/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2016 Intel Corporation ## 3 | ## ## 4 | ## Licensed under the Apache License, Version 2.0 (the "License"); ## 5 | ## you may not use this file except in compliance with the License. ## 6 | ## You may obtain a copy of the License at ## 7 | ## ## 8 | ## http://www.apache.org/licenses/LICENSE-2.0 ## 9 | ## ## 10 | ## Unless required by applicable law or agreed to in writing, software ## 11 | ## distributed under the License is distributed on an "AS IS" BASIS, ## 12 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ## 13 | ## See the License for the specific language governing permissions and ## 14 | ## limitations under the License. ## 15 | ## ======================================================================== ## 16 | 17 | INCLUDE(tutorial) 18 | ADD_TUTORIAL(triangle_geometry) 19 | ADD_EMBREE_TEST(triangle_geometry) 20 | -------------------------------------------------------------------------------- /tutorials/triangle_geometry/triangle_geometry.cpp: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #include "../common/tutorial/tutorial.h" 18 | 19 | namespace embree 20 | { 21 | struct Tutorial : public TutorialApplication 22 | { 23 | Tutorial() 24 | : TutorialApplication("triangle_geometry",FEATURE_RTCORE) 25 | { 26 | /* set default camera */ 27 | camera.from = Vec3fa(1.5f,1.5f,-1.5f); 28 | camera.to = Vec3fa(0.0f,0.0f,0.0f); 29 | } 30 | }; 31 | 32 | } 33 | 34 | int main(int argc, char** argv) { 35 | return embree::Tutorial().main(argc,argv); 36 | } 37 | -------------------------------------------------------------------------------- /tutorials/user_geometry/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2016 Intel Corporation ## 3 | ## ## 4 | ## Licensed under the Apache License, Version 2.0 (the "License"); ## 5 | ## you may not use this file except in compliance with the License. ## 6 | ## You may obtain a copy of the License at ## 7 | ## ## 8 | ## http://www.apache.org/licenses/LICENSE-2.0 ## 9 | ## ## 10 | ## Unless required by applicable law or agreed to in writing, software ## 11 | ## distributed under the License is distributed on an "AS IS" BASIS, ## 12 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ## 13 | ## See the License for the specific language governing permissions and ## 14 | ## limitations under the License. ## 15 | ## ======================================================================== ## 16 | 17 | INCLUDE(tutorial) 18 | ADD_TUTORIAL(user_geometry) 19 | ADD_EMBREE_TEST(user_geometry) 20 | ADD_EMBREE_TEST2(user_geometry_stream_coherent user_geometry "--mode stream-coherent") 21 | ADD_EMBREE_TEST2(user_geometry_stream_incoherent user_geometry "--mode stream-incoherent") 22 | -------------------------------------------------------------------------------- /tutorials/user_geometry/user_geometry.cpp: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #include "../common/tutorial/tutorial.h" 18 | 19 | namespace embree 20 | { 21 | struct Tutorial : public TutorialApplication 22 | { 23 | Tutorial() 24 | : TutorialApplication("user_geometry",FEATURE_RTCORE | FEATURE_STREAM) 25 | { 26 | /* set default camera */ 27 | camera.from = Vec3fa(2.5f,2.5f,2.5f); 28 | camera.to = Vec3fa(0.0f,0.0f,0.0f); 29 | } 30 | }; 31 | 32 | } 33 | 34 | int main(int argc, char** argv) { 35 | return embree::Tutorial().main(argc,argv); 36 | } 37 | -------------------------------------------------------------------------------- /tutorials/viewer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2016 Intel Corporation ## 3 | ## ## 4 | ## Licensed under the Apache License, Version 2.0 (the "License"); ## 5 | ## you may not use this file except in compliance with the License. ## 6 | ## You may obtain a copy of the License at ## 7 | ## ## 8 | ## http://www.apache.org/licenses/LICENSE-2.0 ## 9 | ## ## 10 | ## Unless required by applicable law or agreed to in writing, software ## 11 | ## distributed under the License is distributed on an "AS IS" BASIS, ## 12 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ## 13 | ## See the License for the specific language governing permissions and ## 14 | ## limitations under the License. ## 15 | ## ======================================================================== ## 16 | 17 | INCLUDE(tutorial) 18 | ADD_TUTORIAL(viewer) 19 | ADD_EMBREE_MODELS_TEST(viewer viewer viewer) 20 | ADD_EMBREE_MODELS_TEST(viewer_quad viewer viewer -convert-triangles-to-quads) 21 | ADD_EMBREE_SUBDIV_MODELS_TEST(viewer viewer viewer viewer) 22 | 23 | IF (EMBREE_TESTING_INTENSIVE) 24 | ADD_EMBREE_MODELS_TEST(viewer_static_scene viewer viewer viewer -rtcore flags=static) 25 | ADD_EMBREE_MODELS_TEST(viewer_dynamic_scene viewer viewer viewer -rtcore flags=dynamic) 26 | ADD_EMBREE_MODELS_TEST(viewer_high_quality_scene viewer viewer viewer -rtcore flags=high_quality) 27 | ADD_EMBREE_MODELS_TEST(viewer_robust_scene viewer viewer viewer -rtcore flags=robust) 28 | ADD_EMBREE_MODELS_TEST(viewer_compact_scene viewer viewer viewer -rtcore flags=compact) 29 | ENDIF() 30 | 31 | -------------------------------------------------------------------------------- /tutorials/viewer/viewer.cpp: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #include "../common/tutorial/tutorial.h" 18 | 19 | namespace embree 20 | { 21 | extern "C" { int g_instancing_mode = 0; } 22 | 23 | struct Tutorial : public SceneLoadingTutorialApplication 24 | { 25 | Tutorial() 26 | : SceneLoadingTutorialApplication("viewer",FEATURE_RTCORE) {} 27 | 28 | void postParseCommandLine() 29 | { 30 | /* load default scene if none specified */ 31 | if (scene->size() == 0 && sceneFilename.ext() == "") { 32 | FileName file = FileName::executableFolder() + FileName("models/cornell_box.ecs"); 33 | parseCommandLine(new ParseStream(new LineCommentFilter(file, "#")), file.path()); 34 | } 35 | 36 | g_instancing_mode = instancing_mode; 37 | } 38 | }; 39 | 40 | } 41 | 42 | int main(int argc, char** argv) { 43 | return embree::Tutorial().main(argc,argv); 44 | } 45 | -------------------------------------------------------------------------------- /tutorials/viewer_stream/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2016 Intel Corporation ## 3 | ## ## 4 | ## Licensed under the Apache License, Version 2.0 (the "License"); ## 5 | ## you may not use this file except in compliance with the License. ## 6 | ## You may obtain a copy of the License at ## 7 | ## ## 8 | ## http://www.apache.org/licenses/LICENSE-2.0 ## 9 | ## ## 10 | ## Unless required by applicable law or agreed to in writing, software ## 11 | ## distributed under the License is distributed on an "AS IS" BASIS, ## 12 | ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ## 13 | ## See the License for the specific language governing permissions and ## 14 | ## limitations under the License. ## 15 | ## ======================================================================== ## 16 | 17 | INCLUDE(tutorial) 18 | ADD_TUTORIAL(viewer_stream) 19 | 20 | 21 | -------------------------------------------------------------------------------- /tutorials/viewer_stream/viewer_stream.cpp: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2016 Intel Corporation // 3 | // // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); // 5 | // you may not use this file except in compliance with the License. // 6 | // You may obtain a copy of the License at // 7 | // // 8 | // http://www.apache.org/licenses/LICENSE-2.0 // 9 | // // 10 | // Unless required by applicable law or agreed to in writing, software // 11 | // distributed under the License is distributed on an "AS IS" BASIS, // 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // 13 | // See the License for the specific language governing permissions and // 14 | // limitations under the License. // 15 | // ======================================================================== // 16 | 17 | #include "../common/tutorial/tutorial.h" 18 | 19 | namespace embree 20 | { 21 | extern "C" { int g_instancing_mode = 0; } 22 | 23 | struct Tutorial : public SceneLoadingTutorialApplication 24 | { 25 | Tutorial() 26 | : SceneLoadingTutorialApplication("viewer_stream",FEATURE_RTCORE) {} 27 | 28 | void postParseCommandLine() 29 | { 30 | /* load default scene if none specified */ 31 | if (sceneFilename.ext() == "") { 32 | FileName file = FileName::executableFolder() + FileName("models/cornell_box.ecs"); 33 | parseCommandLine(new ParseStream(new LineCommentFilter(file, "#")), file.path()); 34 | } 35 | 36 | g_instancing_mode = instancing_mode; 37 | } 38 | }; 39 | 40 | } 41 | 42 | int main(int argc, char** argv) { 43 | return embree::Tutorial().main(argc,argv); 44 | } 45 | --------------------------------------------------------------------------------