1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 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
|