-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
808 changed files
with
848,848 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
/* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
* Release date: 20/05/2015 | ||
* Authors: Norbert Bus & Nabil Mustafa | ||
* | ||
* If you find this code useful, please cite it by referencing the following paper: | ||
* @article{BMB15, title={Illumination{Cut}}, author={Bus, Norbert and Mustafa, Nabil H. and Biri, Venceslas}, | ||
* journal = {Computer Graphics Forum (Proceedings of Eurographics 2015)},year={2015}} | ||
*/ | ||
|
||
=================================== IlluminationCut v1.0 =================================== | ||
|
||
Brief: | ||
Implementation of a few rendering algorithms in the many-lights framework with the Embree renderer and ray tracing kernels. For detailed descriptions use the corresponding papers. | ||
The algorithms are the following (with the abbreviations used for them): | ||
-ct: Lightcuts with agglomerative clustering for the lightree (implemented by the authors of IlluminationCut) | ||
-ic: IlluminationCut with agglomerative clustering for the lightree (implemented by the authors of IlluminationCut) | ||
-lc: Lightcuts with divisive clustering for the lightree (implemented by the authors of LightSlice) | ||
-md: Multidimensional Lightcuts with divisive clustering for the lightree (implemented by the authors of LightSlice) | ||
-ls: LightSlice (implemented by the authors of LightSlice) | ||
The relevant source files are in the folder renderer\devices\device_singleray\clustering. | ||
|
||
Disclaimer: | ||
This is not the exact same version of the source code that is used to measure performance for the corresponding paper. Performance might have been affected during refactoring. | ||
|
||
Compilation on linux: | ||
Tested on Ubuntu 14 x64 with gcc 4.7. Use the following commands to compile and run the rendering engine. | ||
You will need the glut and gsl libraries, hence run the following commands: | ||
1. sudo apt-get install freeglut3 freeglut3-dev | ||
2. sudo apt-get install libxmu-dev libxi-dev | ||
3. sudo apt-get install libgsl0ldbl | ||
4. sudo apt-get install gsl-bin libgsl0-dev | ||
Uncompress the project and cd into it. Then execute the following commands: | ||
5. cd renderer | ||
6. mkdir build | ||
7. cd build | ||
8. ccmake .. | ||
9. make | ||
Run the application with the provided configuration file (models/conference/conference.ecs). | ||
10. ./renderer -c ../models/conference/conference.ecs | ||
|
||
|
||
Compilation on Windows x64 with Visual Studio 2010: | ||
Assuming you have the source located at yourpath | ||
1. add the folder yourpath/embree_rtc/lib/x64 to your PATH | ||
2. set the EMBREE_INSTALL_DIR environment variable to the main folder of Embree i.e., yourpath/embree_rtc. | ||
3. use the provided Microsoft Visual Studio 2010 solution file (in the folder yourpath/renderer). | ||
4. run the application in VS2010 with the provided configuration file (yourpath/renderer/models/conference/conference.ecs) by setting the command line arguments to: | ||
-c yourpath/renderer/models/conference/conference.ecs | ||
|
||
Usage Details: | ||
Detailed readme files for Embree can be found in the folders: embree_rtc (embree_rtc_linux) and renderer. The new command line parameters are all listed and explained in the renderer/models/conference/conference.ecs file. | ||
|
||
For the sake of completeness we list them here as well: | ||
Location of the model file | ||
-i conference.obj | ||
Setting the used renderer. Different renderers are: vplrenderer, ctrenderer, icrenderer, lsrenderer, lcrenderer, mdrenderer. Simply substitute the one to run into the below option. | ||
-renderer ctrenderer { depth = 9 } | ||
Rendered image size | ||
-size 256 256 | ||
The number of samples per pixel | ||
-spp 1 | ||
The number of virtual point lights | ||
-vplnumber 1000 | ||
The file to read/write the vpl configuration (if the file is present it overwrites the vplnumber setting) | ||
-vplfile conference.vpl | ||
The maximum error for the methods in the lightcuts family | ||
-error 0.01 | ||
Option to swith sampling on or off for illuminationcut: full, sampling | ||
-sampling sampling | ||
Parameter that controls the slice number for lightslice | ||
-seed 400 | ||
Parameter that controls the columns number for lightslice | ||
-budget 400 | ||
The output filename (currently only tga but other formats can be supported as well) | ||
-o conference.tga | ||
The setup of lightsources. Complete list of different types (e.g. spotlight) can be found in the embree renderer readme or other ecs files. For quadlight the parameters are the position of a corner (3) two vectors pointing to the neighboring vertices (6) and intensity (3) | ||
-quadlight -120 100 -150 0 0 80 50 0 0 50 50 50 | ||
Camera position | ||
-vp 1478 553 -1000 | ||
Camera view direction | ||
-vi 478 173 000 | ||
Camera up | ||
-vu 0 1 0 | ||
Camera field of view | ||
-fov 50 | ||
|
||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
// ======================================================================== // | ||
// Copyright 2009-2014 Intel Corporation // | ||
// // | ||
// Licensed under the Apache License, Version 2.0 (the "License"); // | ||
// you may not use this file except in compliance with the License. // | ||
// You may obtain a copy of the License at // | ||
// // | ||
// http://www.apache.org/licenses/LICENSE-2.0 // | ||
// // | ||
// Unless required by applicable law or agreed to in writing, software // | ||
// distributed under the License is distributed on an "AS IS" BASIS, // | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // | ||
// See the License for the specific language governing permissions and // | ||
// limitations under the License. // | ||
// ======================================================================== // | ||
|
||
#ifndef __RTCORE_H__ | ||
#define __RTCORE_H__ | ||
|
||
#include <stddef.h> | ||
|
||
#ifndef RTCORE_API | ||
#ifdef _WIN32 | ||
# define RTCORE_API extern "C" __declspec(dllimport) | ||
#else | ||
# define RTCORE_API extern "C" | ||
#endif | ||
#endif | ||
|
||
#ifdef _WIN32 | ||
# define RTCORE_ALIGN(...) __declspec(align(__VA_ARGS__)) | ||
#else | ||
# define RTCORE_ALIGN(...) __attribute__((aligned(__VA_ARGS__))) | ||
#endif | ||
|
||
#include "rtcore_scene.h" | ||
#include "rtcore_geometry.h" | ||
#include "rtcore_geometry_user.h" | ||
|
||
/*! \file rtcore.h Defines the Embree Ray Tracing Kernel API for C and C++ | ||
This file defines the Embree ray tracing kernel API for C and | ||
C++. The user is supposed to include this file, and alternatively | ||
the rtcore_ray.h file, but none of the other .h files in this | ||
folder. */ | ||
|
||
/*! \{ */ | ||
|
||
/*! \brief Initializes the Embree ray tracing core | ||
Initializes the ray tracing core and passed some configuration | ||
string. The configuration string allows to configure implementation | ||
specific parameters. If this string is NULL, a default configuration | ||
is used. The following configuration flags are supported by the | ||
Embree implementation of the API: | ||
threads = num, // sets the number of threads to use (default is to use all threads) | ||
verbose = num, // sets verbosity level (default is 0) | ||
If Embree is started on an unsupported CPU, rtcInit will fail and | ||
set the RTC_UNSUPPORTED_CPU error code. | ||
*/ | ||
RTCORE_API void rtcInit(const char* cfg = NULL); | ||
|
||
/*! \brief Shuts down Embree. | ||
Shuts down the ray tracing core. After shutdown, all scene handles | ||
are invalid, and invoking any API call except rtcInit is not | ||
allowed. The application should invoke this call before | ||
terminating. It is safe to call rtcInit again after an rtcExit | ||
call. */ | ||
RTCORE_API void rtcExit(); | ||
|
||
/*! \brief Error codes returned by the rtcGetError function. */ | ||
enum RTCError { | ||
RTC_NO_ERROR = 0, //!< No error has been recorded. | ||
RTC_UNKNOWN_ERROR = 1, //!< An unknown error has occured. | ||
RTC_INVALID_ARGUMENT = 2, //!< An invalid argument is specified | ||
RTC_INVALID_OPERATION = 3, //!< The operation is not allowed for the specified object. | ||
RTC_OUT_OF_MEMORY = 4, //!< There is not enough memory left to execute the command. | ||
RTC_UNSUPPORTED_CPU = 5, //!< The CPU is not supported as it does not support SSE2. | ||
}; | ||
|
||
/*! \brief Returns the value of the per-thread error flag. | ||
If an error occurs this flag is set to an error code if it stores no | ||
previous error. The rtcGetError function reads and returns the | ||
currently stored error and clears the error flag again. */ | ||
RTCORE_API RTCError rtcGetError(); | ||
|
||
/*! \brief Type of error callback function. */ | ||
typedef void (*RTC_ERROR_FUNCTION)(const RTCError code, const char* str); | ||
|
||
/*! \brief Sets a callback function that is called whenever an error occurs. */ | ||
RTCORE_API void rtcSetErrorFunction(RTC_ERROR_FUNCTION func); | ||
|
||
/*! \brief Implementation specific (do not call). | ||
This function is implementation specific and only for debugging | ||
purposes. Do not call it. */ | ||
RTCORE_API void rtcDebug(); | ||
|
||
/*! \brief Helper to easily combing scene flags */ | ||
inline RTCSceneFlags operator|(const RTCSceneFlags a, const RTCSceneFlags b) { | ||
return (RTCSceneFlags)((size_t)a | (size_t)b); | ||
} | ||
|
||
/*! \brief Helper to easily combing algorithm flags */ | ||
inline RTCAlgorithmFlags operator|(const RTCAlgorithmFlags a, const RTCAlgorithmFlags b) { | ||
return (RTCAlgorithmFlags)((size_t)a | (size_t)b); | ||
} | ||
|
||
/*! \brief Helper to easily combing geometry flags */ | ||
inline RTCGeometryFlags operator|(const RTCGeometryFlags a, const RTCGeometryFlags b) { | ||
return (RTCGeometryFlags)((size_t)a | (size_t)b); | ||
} | ||
|
||
/*! \} */ | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
// ======================================================================== // | ||
// Copyright 2009-2014 Intel Corporation // | ||
// // | ||
// Licensed under the Apache License, Version 2.0 (the "License"); // | ||
// you may not use this file except in compliance with the License. // | ||
// You may obtain a copy of the License at // | ||
// // | ||
// http://www.apache.org/licenses/LICENSE-2.0 // | ||
// // | ||
// Unless required by applicable law or agreed to in writing, software // | ||
// distributed under the License is distributed on an "AS IS" BASIS, // | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // | ||
// See the License for the specific language governing permissions and // | ||
// limitations under the License. // | ||
// ======================================================================== // | ||
|
||
#ifndef __RTCORE_ISPH__ | ||
#define __RTCORE_ISPH__ | ||
|
||
#ifdef _WIN32 | ||
# define RTCORE_API extern "C" | ||
#else | ||
# define RTCORE_API extern "C" | ||
#endif | ||
|
||
#ifdef _WIN32 | ||
# define RTCORE_ALIGN(...) // FIXME: need to specify alignment | ||
#else | ||
# define RTCORE_ALIGN(...) // FIXME: need to specify alignment | ||
#endif | ||
|
||
#include "rtcore_scene.isph" | ||
#include "rtcore_geometry.isph" | ||
#include "rtcore_geometry_user.isph" | ||
|
||
/*! \file rtcore.isph Defines the Embree Ray Tracing Kernel API for ISPC. | ||
|
||
This file defines the Embree ray tracing kernel API for C and | ||
C++. The user is supposed to include this file, and alternatively | ||
the rtcore_ray.isph file, but none of the other .isph files in this | ||
folder. */ | ||
|
||
/*! \{ */ | ||
|
||
/*! \brief Initializes the Embree ray tracing core | ||
|
||
Initializes the ray tracing core and passed some configuration | ||
string. The configuration string allows to configure implementation | ||
specific parameters. If this string is NULL, a default configuration | ||
is used. The following configuration flags are supported by the | ||
Embree implementation of the API: | ||
|
||
threads = num, // sets the number of threads to use (default is to use all threads) | ||
verbose = num, // sets verbosity level (default is 0) | ||
|
||
If Embree is started on an unsupported CPU, rtcInit will fail and | ||
set the RTC_UNSUPPORTED_CPU error code. | ||
|
||
*/ | ||
void rtcInit(const uniform int8* uniform cfg = NULL); | ||
|
||
/*! \brief Shuts down Embree. | ||
|
||
Shuts down the ray tracing core. After shutdown, all scene handles | ||
are invalid, and invoking any API call except rtcInit is not | ||
allowed. The application should invoke this call before | ||
terminating. It is safe to call rtcInit again after an rtcExit | ||
call. */ | ||
void rtcExit(); | ||
|
||
/*! \brief Error codes returned by the rtcGetError function. */ | ||
enum RTCError { | ||
RTC_NO_ERROR = 0, //!< No error has been recorded. | ||
RTC_UNKNOWN_ERROR = 1, //!< An unknown error has occured. | ||
RTC_INVALID_ARGUMENT = 2, //!< An invalid argument is specified | ||
RTC_INVALID_OPERATION = 3, //!< The operation is not allowed for the specified object. | ||
RTC_OUT_OF_MEMORY = 4, //!< There is not enough memory left to execute the command. | ||
RTC_UNSUPPORTED_CPU = 5 //!< The CPU is not supported as it does not support SSE2. | ||
}; | ||
|
||
/*! \brief Returns the value of the per-thread error flag. | ||
|
||
If an error occurs this flag is set to an error code if it stores no | ||
previous error. The rtcGetError function reads and returns the | ||
currently stored error and clears the error flag again. */ | ||
uniform RTCError rtcGetError(); | ||
|
||
/*! \brief Type of error callback function. */ | ||
typedef void (*uniform RTC_ERROR_FUNCTION)(const uniform RTCError code, const uniform int8* uniform str); | ||
|
||
/*! \brief Sets a callback function that is called whenever an error occurs. */ | ||
void rtcSetErrorFunction(uniform RTC_ERROR_FUNCTION func); | ||
|
||
/*! \brief Implementation specific (do not call). | ||
|
||
This function is implementation specific and only for debugging | ||
purposes. Do not call it. */ | ||
void rtcDebug(); | ||
|
||
/*! \} */ | ||
|
||
#endif |
Oops, something went wrong.