Initial commit.

This commit is contained in:
hal8174 2024-04-23 10:14:24 +02:00
commit d3bb49b3f5
1073 changed files with 484757 additions and 0 deletions

View file

@ -0,0 +1,58 @@
## Copyright 2009-2021 Intel Corporation
## SPDX-License-Identifier: Apache-2.0
IF (EMBREE_SYCL_AOT_DEVICES STREQUAL "none")
ADD_DEFINITIONS("-DUSE_SPECIALIZATION_CONSTANTS")
ENDIF()
INCLUDE(tutorial)
ADD_TUTORIAL(pathtracer)
ADD_TUTORIAL_ISPC(pathtracer)
ADD_TUTORIAL_SYCL(pathtracer)
SET(pathtracer_tests
"models/curves/curve0.ecs"
"models/curves/curve1.ecs"
"models/curves/curve2.ecs"
"models/curves/curve3.ecs"
"models/curves/curve4.ecs"
#"models/curves/curve5.ecs"
"models/curves/oriented_curve0.ecs"
"models/curves/oriented_curve1.ecs"
"models/curves/oriented_curve2.ecs"
"models/curves/oriented_curve3.ecs"
"models/curves/oriented_curve4.ecs"
"models/curves/oriented_bspline_curve_twisted.ecs"
"models/curves/oriented_hermite_curve_twisted.ecs"
"models/msmblur/curves_msmblur.ecs"
"models/msmblur/curves_msmblur2.ecs"
"models/msmblur/lines_msmblur.ecs"
"models/msmblur/lines_msmblur2.ecs"
"models/msmblur/mblur_time_range_triangle.ecs"
"models/msmblur/mblur_time_range_quad.ecs"
"models/msmblur/mblur_time_range_grid.ecs"
"models/msmblur/mblur_time_range_curve.ecs"
"models/msmblur/mblur_time_range_line.ecs"
"models/msmblur/mblur_time_range_instancing.ecs"
"models/msmblur/mblur_time_range_sphere.ecs"
"models/msmblur/mblur_time_range_disc.ecs"
"models/msmblur/mblur_time_range_oriented_disc.ecs"
"models/points/points.ecs"
"models/quaternion_motion_blur/quaternion_quad.ecs"
)
# EMBREE_SYCL_AOT_DEVICES != none => see issue #1209
foreach(t ${pathtracer_tests})
STRING(REPLACE "/" "_" testname "${t}")
ADD_EMBREE_TEST_ECS("pathtracer_${testname}" embree_pathtracer ECS "${t}" INTENSITY 2 CONDITION "EMBREE_SYCL_AOT_DEVICES != none")
endforeach()
foreach(t ${pathtracer_tests})
STRING(REPLACE "/" "_" testname "${t}")
ADD_EMBREE_TEST_ECS("pathtracer_coherent_${testname}" embree_pathtracer ECS "${t}" INTENSITY 3 CONDITION "EMBREE_SYCL_AOT_DEVICES != none" ARGS --coherent)
endforeach()

View file

@ -0,0 +1,69 @@
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "../common/tutorial/tutorial.h"
#include "../common/tutorial/benchmark_render.h"
#if defined(EMBREE_SYCL_TUTORIAL)
# define NAME "pathtracer_sycl"
# define FEATURES FEATURE_RTCORE | FEATURE_SYCL
#else
# define NAME "pathtracer"
# define FEATURES FEATURE_RTCORE
#endif
namespace embree
{
extern "C" {
int g_spp = 1;
int g_max_path_length = 8;
bool g_accumulate = 1;
}
struct Tutorial : public SceneLoadingTutorialApplication
{
Tutorial()
: SceneLoadingTutorialApplication(NAME,FEATURES)
{
registerOption("spp", [] (Ref<ParseStream> cin, const FileName& path) {
g_spp = cin->getInt();
}, "--spp <int>: sets number of samples per pixel");
registerOption("max-path-length", [] (Ref<ParseStream> cin, const FileName& path) {
g_max_path_length = cin->getInt();
}, "--max-path-length <int>: sets maximal path length (1=primary+shadow)");
registerOption("accumulate", [] (Ref<ParseStream> cin, const FileName& path) {
g_accumulate = cin->getInt();
}, "--accumulate <bool>: accumulate samples (on by default)");
}
void postParseCommandLine() override
{
/* load default scene if none specified */
if (scene_empty_post_parse()) {
FileName file = FileName::executableFolder() + FileName("models/cornell_box.ecs");
parseCommandLine(new ParseStream(new LineCommentFilter(file, "#")), file.path());
}
}
#if defined(USE_GLFW)
void drawGUI() override
{
ImGui::Checkbox("accumulate",&g_accumulate);
ImGui::Text("max path length");
ImGui::DragInt("##max_path_length",&g_max_path_length,1.0f,1,16);
ImGui::Text("samples per pixel");
ImGui::DragInt("##samples per pixel",&g_spp,1.0f,1,16);
}
#endif
};
}
int main(int argc, char** argv) {
if (embree::TutorialBenchmark::benchmark(argc, argv)) {
return embree::TutorialBenchmark(embree::renderBenchFunc<embree::Tutorial>).main(argc, argv);
}
return embree::Tutorial().main(argc,argv);
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,79 @@
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "../common/math/random_sampler.h"
#include "../common/math/sampling.h"
#include "../common/core/differential_geometry.h"
#include "../common/tutorial/tutorial_device.h"
#include "../common/tutorial/scene_device.h"
#include "../common/tutorial/optics.h"
namespace embree {
extern "C" ISPCScene* g_ispc_scene;
extern "C" int g_instancing_mode;
extern "C" int g_spp;
extern "C" int g_max_path_length;
extern "C" bool g_accumulate;
extern "C" bool g_changed;
struct TutorialData
{
ISPCScene* ispc_scene;
int instancing_mode;
RTCRayQueryFlags iflags_coherent;
RTCRayQueryFlags iflags_incoherent;
RTCFilterFunctionN occlusionFilterOpaque;
RTCFilterFunctionN occlusionFilterHair;
int spp;
int max_path_length;
/* accumulation buffer */
Vec3ff* accu;
unsigned int accu_width;
unsigned int accu_height;
unsigned int accu_count;
bool animation;
bool use_smooth_normals;
/* scene data */
RTCScene scene;
};
void TutorialData_Constructor(TutorialData* This)
{
This->ispc_scene = g_ispc_scene;
This->instancing_mode = g_instancing_mode;
This->iflags_coherent = g_iflags_coherent;
This->iflags_incoherent = g_iflags_incoherent;
This->occlusionFilterOpaque = nullptr;
This->occlusionFilterHair = nullptr;
This->spp = g_spp;
This->max_path_length = g_max_path_length;
This->accu = nullptr;
This->accu_width = 0;
This->accu_height = 0;
This->accu_count = 0;
This->animation = true;
This->use_smooth_normals = false;
This->scene = nullptr;
}
void TutorialData_Destructor(TutorialData* This)
{
rtcReleaseScene (This->scene); This->scene = nullptr;
alignedUSMFree(This->accu); This->accu = nullptr;
This->accu_width = 0;
This->accu_height = 0;
This->accu_count = 0;
}
} // namespace embree

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,75 @@
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "../common/math/random_sampler.isph"
#include "../common/math/sampling.isph"
#include "../common/core/differential_geometry.isph"
#include "../common/tutorial/tutorial_device.isph"
#include "../common/tutorial/scene_device.h"
#include "../common/tutorial/optics.isph"
extern uniform ISPCScene* uniform g_ispc_scene;
extern uniform int g_instancing_mode;
extern uniform int g_spp;
extern uniform int g_max_path_length;
extern uniform bool g_accumulate;
extern uniform bool g_changed;
struct TutorialData
{
uniform ISPCScene* uniform ispc_scene;
uniform int instancing_mode;
RTCRayQueryFlags iflags_coherent;
RTCRayQueryFlags iflags_incoherent;
RTCFilterFunctionN occlusionFilterOpaque;
RTCFilterFunctionN occlusionFilterHair;
uniform int spp;
uniform int max_path_length;
/* accumulation buffer */
uniform Vec3ff* uniform accu;
uniform unsigned int accu_width;
uniform unsigned int accu_height;
uniform unsigned int accu_count;
uniform bool animation;
uniform bool use_smooth_normals;
/* scene data */
RTCScene scene;
};
void TutorialData_Constructor(uniform TutorialData* uniform This)
{
This->ispc_scene = g_ispc_scene;
This->instancing_mode = g_instancing_mode;
This->iflags_coherent = g_iflags_coherent;
This->iflags_incoherent = g_iflags_incoherent;
This->occlusionFilterOpaque = NULL;
This->occlusionFilterHair = NULL;
This->spp = g_spp;
This->max_path_length = g_max_path_length;
This->accu = NULL;
This->accu_width = 0;
This->accu_height = 0;
This->accu_count = 0;
This->animation = true;
This->use_smooth_normals = false;
This->scene = NULL;
}
void TutorialData_Destructor(uniform TutorialData* uniform This)
{
rtcReleaseScene (This->scene); This->scene = NULL;
delete[] This->accu; This->accu = NULL;
This->accu_width = 0;
This->accu_height = 0;
This->accu_count = 0;
}