├── common ├── cmake │ ├── rpm_ldconfig.sh │ ├── create_isa_dummy_file.cmake │ ├── FindPNG.cmake │ ├── embree-config-builddir.cmake │ ├── crayprgenv.cmake │ ├── embree-config-version.cmake │ ├── check_globals.cmake │ ├── msvc_post.cmake │ ├── check_isa_default.cmake │ ├── check_stack_frame_size.cmake │ └── check_isa.cpp ├── simd │ ├── CMakeLists.txt │ ├── avx.h │ └── sse.h ├── CMakeLists.txt ├── lexers │ ├── CMakeLists.txt │ └── stringstream.h ├── tasking │ ├── taskscheduler.h │ └── CMakeLists.txt ├── algorithms │ └── CMakeLists.txt └── sys │ ├── CMakeLists.txt │ ├── library.h │ ├── string.cpp │ ├── regression.h │ ├── string.h │ ├── condition.h │ └── regression.cpp ├── tutorials ├── models │ ├── subdiv0.ecs │ ├── subdiv1.ecs │ ├── subdiv6.ecs │ ├── subdiv7.ecs │ ├── subdiv8.ecs │ ├── subdiv9.ecs │ ├── cylinder.ecs │ ├── subdiv_pin_all.ecs │ ├── subdiv_pin_corners.ecs │ ├── subdiv_no_boundary.ecs │ ├── subdiv_pin_boundary.ecs │ ├── subdiv_smooth_boundary.ecs │ ├── cornell_box.xml.bin │ ├── subdiv4.ecs │ ├── cornell_box.ecs │ ├── hair0.ecs │ ├── subdiv5.ecs │ ├── subdiv3.ecs │ ├── linesegments.ecs │ ├── cornell_box.mtl │ ├── subdiv1.xml │ ├── subdiv3.xml │ ├── subdiv4.xml │ ├── subdiv9.xml │ ├── subdiv8.xml │ ├── subdiv6.xml │ ├── curve1.xml │ ├── subdiv0.xml │ ├── linesegments.xml │ ├── subdiv7.xml │ ├── subdiv_no_boundary.xml │ ├── cylinder.xml │ ├── curve0.xml │ └── hair0.xml ├── common │ ├── freeglut │ │ ├── Win32 │ │ │ ├── freeglut.dll │ │ │ └── freeglut.lib │ │ ├── x64 │ │ │ ├── freeglut.dll │ │ │ └── freeglut.lib │ │ ├── include │ │ │ └── GL │ │ │ │ ├── glut.h │ │ │ │ └── freeglut.h │ │ └── LICENSE.txt │ ├── math │ │ ├── math.h │ │ ├── linearspace.h │ │ └── affinespace.h │ ├── tutorial │ │ ├── camera.isph │ │ ├── noise.isph │ │ └── noise.h │ ├── common.isph │ ├── CMakeLists.txt │ ├── scenegraph │ │ ├── ply_loader.h │ │ ├── xml_loader.h │ │ ├── xml_writer.h │ │ ├── corona_loader.h │ │ ├── obj_loader.h │ │ └── CMakeLists.txt │ ├── lights │ │ ├── ambient_light.h │ │ ├── point_light.h │ │ ├── light.ispc │ │ ├── directional_light.h │ │ ├── quad_light.h │ │ ├── light.cpp │ │ ├── spot_light.h │ │ └── CMakeLists.txt │ ├── core │ │ ├── differential_geometry.isph │ │ └── differential_geometry.h │ ├── texture │ │ ├── CMakeLists.txt │ │ └── texture.h │ └── default.h ├── osp2emb.sh ├── viewer_anim │ ├── CMakeLists.txt │ └── viewer_anim.cpp ├── viewer_stream │ ├── CMakeLists.txt │ └── viewer_stream.cpp ├── buildbench │ ├── CMakeLists.txt │ └── buildbench.cpp ├── dynamic_scene │ ├── CMakeLists.txt │ └── dynamic_scene.cpp ├── hair_geometry │ └── CMakeLists.txt ├── interpolation │ ├── CMakeLists.txt │ └── interpolation.cpp ├── lazy_geometry │ ├── CMakeLists.txt │ └── lazy_geometry.cpp ├── curve_geometry │ ├── CMakeLists.txt │ └── curve_geometry.cpp ├── triangle_geometry │ ├── CMakeLists.txt │ └── triangle_geometry.cpp ├── pathtracer │ ├── CMakeLists.txt │ └── pathtracer.cpp ├── subdivision_geometry │ ├── CMakeLists.txt │ └── subdivision_geometry.cpp ├── displacement_geometry │ ├── CMakeLists.txt │ └── displacement_geometry.cpp ├── motion_blur_geometry │ └── CMakeLists.txt ├── bvh_builder │ ├── CMakeLists.txt │ └── bvh_builder.cpp ├── find_embree │ ├── find_embree_ispc.ispc │ ├── find_embree_ispc.cpp │ ├── CMakeLists.txt │ └── find_embree.cpp ├── convert │ ├── CMakeLists.txt │ └── default.h ├── bvh_access │ └── CMakeLists.txt ├── user_geometry │ ├── CMakeLists.txt │ └── user_geometry.cpp ├── instanced_geometry │ ├── CMakeLists.txt │ └── instanced_geometry.cpp ├── intersection_filter │ ├── CMakeLists.txt │ └── intersection_filter.cpp ├── viewer │ ├── viewer.cpp │ └── CMakeLists.txt └── CMakeLists.txt ├── .gitignore ├── readme.pdf ├── scripts ├── install_windows │ └── icon32.ico ├── package_win.bat ├── klocwork.sh ├── package_macosx.sh ├── install_linux │ ├── embree-vars.sh │ └── embree-vars.csh ├── install_macosx │ ├── embree-vars.sh │ ├── embree-vars.csh │ └── uninstall.command ├── benchmark_instancing.sh ├── check_symbols.sh └── release_macosx.sh ├── kernels ├── export.linux.map ├── export.macosx.map ├── embree.rc ├── hash.h.in ├── rtcore_version.h.in ├── bvh │ ├── bvh_factory.h │ └── bvh_rotate.h ├── subdiv │ ├── bezier_curve.cpp │ └── bspline_curve.cpp ├── geometry │ └── primitive.h └── common │ └── accelinstance.h ├── .gitattributes ├── include └── embree2 │ └── rtcore_version.h └── CTestConfig.cmake /common/cmake/rpm_ldconfig.sh: -------------------------------------------------------------------------------- 1 | /sbin/ldconfig 2 | -------------------------------------------------------------------------------- /tutorials/models/subdiv0.ecs: -------------------------------------------------------------------------------- 1 | -i subdiv0.xml 2 | -------------------------------------------------------------------------------- /tutorials/models/subdiv1.ecs: -------------------------------------------------------------------------------- 1 | -i subdiv1.xml 2 | -------------------------------------------------------------------------------- /tutorials/models/subdiv6.ecs: -------------------------------------------------------------------------------- 1 | -i subdiv6.xml 2 | -------------------------------------------------------------------------------- /tutorials/models/subdiv7.ecs: -------------------------------------------------------------------------------- 1 | -i subdiv7.xml 2 | -------------------------------------------------------------------------------- /tutorials/models/subdiv8.ecs: -------------------------------------------------------------------------------- 1 | -i subdiv8.xml 2 | -------------------------------------------------------------------------------- /tutorials/models/subdiv9.ecs: -------------------------------------------------------------------------------- 1 | -i subdiv9.xml 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.user 2 | Win32 3 | x64 4 | *.suo 5 | *.ncb 6 | .*sw? 7 | .DS_Store 8 | -------------------------------------------------------------------------------- /readme.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangent-animation/embree/HEAD/readme.pdf -------------------------------------------------------------------------------- /tutorials/models/cylinder.ecs: -------------------------------------------------------------------------------- 1 | -i cylinder.xml 2 | --fov 60 3 | --shader texcoords-grid 4 | -------------------------------------------------------------------------------- /tutorials/models/subdiv_pin_all.ecs: -------------------------------------------------------------------------------- 1 | -i subdiv_pin_all.xml 2 | --shader texcoords-grid 3 | 4 | 5 | -------------------------------------------------------------------------------- /tutorials/models/subdiv_pin_corners.ecs: -------------------------------------------------------------------------------- 1 | -i subdiv_pin_corners.xml 2 | --shader texcoords-grid 3 | 4 | 5 | -------------------------------------------------------------------------------- /tutorials/models/subdiv_no_boundary.ecs: -------------------------------------------------------------------------------- 1 | -i subdiv_no_boundary.xml 2 | --fov 25 3 | --shader texcoords-grid 4 | -------------------------------------------------------------------------------- /tutorials/models/subdiv_pin_boundary.ecs: -------------------------------------------------------------------------------- 1 | -i subdiv_pin_boundary.xml 2 | --shader texcoords-grid 3 | 4 | 5 | -------------------------------------------------------------------------------- /tutorials/models/subdiv_smooth_boundary.ecs: -------------------------------------------------------------------------------- 1 | -i subdiv_smooth_boundary.xml 2 | --shader texcoords-grid 3 | 4 | -------------------------------------------------------------------------------- /scripts/install_windows/icon32.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangent-animation/embree/HEAD/scripts/install_windows/icon32.ico -------------------------------------------------------------------------------- /kernels/export.linux.map: -------------------------------------------------------------------------------- 1 | { 2 | global: 3 | rtc*; 4 | ISPC*; 5 | _ZN6embree13TaskScheduler*; 6 | local: 7 | *; 8 | }; 9 | -------------------------------------------------------------------------------- /tutorials/models/cornell_box.xml.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangent-animation/embree/HEAD/tutorials/models/cornell_box.xml.bin -------------------------------------------------------------------------------- /tutorials/common/freeglut/Win32/freeglut.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangent-animation/embree/HEAD/tutorials/common/freeglut/Win32/freeglut.dll -------------------------------------------------------------------------------- /tutorials/common/freeglut/Win32/freeglut.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangent-animation/embree/HEAD/tutorials/common/freeglut/Win32/freeglut.lib -------------------------------------------------------------------------------- /tutorials/common/freeglut/x64/freeglut.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangent-animation/embree/HEAD/tutorials/common/freeglut/x64/freeglut.dll -------------------------------------------------------------------------------- /tutorials/common/freeglut/x64/freeglut.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tangent-animation/embree/HEAD/tutorials/common/freeglut/x64/freeglut.lib -------------------------------------------------------------------------------- /tutorials/models/subdiv4.ecs: -------------------------------------------------------------------------------- 1 | -i subdiv4.xml 2 | -vp 0.402692318 0.5135802031 -1.558728933 -vi 0.005475401878 0 -0.1743824482 -vu 0 1 0 -fov 90 3 | -------------------------------------------------------------------------------- /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/hair0.ecs: -------------------------------------------------------------------------------- 1 | -i hair0.xml 2 | -vp 0.7169501185 2.843446732 3.032496214 -vi 1.75338316 1.457281828 0.92993927 -vu 0 1 0 -fov 90 3 | --shader uv 4 | -------------------------------------------------------------------------------- /tutorials/models/subdiv5.ecs: -------------------------------------------------------------------------------- 1 | -i subdiv5.xml 2 | -vp -4.145762444 3.729721785 -5.426389217 -vi -3.877043724 1.53142035 -2.605402708 -vu 0 1 0 -fov 90 3 | --shader uv 4 | -------------------------------------------------------------------------------- /tutorials/models/subdiv3.ecs: -------------------------------------------------------------------------------- 1 | -i subdiv3.xml 2 | -vp 0.594296813 1.361050725 -1.316164136 -vi 0.3699172139 0.8521371484 -0.9310647249 -vu 0 1 0 -fov 90 3 | --shader uv 4 | 5 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /scripts/klocwork.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | make clean > /dev/null 3 | kwinject -w -o buildspec.txt make -j 8 > /dev/null 4 | #kwcheck create -b buildspec.txt --url http://localhost:8080/embree 5 | #kwcheck run 6 | kwbuildproject --force --url http://localhost:8080/embree buildspec.txt --tables-directory mytables 7 | kwadmin --url http://localhost:8080 load embree mytables 8 | #kwcheck list -F detailed 9 | #kwcheck list -F detailed > klocwork.log 10 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /scripts/benchmark_instancing.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 | $SCRIPT_PATH/benchmark.py run $1 $2_scene_group ./$2 --instancing scene_group 13 | $SCRIPT_PATH/benchmark.py run $1 $2_scene_geometry ./$2 --instancing scene_geometry 14 | $SCRIPT_PATH/benchmark.py run $1 $2_geometry ./$2 --instancing geometry 15 | $SCRIPT_PATH/benchmark.py run $1 $2_geometry_ref ./$2 --instancing geometry --rtcore instancing_open_factor=1 16 | $SCRIPT_PATH/benchmark.py print $1 $2_scene_group $2_scene_geometry $2_geometry_ref $2_geometry 17 | -------------------------------------------------------------------------------- /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 | setenv CPATH "$SCRIPT_PATH/@CMAKE_INSTALL_INCLUDEDIR@:${CPATH}" 25 | 26 | setenv LIBRARY_PATH "$SCRIPT_PATH/@CMAKE_INSTALL_LIBDIR@:${LIBRARY_PATH}" 27 | 28 | setenv LD_LIBRARY_PATH "$SCRIPT_PATH/@CMAKE_INSTALL_LIBDIR@:${LD_LIBRARY_PATH}" 29 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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/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/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/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 | -------------------------------------------------------------------------------- /kernels/embree.rc: -------------------------------------------------------------------------------- 1 | #include "embree2/rtcore_version.h" 2 | 3 | 1 VERSIONINFO 4 | FILEVERSION RTCORE_VERSION_MAJOR,RTCORE_VERSION_MINOR,RTCORE_VERSION_PATCH,0 5 | PRODUCTVERSION RTCORE_VERSION_MAJOR,RTCORE_VERSION_MINOR,RTCORE_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", RTCORE_VERSION_STRING 23 | VALUE "ProductVersion", RTCORE_VERSION_STRING 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 | -------------------------------------------------------------------------------- /scripts/install_macosx/uninstall.command: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) 3 | cd $DIR/../.. 4 | 5 | IFS=$'\n' 6 | FILES=($(pkgutil --files com.intel.embree-@EMBREE_VERSION@ | grep -e 'opt/local/include/\|opt/local/lib/\|Applications/Embree@EMBREE_VERSION_MAJOR@' | tail -r)) 7 | unset IFS 8 | 9 | # exit if no files found 10 | if [ ${#FILES[@]} -eq 0 ]; then 11 | printf "Embree @EMBREE_VERSION@ not installed!\n" 12 | exit 13 | fi 14 | 15 | # first print all files that would get removed 16 | echo Uninstalling Embree @EMBREE_VERSION@ will remove the following files: 17 | PWD=`pwd` 18 | if [ "$PWD" != "/" ]; then 19 | PWD=$PWD/ 20 | fi 21 | for f in "${FILES[@]}"; do 22 | printf " %s%s\n" $PWD "$f" 23 | done 24 | 25 | echo "Do you wish to uninstall Embree @EMBREE_VERSION@ by removing these files?" 26 | select yn in "Yes" "No"; do 27 | case $yn in 28 | Yes ) break;; 29 | No ) exit;; 30 | esac 31 | done 32 | 33 | # now remove files 34 | echo Uninstalling Embree @EMBREE_VERSION@ ... 35 | for f in "${FILES[@]}"; do 36 | sudo rm -vd "$f" 37 | done 38 | 39 | sudo pkgutil --forget com.intel.embree-@EMBREE_VERSION@ 40 | -------------------------------------------------------------------------------- /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/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 | 0 1 2 3 4 5 40 | 41 | 42 | 43 | "OBJ" 44 | 45 | 1 1 1 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /scripts/check_symbols.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # check version of symbols 4 | function check_symbols 5 | { 6 | for sym in `nm $1 | grep $2_` 7 | do 8 | version=(`echo $sym | sed 's/.*@@\(.*\)$/\1/g' | grep -E -o "[0-9]+"`) 9 | if [ ${#version[@]} -ne 0 ]; then 10 | if [ ${#version[@]} -eq 1 ]; then version[1]=0; fi 11 | if [ ${#version[@]} -eq 2 ]; then version[2]=0; fi 12 | #echo $sym 13 | #echo "version0 = " ${version[0]} 14 | #echo "version1 = " ${version[1]} 15 | #echo "version2 = " ${version[2]} 16 | if [ ${version[0]} -gt $3 ]; then 17 | echo "Error: problematic $2 symbol " $sym 18 | exit 1 19 | fi 20 | if [ ${version[0]} -lt $3 ]; then continue; fi 21 | 22 | if [ ${version[1]} -gt $4 ]; then 23 | echo "Error: problematic $2 symbol " $sym 24 | exit 1 25 | fi 26 | if [ ${version[1]} -lt $4 ]; then continue; fi 27 | 28 | if [ ${version[2]} -gt $5 ]; then 29 | echo "Error: problematic $2 symbol " $sym 30 | exit 1 31 | fi 32 | fi 33 | done 34 | } 35 | 36 | check_symbols $1 GLIBC 2 4 0 37 | check_symbols $1 GLIBCXX 3 4 11 38 | check_symbols $1 CXXABI 1 3 0 39 | 40 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /kernels/hash.h.in: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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 | #define RTCORE_HASH "@EMBREE_HASH@" 18 | -------------------------------------------------------------------------------- /common/cmake/create_isa_dummy_file.cmake: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2017 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 | -------------------------------------------------------------------------------- /tutorials/common/math/math.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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/viewer_anim/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2017 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_anim) 19 | 20 | 21 | -------------------------------------------------------------------------------- /tutorials/viewer_stream/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2017 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/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/common/math/linearspace.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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 | -------------------------------------------------------------------------------- /common/simd/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2017 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 | -------------------------------------------------------------------------------- /tutorials/buildbench/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2017 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 | INCLUDE(tutorial) 19 | ADD_TUTORIAL(buildbench) 20 | -------------------------------------------------------------------------------- /tutorials/dynamic_scene/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2017 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/hair_geometry/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2017 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/interpolation/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2017 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/lazy_geometry/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2017 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/curve_geometry/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2017 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/triangle_geometry/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2017 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/pathtracer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2017 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/subdivision_geometry/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2017 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/displacement_geometry/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2017 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 | -------------------------------------------------------------------------------- /common/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2017 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 | -------------------------------------------------------------------------------- /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 | .. 27 | 28 | # create installers 29 | cmake \ 30 | -D EMBREE_ZIP_MODE=OFF \ 31 | -D CMAKE_INSTALL_PREFIX=/opt/local \ 32 | -D CMAKE_INSTALL_INCLUDEDIR=include \ 33 | -D CMAKE_INSTALL_LIBDIR=lib \ 34 | -D CMAKE_INSTALL_DOCDIR=../../Applications/Embree2/doc \ 35 | -D CMAKE_INSTALL_BINDIR=../../Applications/Embree2/bin \ 36 | -D EMBREE_TBB_ROOT=/opt/local \ 37 | .. 38 | make -j 4 package 39 | 40 | # create ZIP files 41 | cmake \ 42 | -D EMBREE_ZIP_MODE=ON \ 43 | -D CMAKE_MACOSX_RPATH=ON \ 44 | -D CMAKE_INSTALL_INCLUDEDIR=include \ 45 | -D CMAKE_INSTALL_LIBDIR=lib \ 46 | -D CMAKE_INSTALL_DOCDIR=doc \ 47 | -D CMAKE_INSTALL_BINDIR=bin \ 48 | -D EMBREE_TBB_ROOT=$TBB_PATH_LOCAL \ 49 | .. 50 | make -j 4 package 51 | 52 | rm CMakeCache.txt # reset settings 53 | cd .. 54 | -------------------------------------------------------------------------------- /tutorials/common/tutorial/camera.isph: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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/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/motion_blur_geometry/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2017 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/common/common.isph: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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/tutorial/noise.isph: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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 | -------------------------------------------------------------------------------- /common/lexers/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2017 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 | -------------------------------------------------------------------------------- /include/embree2/rtcore_version.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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 | #define RTCORE_VERSION_MAJOR 2 18 | #define RTCORE_VERSION_MINOR 16 19 | #define RTCORE_VERSION_PATCH 5 20 | #define RTCORE_VERSION 21605 21 | #define RTCORE_VERSION_STRING "2.16.5" 22 | -------------------------------------------------------------------------------- /tutorials/common/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2017 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/scenegraph/ply_loader.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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/tutorial/noise.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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/math/affinespace.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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/bvh_builder/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2017 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/common/scenegraph/xml_loader.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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-2017 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/find_embree/find_embree_ispc.ispc: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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/common/scenegraph/corona_loader.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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/lights/ambient_light.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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/convert/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2017 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 tasking) 19 | SET_PROPERTY(TARGET convert PROPERTY FOLDER tutorials/single) 20 | INSTALL(TARGETS convert DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT examples) 21 | -------------------------------------------------------------------------------- /common/cmake/FindPNG.cmake: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2017 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 | -------------------------------------------------------------------------------- /tutorials/bvh_access/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2017 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 | -------------------------------------------------------------------------------- /common/tasking/taskscheduler.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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 | -------------------------------------------------------------------------------- /tutorials/common/core/differential_geometry.isph: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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/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/scenegraph/obj_loader.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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, 24 | const bool subdivMode = false, 25 | const bool combineIntoSingleObject = false); 26 | } 27 | -------------------------------------------------------------------------------- /tutorials/user_geometry/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2017 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 | IF(EMBREE_RAY_PACKETS) 21 | ADD_EMBREE_TEST2(user_geometry_stream_coherent user_geometry "--mode stream --coherent") 22 | ADD_EMBREE_TEST2(user_geometry_stream_incoherent user_geometry "--mode stream --incoherent") 23 | ENDIF() 24 | 25 | -------------------------------------------------------------------------------- /kernels/rtcore_version.h.in: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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 | #define RTCORE_VERSION_MAJOR @EMBREE_VERSION_MAJOR@ 18 | #define RTCORE_VERSION_MINOR @EMBREE_VERSION_MINOR@ 19 | #define RTCORE_VERSION_PATCH @EMBREE_VERSION_PATCH@ 20 | #define RTCORE_VERSION @EMBREE_VERSION_NUMBER@ 21 | #define RTCORE_VERSION_STRING "@EMBREE_VERSION_MAJOR@.@EMBREE_VERSION_MINOR@.@EMBREE_VERSION_PATCH@@EMBREE_VERSION_NOTE@" 22 | -------------------------------------------------------------------------------- /common/cmake/embree-config-builddir.cmake: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2017 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 | # use default install config 18 | INCLUDE(${CMAKE_CURRENT_LIST_DIR}/embree-config-install.cmake) 19 | 20 | # and override path variables to match for build directory 21 | SET(EMBREE_INCLUDE_DIRS @PROJECT_SOURCE_DIR@/include) 22 | SET(EMBREE_LIBRARY @PROJECT_BINARY_DIR@/@EMBREE_LIBRARY_NAME@) 23 | SET(EMBREE_LIBRARIES ${EMBREE_LIBRARY}) 24 | -------------------------------------------------------------------------------- /tutorials/instanced_geometry/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2017 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 | IF(EMBREE_RAY_PACKETS) 21 | ADD_EMBREE_TEST2(instanced_geometry_stream_coherent instanced_geometry "--mode stream --coherent") 22 | ADD_EMBREE_TEST2(instanced_geometry_stream_incoherent instanced_geometry "--mode stream --incoherent") 23 | ENDIF() 24 | -------------------------------------------------------------------------------- /tutorials/common/core/differential_geometry.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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/intersection_filter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2017 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 | IF(EMBREE_RAY_PACKETS) 21 | ADD_EMBREE_TEST2(intersection_filter_stream_coherent intersection_filter "--mode stream --coherent") 22 | ADD_EMBREE_TEST2(intersection_filter_stream_incoherent intersection_filter "--mode stream --incoherent") 23 | ENDIF() 24 | -------------------------------------------------------------------------------- /tutorials/common/lights/point_light.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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 | -------------------------------------------------------------------------------- /common/algorithms/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2017 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 | parallel_filter.cpp 28 | ) 29 | 30 | SET_PROPERTY(TARGET algorithms PROPERTY FOLDER common) 31 | 32 | 33 | -------------------------------------------------------------------------------- /tutorials/models/subdiv_no_boundary.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -3.5 -3.5 0.0 9 | -0.5 -1.5 0.0 10 | +0.5 -1.5 0.0 11 | +1.5 -1.5 0.0 12 | 13 | -1.5 -0.5 0.0 14 | -0.5 -0.5 0.0 15 | +0.5 -0.5 0.0 16 | +1.5 -0.5 0.0 17 | 18 | -1.5 +0.5 0.0 19 | -0.5 +0.5 0.0 20 | +0.5 +0.5 0.0 21 | +1.5 +0.5 0.0 22 | 23 | -1.5 +1.5 0.0 24 | -0.5 +1.5 0.0 25 | +0.5 +1.5 0.0 26 | +3.5 +3.5 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 | 0 0 44 | 0 0 45 | 0 1 46 | 1 1 47 | 1 0 48 | 49 | 50 | 51 | 0 0 0 0 52 | 0 0 0 0 53 | 0 0 0 0 54 | 0 0 0 0 55 | 56 | 1 2 3 4 57 | 58 | 0 0 0 0 59 | 0 0 0 0 60 | 0 0 0 0 61 | 0 0 0 0 62 | 63 | 64 | 65 | 4 4 4 4 4 4 4 4 4 66 | 67 | 68 | 69 | "OBJ" 70 | 71 | 1 1 1 72 | 73 | 74 | 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /tutorials/common/scenegraph/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2017 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 | corona_loader.cpp 24 | texture.cpp 25 | scenegraph.cpp 26 | geometry_creation.cpp) 27 | 28 | TARGET_LINK_LIBRARIES(scenegraph sys lexers image) 29 | SET_PROPERTY(TARGET scenegraph PROPERTY FOLDER tutorials/common) 30 | -------------------------------------------------------------------------------- /kernels/bvh/bvh_factory.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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/bvh.h" 20 | #include "../common/isa.h" 21 | #include "../common/accel.h" 22 | #include "../common/scene.h" 23 | 24 | namespace embree 25 | { 26 | /*! BVH instantiations */ 27 | class BVHFactory 28 | { 29 | public: 30 | enum class BuildVariant { STATIC, DYNAMIC, HIGH_QUALITY }; 31 | enum class IntersectVariant { FAST, ROBUST }; 32 | }; 33 | } 34 | -------------------------------------------------------------------------------- /tutorials/bvh_builder/bvh_builder.cpp: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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/convert/default.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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/common/lights/light.ispc: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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/directional_light.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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 | -------------------------------------------------------------------------------- /common/cmake/crayprgenv.cmake: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2017 Kitware, Inc. ## 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 "-target-cpu=xeon") 18 | IF(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU") 19 | SET(FLAGS_SSE42 "-target-cpu=xeon -msse4.2") 20 | ELSE()#Intel 21 | SET(FLAGS_SSE42 "-target-cpu=xeon -xsse4.2 -fPIC") 22 | ENDIF() 23 | SET(FLAGS_AVX "-target-cpu=sandybridge") 24 | SET(FLAGS_AVX2 "-target-cpu=haswell") 25 | SET(FLAGS_AVX512KNL "-target-cpu=mic-knl") 26 | SET(FLAGS_AVX512SKX "ERROR_ISA_NOT_SUPPORTED") 27 | -------------------------------------------------------------------------------- /common/cmake/embree-config-version.cmake: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2017 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 | -------------------------------------------------------------------------------- /tutorials/models/cylinder.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 | 3 0 4 7 23 | 24 | 4 5 6 7 25 | 0 3 2 1 26 | 27 | 28 | 29 | 0.0 0.0 30 | 0.25 0.0 31 | 0.5 0.0 32 | 0.75 0.0 33 | 1.0 0.0 34 | 35 | 0.0 1.0 36 | 0.25 1.0 37 | 0.5 1.0 38 | 0.75 1.0 39 | 1.0 1.0 40 | 41 | 0 0 42 | 0 1 43 | 1 1 44 | 1 0 45 | 46 | 47 | 48 | 0 1 6 5 49 | 1 2 7 6 50 | 2 3 8 7 51 | 3 4 9 8 52 | 53 | 10 11 12 13 54 | 10 13 12 11 55 | 56 | 57 | 58 | 4 4 4 4 4 4 59 | 60 | 61 | 62 | 0 1 1 2 2 3 3 0 63 | 4 5 5 6 6 7 7 4 64 | 65 | 66 | 67 | 4 4 4 4 68 | 4 4 4 4 69 | 70 | 71 | 72 | "OBJ" 73 | 74 | 1 1 1 75 | 76 | 77 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /common/cmake/check_globals.cmake: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2017 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 (WIN32 OR APPLE) 18 | return() 19 | ENDIF() 20 | 21 | execute_process(COMMAND objdump -C -t ${file} OUTPUT_VARIABLE output) 22 | string(REPLACE "\n" ";" output ${output}) 23 | 24 | foreach (line ${output}) 25 | if ("${line}" MATCHES "O .bss") 26 | if (NOT "${line}" MATCHES "std::__ioinit") 27 | message(WARNING "\nProblematic global variable in non-SSE code:\n" ${line}) 28 | endif() 29 | endif() 30 | endforeach() 31 | -------------------------------------------------------------------------------- /tutorials/common/lights/quad_light.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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 | -------------------------------------------------------------------------------- /common/sys/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2017 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/library.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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 | -------------------------------------------------------------------------------- /tutorials/common/lights/light.cpp: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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 | -------------------------------------------------------------------------------- /common/tasking/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2017 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 | -------------------------------------------------------------------------------- /tutorials/common/texture/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2017 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/dynamic_scene/dynamic_scene.cpp: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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/interpolation/interpolation.cpp: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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/lazy_geometry/lazy_geometry.cpp: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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("lazy_geometry",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/triangle_geometry/triangle_geometry.cpp: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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/user_geometry.cpp: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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 | -------------------------------------------------------------------------------- /common/sys/string.cpp: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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 | -------------------------------------------------------------------------------- /tutorials/displacement_geometry/displacement_geometry.cpp: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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/subdivision_geometry/subdivision_geometry.cpp: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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 | -------------------------------------------------------------------------------- /common/sys/regression.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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 | -------------------------------------------------------------------------------- /tutorials/common/lights/spot_light.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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/curve_geometry/curve_geometry.cpp: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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/instanced_geometry/instanced_geometry.cpp: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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/intersection_filter/intersection_filter.cpp: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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.27f,1.75f,-6.75f); 28 | camera.to = Vec3fa(0.0f,-2.0f,-3.5f); 29 | } 30 | }; 31 | } 32 | 33 | int main(int argc, char** argv) { 34 | return embree::Tutorial().main(argc,argv); 35 | } 36 | -------------------------------------------------------------------------------- /common/simd/avx.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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 "vllong4_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 | -------------------------------------------------------------------------------- /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 | 0 1 2 3 4 5 6 51 | 10 52 | 14 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/hair0.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 | 0 1 2 3 4 5 6 51 | 10 52 | 14 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 | -------------------------------------------------------------------------------- /common/cmake/msvc_post.cmake: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2017 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 | # optionally use static runtime library 18 | OPTION(EMBREE_STATIC_RUNTIME "Use the static version of the C/C++ runtime library." ON) 19 | IF (EMBREE_STATIC_RUNTIME) 20 | STRING(REPLACE "/MDd" "/MTd" CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG}) 21 | STRING(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}) 22 | STRING(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE}) 23 | ENDIF() 24 | 25 | # remove define NDEBUG and instead set define DEBUG for config RelWithDebInfo 26 | STRING(REPLACE "NDEBUG" "DEBUG" CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}) 27 | -------------------------------------------------------------------------------- /common/cmake/check_isa_default.cmake: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2017 Kitware, Inc. ## 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(CHECK_ISA_DIR ${CMAKE_CURRENT_LIST_DIR}) 18 | FUNCTION(CHECK_ISA_DEFAULT OUTVAR) 19 | SET(ISA_DEFAULT_BIN ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/check_isa_default.bin) 20 | SET(SRC ${CHECK_ISA_DIR}/check_isa.cpp) 21 | TRY_COMPILE(ISA_DEFAULT_COMPILE 22 | ${CMAKE_BINARY_DIR} 23 | ${SRC} 24 | COPY_FILE ${ISA_DEFAULT_BIN} 25 | ) 26 | IF(NOT ISA_DEFAULT_COMPILE) 27 | SET(ISA_DEFAULT "SSE2") 28 | RETURN() 29 | ENDIF() 30 | FILE(STRINGS ${ISA_DEFAULT_BIN} ISA_DEFAULT REGEX "^ISA:") 31 | STRING(REPLACE "ISA:" "" ISA_DEFAULT "${ISA_DEFAULT}") 32 | SET(${OUTVAR} ${ISA_DEFAULT} PARENT_SCOPE) 33 | ENDFUNCTION() 34 | -------------------------------------------------------------------------------- /common/sys/string.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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/condition.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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 | private: 38 | ConditionSys (const ConditionSys& other) DELETED; // do not implement 39 | ConditionSys& operator= (const ConditionSys& other) DELETED; // do not implement 40 | 41 | protected: 42 | void* cond; 43 | }; 44 | } 45 | -------------------------------------------------------------------------------- /common/cmake/check_stack_frame_size.cmake: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2017 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 (WIN32 OR APPLE) 18 | return() 19 | ENDIF() 20 | 21 | execute_process(COMMAND objdump -d ${file} OUTPUT_VARIABLE output) 22 | string(REPLACE "\n" ";" output ${output}) 23 | 24 | SET(lastfunc "") 25 | foreach (line ${output}) 26 | if ("${line}" MATCHES "^.*<([^>]*)>:$") 27 | SET(lastfunc ${CMAKE_MATCH_1}) 28 | endif() 29 | if ("${line}" MATCHES ".*sub[ ]+[$]([^,]*),%rsp.*") 30 | set(bytes ${CMAKE_MATCH_1}) 31 | if ("${bytes}" GREATER "4096") 32 | if ("${lastfunc}" MATCHES ".*recurse.*") 33 | message(WARNING "Large stack space requirement: ${lastfunc} size: ${bytes}") 34 | endif() 35 | endif() 36 | endif() 37 | endforeach() -------------------------------------------------------------------------------- /common/sys/regression.cpp: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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 | -------------------------------------------------------------------------------- /tutorials/common/lights/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2017 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/viewer/viewer.cpp: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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 SceneLoadingTutorialApplication 22 | { 23 | Tutorial() 24 | : SceneLoadingTutorialApplication("viewer",FEATURE_RTCORE) {} 25 | 26 | void postParseCommandLine() 27 | { 28 | /* load default scene if none specified */ 29 | if (scene->size() == 0 && sceneFilename.ext() == "") { 30 | FileName file = FileName::executableFolder() + FileName("models/cornell_box.ecs"); 31 | parseCommandLine(new ParseStream(new LineCommentFilter(file, "#")), file.path()); 32 | } 33 | } 34 | }; 35 | } 36 | 37 | int main(int argc, char** argv) { 38 | return embree::Tutorial().main(argc,argv); 39 | } 40 | -------------------------------------------------------------------------------- /tutorials/viewer_stream/viewer_stream.cpp: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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 SceneLoadingTutorialApplication 22 | { 23 | Tutorial() 24 | : SceneLoadingTutorialApplication("viewer_stream",FEATURE_RTCORE) {} 25 | 26 | void postParseCommandLine() 27 | { 28 | /* load default scene if none specified */ 29 | if (sceneFilename.ext() == "") { 30 | FileName file = FileName::executableFolder() + FileName("models/cornell_box.ecs"); 31 | parseCommandLine(new ParseStream(new LineCommentFilter(file, "#")), file.path()); 32 | } 33 | } 34 | }; 35 | 36 | } 37 | 38 | int main(int argc, char** argv) { 39 | return embree::Tutorial().main(argc,argv); 40 | } 41 | -------------------------------------------------------------------------------- /kernels/subdiv/bezier_curve.cpp: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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 | PrecomputedBezierBasis::PrecomputedBezierBasis(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 u = float(j+dj)/float(i); 28 | const Vec4f f = BezierBasis::eval(u); 29 | c0[i][j] = f.x; 30 | c1[i][j] = f.y; 31 | c2[i][j] = f.z; 32 | c3[i][j] = f.w; 33 | const Vec4f d = BezierBasis::derivative(u); 34 | d0[i][j] = d.x; 35 | d1[i][j] = d.y; 36 | d2[i][j] = d.z; 37 | d3[i][j] = d.w; 38 | } 39 | } 40 | } 41 | PrecomputedBezierBasis bezier_basis0(0); 42 | PrecomputedBezierBasis bezier_basis1(1); 43 | } 44 | -------------------------------------------------------------------------------- /tutorials/viewer_anim/viewer_anim.cpp: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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 SceneLoadingTutorialApplication 22 | { 23 | Tutorial() 24 | : SceneLoadingTutorialApplication("viewer_anim",FEATURE_RTCORE) 25 | { 26 | } 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 | }; 37 | 38 | } 39 | 40 | int main(int argc, char** argv) { 41 | return embree::Tutorial().main(argc,argv); 42 | } 43 | -------------------------------------------------------------------------------- /tutorials/pathtracer/pathtracer.cpp: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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 SceneLoadingTutorialApplication 22 | { 23 | Tutorial() 24 | : SceneLoadingTutorialApplication("pathtracer",FEATURE_RTCORE) {} 25 | 26 | void postParseCommandLine() 27 | { 28 | /* load default scene if none specified */ 29 | if (scene->size() == 0 && sceneFilename.ext() == "") { 30 | FileName file = FileName::executableFolder() + FileName("models/cornell_box.ecs"); 31 | parseCommandLine(new ParseStream(new LineCommentFilter(file, "#")), file.path()); 32 | } 33 | } 34 | }; 35 | 36 | } 37 | 38 | int main(int argc, char** argv) { 39 | return embree::Tutorial().main(argc,argv); 40 | } 41 | -------------------------------------------------------------------------------- /kernels/subdiv/bspline_curve.cpp: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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 "bspline_curve.h" 18 | 19 | namespace embree 20 | { 21 | PrecomputedBSplineBasis::PrecomputedBSplineBasis(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 u = float(j+dj)/float(i); 28 | const Vec4f f = BSplineBasis2::eval(u); 29 | c0[i][j] = f.x; 30 | c1[i][j] = f.y; 31 | c2[i][j] = f.z; 32 | c3[i][j] = f.w; 33 | const Vec4f d = BSplineBasis2::derivative(u); 34 | d0[i][j] = d.x; 35 | d1[i][j] = d.y; 36 | d2[i][j] = d.z; 37 | d3[i][j] = d.w; 38 | } 39 | } 40 | } 41 | PrecomputedBSplineBasis bspline_basis0(0); 42 | PrecomputedBSplineBasis bspline_basis1(1); 43 | } 44 | -------------------------------------------------------------------------------- /tutorials/common/texture/texture.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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/viewer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2017 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/buildbench/buildbench.cpp: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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 SceneLoadingTutorialApplication 22 | { 23 | Tutorial() 24 | : SceneLoadingTutorialApplication("build_bench",FEATURE_RTCORE) 25 | { 26 | interactive = false; 27 | } 28 | 29 | void postParseCommandLine() 30 | { 31 | /* load default scene if none specified */ 32 | if (sceneFilename.ext() == "") { 33 | FileName file = FileName::executableFolder() + FileName("models/cornell_box.ecs"); 34 | parseCommandLine(new ParseStream(new LineCommentFilter(file, "#")), file.path()); 35 | } 36 | } 37 | }; 38 | 39 | } 40 | 41 | int main(int argc, char** argv) { 42 | return embree::Tutorial().main(argc,argv); 43 | } 44 | -------------------------------------------------------------------------------- /CTestConfig.cmake: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2017 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 01ada7ec1ace15ddba73aaab3f53ac6aac6a0309) 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 | 32 | SET(CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE 200000) 33 | SET(CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE 800000) 34 | -------------------------------------------------------------------------------- /tutorials/common/default.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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/sysinfo.h" 21 | #include "../../common/sys/ref.h" 22 | #include "../../common/sys/vector.h" 23 | #include "../../common/math/vec2.h" 24 | #include "../../common/math/vec3.h" 25 | #include "../../common/math/vec4.h" 26 | #include "../../common/math/bbox.h" 27 | #include "../../common/math/lbbox.h" 28 | #include "../../common/math/affinespace.h" 29 | #include "../../common/sys/filename.h" 30 | #include "../../common/sys/string.h" 31 | #include "../../common/lexers/tokenstream.h" 32 | #include "../../common/lexers/streamfilters.h" 33 | #include "../../common/lexers/parsestream.h" 34 | 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | -------------------------------------------------------------------------------- /common/cmake/check_isa.cpp: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2017 Kitware, Inc. // 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 \ 18 | defined(__AVX512F__) && defined(__AVX512CD__) && \ 19 | defined(__AVX512DQ__) && defined(__AVX512BW__) && defined(__AVX512VL__) 20 | char const *info_isa = "ISA" ":" "AVX512SKX"; 21 | #elif \ 22 | defined(__AVX512F__) && defined(__AVX512CD__) && \ 23 | defined(__AVX512ER__) && defined(__AVX512PF__) 24 | char const *info_isa = "ISA" ":" "AVX512KNL"; 25 | #elif defined(__AVX2__) 26 | char const *info_isa = "ISA" ":" "AVX2"; 27 | #elif defined(__AVX__) 28 | char const *info_isa = "ISA" ":" "AVX"; 29 | #elif defined(__SSE4_2__) 30 | char const *info_isa = "ISA" ":" "SSE42"; 31 | #else // defined(__SSE2__) 32 | char const *info_isa = "ISA" ":" "SSE2"; 33 | #endif 34 | 35 | int main(int argc, char **argv) 36 | { 37 | int require = 0; 38 | require += info_isa[argc]; 39 | return require; 40 | } 41 | -------------------------------------------------------------------------------- /kernels/geometry/primitive.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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/scene.h" 21 | #include "../common/simd/simd.h" 22 | #include "../common/primref.h" 23 | #include "../common/primref_mb.h" 24 | 25 | namespace embree 26 | { 27 | struct PrimitiveType 28 | { 29 | /*! constructs the primitive type */ 30 | PrimitiveType (const std::string& name, size_t bytes, size_t blockSize) 31 | : name(name), bytes(bytes), blockSize(blockSize) {} 32 | 33 | /*! Returns the number of stored primitives in a block. */ 34 | virtual size_t size(const char* This) const = 0; 35 | 36 | public: 37 | std::string name; //!< name of this primitive type 38 | size_t bytes; //!< number of bytes of the triangle data 39 | size_t blockSize; //!< block size 40 | }; 41 | } 42 | -------------------------------------------------------------------------------- /common/simd/sse.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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 "vuint4_sse2.h" 47 | #include "vfloat4_sse2.h" 48 | -------------------------------------------------------------------------------- /tutorials/find_embree/find_embree_ispc.cpp: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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 | -------------------------------------------------------------------------------- /kernels/bvh/bvh_rotate.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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 | -------------------------------------------------------------------------------- /tutorials/find_embree/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2017 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 | -------------------------------------------------------------------------------- /common/lexers/stringstream.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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 | -------------------------------------------------------------------------------- /tutorials/find_embree/find_embree.cpp: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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 | -------------------------------------------------------------------------------- /kernels/common/accelinstance.h: -------------------------------------------------------------------------------- 1 | // ======================================================================== // 2 | // Copyright 2009-2017 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 | builder.reset(nullptr); 32 | } 33 | 34 | public: 35 | void build () { 36 | if (builder) builder->build(); 37 | bounds = accel->bounds; 38 | } 39 | 40 | void deleteGeometry(size_t geomID) { 41 | if (accel ) accel->deleteGeometry(geomID); 42 | if (builder) builder->deleteGeometry(geomID); 43 | } 44 | 45 | void clear() { 46 | accel->clear(); 47 | builder->clear(); 48 | } 49 | 50 | private: 51 | std::unique_ptr accel; 52 | std::unique_ptr builder; 53 | }; 54 | } 55 | -------------------------------------------------------------------------------- /tutorials/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## ======================================================================== ## 2 | ## Copyright 2009-2017 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 | ADD_SUBDIRECTORY(viewer_anim) 42 | ENDIF() 43 | 44 | # propagate menu links up 45 | SET(CPACK_NSIS_MENU_LINKS ${CPACK_NSIS_MENU_LINKS} PARENT_SCOPE) 46 | 47 | --------------------------------------------------------------------------------