Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frei/device memory support rebased #517

Open
wants to merge 54 commits into
base: devel
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
6a8d92d
fix wrong assert about maxTimeSegments.
freibold Sep 9, 2024
df51e32
fix missing sign-extension when using device memory for BVH data.
freibold Sep 18, 2024
ad7c524
BVH buffer in explicitly managed host/device memory on systems
freibold Sep 13, 2024
fec0830
triangle geometry is now host/device, scene next
freibold Sep 26, 2024
eebde99
All geom types work, spilling bug?
freibold Oct 16, 2024
2dc2db3
compile fixes
freibold Oct 24, 2024
fb70c9f
geometry data works
freibold Oct 28, 2024
7b7b2b2
add debug tutorial and restore state of other tutorials
freibold Oct 29, 2024
2f2e11e
scene is now in device memory, too. USM shared memory is now only
freibold Nov 6, 2024
0e2ab1e
introduced read only handle RTCTraversable which is accessible on
freibold Nov 11, 2024
4f649af
memory passing interface
freibold Nov 18, 2024
35bb8a7
rework buffer interface
freibold Nov 22, 2024
3a74ac0
test address sanitizer issue
freibold Nov 25, 2024
2989ea6
cleanups
freibold Nov 26, 2024
480bfbd
do not use ALIGNED_STRUCT_ macro for Scene and Geometry
freibold Nov 26, 2024
d71a086
port of multi_instanced_geometry tutorial to RTCTraversable
freibold Nov 26, 2024
1dd882e
port forest tutorial to new host/device memory support
freibold Nov 27, 2024
bc74365
change API naming for buffers form 'Ex' to 'HostDevice'
freibold Nov 27, 2024
e0d8de2
add ISPC API using RTCTraversable
freibold Nov 29, 2024
ba9c6f2
create CPP from ISPC tutorials
freibold Nov 29, 2024
09da49d
add padding to tree vertex and color data buffers for safe SIMD
freibold Dec 2, 2024
74c52ae
small fix for validation API
freibold Dec 2, 2024
f9a48f9
less alloc/free when creating device representation of scenen/geometry
freibold Dec 4, 2024
7e0655c
add sycl events for sychronization
freibold Dec 5, 2024
4d9da96
add cmake option for explicit host/device BVH data
freibold Dec 5, 2024
f47fa75
clear host scratch space for static scenes
freibold Dec 5, 2024
7ada277
rename host_device_memory tutorial and add CI tests
freibold Dec 5, 2024
f202294
refactor alloc. remove global (tls) SYCL context and device.
freibold Dec 9, 2024
cdb0b17
add nightly Windows multilevel test.
freibold Dec 9, 2024
c110544
update documentation for RTCBuffer
freibold Dec 9, 2024
cfed523
fix wrong deallocation in multi_instance_geometry tutorial.
freibold Dec 9, 2024
c0436a7
update rtcSet(New|Shared)GeometryBuffer(|HostDevice) documentation
freibold Dec 10, 2024
a1c7ab3
update rtcCommitScene(|WithQueue) documentation
freibold Dec 10, 2024
2b31357
rename memory types and account for host unified memory in buffer con…
freibold Dec 11, 2024
d34cb71
revert accidental changes in ray flag settings
freibold Dec 11, 2024
4b894ff
docu fixes
freibold Dec 11, 2024
81af3a2
change rtcCommit???WithQueue interface to return sycl::event
freibold Dec 11, 2024
f144ef3
make rtcCommitSceneWithQueue work with out-of-order SYCL queues, too
freibold Dec 11, 2024
2630ac3
updating general intro documentation
freibold Dec 11, 2024
e9f1a6d
documentation for ray queries using RTCTraversable
freibold Dec 11, 2024
749ffb1
more general documentation
freibold Dec 11, 2024
9a9d68c
add export filters for commit with queue API functions
freibold Dec 11, 2024
df467df
add CI test for BVH data in host device memory
freibold Dec 11, 2024
3d5a6ba
test new ICX version
freibold Dec 11, 2024
c782e31
changelog, typos
freibold Dec 11, 2024
e90e139
update internal Linux and Window driver in CI
freibold Dec 11, 2024
72f40aa
remove timing output from dynamic scene tutorial
freibold Dec 13, 2024
bb5d193
fix issues with host/device memory API on iGPU
freibold Dec 13, 2024
dcd35a0
fix blender segfault with geometry == NULL inside geometries array
dopitz Dec 16, 2024
6702c2b
removed internal rtas builder, made EMBREE_SYCL_L0_RTAS_BUILDER the d…
dopitz Jan 17, 2025
d3c165b
EMBREE_SYCL_BVH_DATA_HOST_DEVICE turned on by default now
dopitz Jan 22, 2025
b75cd82
Revert "EMBREE_SYCL_BVH_DATA_HOST_DEVICE turned on by default now"
dopitz Jan 22, 2025
3fd0584
documentation: rtcTraversable invalidation on rtcCommit
dopitz Jan 23, 2025
898a994
Removed files that got checked in by accident
stefanatwork Feb 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
create CPP from ISPC tutorials
freibold authored and dopitz committed Jan 17, 2025
commit ba9c6f28e322726d90b5c1107229d5baeace4c24
6 changes: 3 additions & 3 deletions tutorials/curve_geometry/curve_geometry_device.ispc
Original file line number Diff line number Diff line change
@@ -138,6 +138,7 @@ export void device_init (uniform int8* uniform cfg)

/* commit changes to scene */
rtcCommitScene (data.g_scene);
data.g_traversable = rtcGetSceneTraversable(data.g_scene);
}

/* task that renders a single screen tile */
@@ -156,7 +157,7 @@ void renderPixelStandard(const uniform TutorialData& data,
uniform RTCIntersectArguments iargs;
rtcInitIntersectArguments(&iargs);
iargs.feature_mask = (uniform RTCFeatureFlags) (FEATURE_MASK);
rtcIntersectV(data.g_scene,RTCRayHit_(ray),&iargs);
rtcTraversableIntersectV(data.g_traversable,RTCRayHit_(ray),&iargs);
RayStats_addRay(stats);

/* shade pixels */
@@ -188,7 +189,7 @@ void renderPixelStandard(const uniform TutorialData& data,
uniform RTCOccludedArguments sargs;
rtcInitOccludedArguments(&sargs);
sargs.feature_mask = (uniform RTCFeatureFlags) (FEATURE_MASK);
rtcOccludedV(data.g_scene,RTCRay_(shadow),&sargs);
rtcTraversableOccludedV(data.g_traversable,RTCRay_(shadow),&sargs);
RayStats_addShadowRay(stats);

/* add light contribution */
@@ -286,6 +287,5 @@ export void device_render (uniform int* uniform pixels,
/* called by the C++ code for cleanup */
export void device_cleanup ()
{
rtcReleaseScene (data.g_scene); data.g_scene = NULL;
TutorialData_Destructor(&data);
}
2 changes: 2 additions & 0 deletions tutorials/curve_geometry/curve_geometry_device.isph
Original file line number Diff line number Diff line change
@@ -68,6 +68,7 @@ uniform int8 static_hair_flags_linear[NUM_CURVES] = {
struct TutorialData
{
RTCScene g_scene;
RTCTraversable g_traversable;
Vec4f* hair_vertices;
Vec3fa* hair_normals;
Vec3fa* hair_vertex_colors;
@@ -79,6 +80,7 @@ struct TutorialData
inline void TutorialData_Constructor(uniform TutorialData* uniform This)
{
This->g_scene = NULL;
This->g_traversable = NULL;
This->hair_vertices = uniform new uniform Vec4f[NUM_VERTICES];
This->hair_normals = uniform new uniform Vec3fa[NUM_VERTICES];
This->hair_vertex_colors = uniform new uniform Vec3fa[NUM_VERTICES];
5 changes: 3 additions & 2 deletions tutorials/dynamic_scene/dynamic_scene_device.ispc
Original file line number Diff line number Diff line change
@@ -163,7 +163,7 @@ void renderPixelStandard(const uniform TutorialData& data,
rtcInitIntersectArguments(&iargs);
iargs.feature_mask = (uniform RTCFeatureFlags) (FEATURE_MASK);

rtcIntersectV(data.g_scene,RTCRayHit_(ray),&iargs);
rtcTraversableIntersectV(data.g_traversable,RTCRayHit_(ray),&iargs);
RayStats_addRay(stats);

/* shade pixels */
@@ -181,7 +181,7 @@ void renderPixelStandard(const uniform TutorialData& data,
uniform RTCOccludedArguments sargs;
rtcInitOccludedArguments(&sargs);
sargs.feature_mask = (uniform RTCFeatureFlags) (FEATURE_MASK);
rtcOccludedV(data.g_scene,RTCRay_(shadow),&sargs);
rtcTraversableOccludedV(data.g_traversable,RTCRay_(shadow),&sargs);
RayStats_addShadowRay(stats);

/* add light contribution */
@@ -309,6 +309,7 @@ export void device_render (uniform int* uniform pixels,

/* commit changes to scene */
rtcCommitScene (data.g_scene);
data.g_traversable = rtcGetSceneTraversable(data.g_scene);
}

/* called by the C++ code for cleanup */
2 changes: 2 additions & 0 deletions tutorials/dynamic_scene/dynamic_scene_device.isph
Original file line number Diff line number Diff line change
@@ -15,6 +15,7 @@ struct TutorialData

/* scene data */
RTCScene g_scene;
RTCTraversable g_traversable;

uniform Vec3fa* uniform position;
uniform Vec3fa* uniform colors;
@@ -28,6 +29,7 @@ void TutorialData_Constructor(uniform TutorialData* uniform This)
This->numPhi = NUM_PHI;
This->numTheta = NUM_THETA;
This->g_scene = NULL;
This->g_traversable = NULL;
This->position = uniform new uniform Vec3fa[NUM_SPHERES];
This->colors = uniform new uniform Vec3fa[NUM_SPHERES+1];
This->radius = uniform new uniform float[NUM_SPHERES];
2 changes: 2 additions & 0 deletions tutorials/grid_geometry/grid_geometry_device.cpp
Original file line number Diff line number Diff line change
@@ -470,6 +470,7 @@ void createGridGeometry (GridMesh& gmesh)
}

/* create normal debug geometry */
#if 0
gmesh.geomNormals = rtcNewGeometry (g_device, RTC_GEOMETRY_TYPE_ROUND_BEZIER_CURVE);
Vec3ff *nvertices = (Vec3ff *) rtcSetNewGeometryBuffer(gmesh.geomNormals,RTC_BUFFER_TYPE_VERTEX,0,RTC_FORMAT_FLOAT4,sizeof(Vec3ff),4*numVertices);
int* curves = (int *) rtcSetNewGeometryBuffer(gmesh.geomNormals,RTC_BUFFER_TYPE_INDEX,0,RTC_FORMAT_UINT ,sizeof(int) ,numVertices);
@@ -497,6 +498,7 @@ void createGridGeometry (GridMesh& gmesh)
}
h+=sphere_faces[f];
}
#endif

/* we do not need this temporary data anymore */
rtcReleaseGeometry(geomSubdiv);
4 changes: 2 additions & 2 deletions tutorials/grid_geometry/grid_geometry_device.h
Original file line number Diff line number Diff line change
@@ -27,8 +27,8 @@ struct TutorialData

void TutorialData_Constructor(TutorialData* This)
{
This->g_scene = nullptr;
This->g_traversable = nullptr;
This->g_scene = nullptr;
This->g_traversable = nullptr;
This->gmesh.geom = nullptr;
This->gmesh.geomNormals = nullptr;
This->gmesh.egrids = nullptr;
5 changes: 3 additions & 2 deletions tutorials/grid_geometry/grid_geometry_device.ispc
Original file line number Diff line number Diff line change
@@ -545,6 +545,7 @@ export void device_init (uniform int8* uniform cfg)

/* commit changes to scene */
rtcCommitScene (data.g_scene);
data.g_traversable = rtcGetSceneTraversable(data.g_scene);
}

Vec3f mylerp(float f, const Vec3f& a, const Vec3f& b) { // FIXME: use lerp, need to make ISPC lerp and C++ lerp compatible first
@@ -567,7 +568,7 @@ void renderPixelStandard(const uniform TutorialData& data,
uniform RTCIntersectArguments iargs;
rtcInitIntersectArguments(&iargs);
iargs.feature_mask = (uniform RTCFeatureFlags) (FEATURE_MASK);
rtcIntersectV(data.g_scene,RTCRayHit_(ray),&iargs);
rtcTraversableIntersectV(data.g_traversable,RTCRayHit_(ray),&iargs);
RayStats_addRay(stats);

/* shade pixels */
@@ -608,7 +609,7 @@ void renderPixelStandard(const uniform TutorialData& data,
uniform RTCOccludedArguments sargs;
rtcInitOccludedArguments(&sargs);
sargs.feature_mask = (uniform RTCFeatureFlags) (FEATURE_MASK);
rtcOccludedV(data.g_scene,RTCRay_(shadow),&sargs);
rtcTraversableOccludedV(data.g_traversable,RTCRay_(shadow),&sargs);
RayStats_addShadowRay(stats);

/* add light contribution */
4 changes: 3 additions & 1 deletion tutorials/grid_geometry/grid_geometry_device.isph
Original file line number Diff line number Diff line change
@@ -18,13 +18,15 @@ struct TutorialData
{
/* scene data */
RTCScene g_scene;
RTCTraversable g_traversable;

uniform GridMesh gmesh;
};

void TutorialData_Constructor(uniform TutorialData* uniform This)
{
This->g_scene = NULL;
This->g_scene = NULL;
This->g_traversable = NULL;
This->gmesh.geom = NULL;
This->gmesh.geomNormals = NULL;
This->gmesh.egrids = NULL;
2 changes: 1 addition & 1 deletion tutorials/hair_geometry/hair_geometry_device.cpp
Original file line number Diff line number Diff line change
@@ -250,7 +250,7 @@ Vec3fa occluded(RTCTraversable traversable, RayQueryContext* context, Ray& ray)
args.filter = occlusionFilter;

rtcTraversableOccluded1(traversable,RTCRay_(ray),&args);
context->userRayExt = NULL;
context->userRayExt = nullptr;

if (ray.tfar < 0) return Vec3fa(0.0f);
else return transparency;
9 changes: 5 additions & 4 deletions tutorials/hair_geometry/hair_geometry_device.ispc
Original file line number Diff line number Diff line change
@@ -232,7 +232,7 @@ RTC_SYCL_INDIRECTLY_CALLABLE unmasked void occlusionFilter(const RTCFilterFuncti
valid_i[programIndex] = 0;
}

Vec3f occluded(RTCScene scene, uniform RayQueryContext* uniform context, Ray& ray)
Vec3f occluded(RTCTraversable traversable, uniform RayQueryContext* uniform context, Ray& ray)
{
Vec3f transparency = make_Vec3f(1.0f);
context->userRayExt = &transparency;
@@ -247,7 +247,7 @@ Vec3f occluded(RTCScene scene, uniform RayQueryContext* uniform context, Ray& ra
args.feature_mask = (uniform RTCFeatureFlags) (FEATURE_MASK);
args.filter = occlusionFilter;

rtcOccludedV(scene,RTCRay_(ray),&args);
rtcTraversableOccludedV(traversable,RTCRay_(ray),&args);
context->userRayExt = NULL;

if (ray.tfar < 0) return make_Vec3f(0.0f);
@@ -286,7 +286,7 @@ Vec3f renderPixel(const uniform TutorialData& data, float x, float y, const unif
return color;

/* intersect ray with scene and gather all hits */
rtcIntersectV(data.scene,RTCRayHit_(ray),&args);
rtcTraversableIntersectV(data.traversable,RTCRayHit_(ray),&args);
RayStats_addRay(stats);

/* exit if we hit environment */
@@ -326,7 +326,7 @@ Vec3f renderPixel(const uniform TutorialData& data, float x, float y, const unif

/* sample directional light */
Ray shadow = make_Ray(ray.org + ray.tfar*ray.dir, neg(make_Vec3f(data.dirlight_direction)), eps, inf, time);
Vec3f T = occluded(data.scene,&context,shadow);
Vec3f T = occluded(data.traversable,&context,shadow);
RayStats_addShadowRay(stats);
Vec3f c = AnisotropicBlinn__eval(&brdf,neg(ray.dir),neg(make_Vec3f(data.dirlight_direction)));
color = color + weight*c*T*make_Vec3f(data.dirlight_intensity);
@@ -416,6 +416,7 @@ export void device_init (uniform int8* uniform cfg)

/* create scene */
g_scene = data.scene = convertScene(data.ispc_scene);
data.traversable = rtcGetSceneTraversable(data.scene);
}

export void renderFrameStandard (uniform int* uniform pixels,
2 changes: 2 additions & 0 deletions tutorials/hair_geometry/hair_geometry_device.isph
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@ extern uniform Vec3fa g_ambient_intensity;
struct TutorialData
{
RTCScene scene;
RTCTraversable traversable;
uniform ISPCScene* uniform ispc_scene;
uniform Vec3f dirlight_direction;
uniform Vec3f dirlight_intensity;
@@ -47,6 +48,7 @@ namespace embree {
void TutorialData_Constructor(uniform TutorialData* uniform This)
{
This->scene = NULL;
This->traversable = NULL;
This->ispc_scene = g_ispc_scene;
This->dirlight_direction = make_Vec3f(g_dirlight_direction);
This->dirlight_intensity = make_Vec3f(g_dirlight_intensity);
7 changes: 4 additions & 3 deletions tutorials/instanced_geometry/instanced_geometry_device.ispc
Original file line number Diff line number Diff line change
@@ -174,7 +174,7 @@ Vec3f renderPixel(const uniform TutorialData& data, float x, float y, const unif
rtcInitIntersectArguments(&iargs);
iargs.feature_mask = (uniform RTCFeatureFlags) (FEATURE_MASK);

rtcIntersectV(data.g_scene,RTCRayHit_(ray),&iargs);
rtcTraversableIntersectV(data.g_traversable,RTCRayHit_(ray),&iargs);
RayStats_addRay(stats);

/* shade pixels */
@@ -186,7 +186,7 @@ Vec3f renderPixel(const uniform TutorialData& data, float x, float y, const unif
if (ray.instID[0] != RTC_INVALID_GEOMETRY_ID)
{
AffineSpace3f xfm;
rtcGetGeometryTransformFromScene(data.g_scene,ray.instID[0],0.0f,RTC_FORMAT_FLOAT3X4_COLUMN_MAJOR,&xfm);
rtcGetGeometryTransformFromTraversable(data.g_traversable,ray.instID[0],0.0f,RTC_FORMAT_FLOAT3X4_COLUMN_MAJOR,&xfm);
Ns = xfmNormal(xfm,Ns);
//Ns = xfmVector(data.normal_xfm[ray.instID[0]],Ns);
}
@@ -207,7 +207,7 @@ Vec3f renderPixel(const uniform TutorialData& data, float x, float y, const unif
rtcInitOccludedArguments(&sargs);
sargs.feature_mask = (uniform RTCFeatureFlags) (FEATURE_MASK);

rtcOccludedV(data.g_scene,RTCRay_(shadow),&sargs);
rtcTraversableOccludedV(data.g_traversable,RTCRay_(shadow),&sargs);
RayStats_addShadowRay(stats);

/* add light contribution */
@@ -341,6 +341,7 @@ export void device_render (uniform int* uniform pixels,
rtcCommitGeometry(g_instance2);
rtcCommitGeometry(g_instance3);
rtcCommitScene (data.g_scene);
data.g_traversable = rtcGetSceneTraversable(data.g_scene);
}

/* called by the C++ code for cleanup */
2 changes: 2 additions & 0 deletions tutorials/instanced_geometry/instanced_geometry_device.isph
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@ struct TutorialData
/* scene data */
RTCScene g_scene;
RTCScene g_scene1;
RTCTraversable g_traversable;

uniform AffineSpace3f* uniform instance_xfm;
uniform LinearSpace3f* uniform normal_xfm;
@@ -31,6 +32,7 @@ void TutorialData_Constructor(uniform TutorialData* uniform This)
{
This->g_scene = NULL;
This->g_scene1 = NULL;
This->g_traversable = NULL;
This->instance_xfm = uniform new uniform AffineSpace3f[4];
This->normal_xfm = uniform new uniform LinearSpace3f[4];
This->colors = uniform new uniform Vec3f[4*4];
Original file line number Diff line number Diff line change
@@ -380,7 +380,6 @@ extern "C" void device_init (char* cfg)

/* commit changes to scene */
rtcCommitScene (data.g_scene);

data.g_traversable = rtcGetSceneTraversable(data.g_scene);
}

5 changes: 3 additions & 2 deletions tutorials/intersection_filter/intersection_filter_device.ispc
Original file line number Diff line number Diff line change
@@ -74,7 +74,7 @@ void renderPixelStandard(const uniform TutorialData& data,
#if USE_ARGUMENT_CALLBACKS
iargs.filter = intersectionFilter;
#endif
rtcIntersectV(data.g_scene,RTCRayHit_(primary),&iargs);
rtcTraversableIntersectV(data.g_traversable,RTCRayHit_(primary),&iargs);
RayStats_addRay(stats);

/* shade pixels */
@@ -101,7 +101,7 @@ void renderPixelStandard(const uniform TutorialData& data,
#if USE_ARGUMENT_CALLBACKS
sargs.filter = occlusionFilter;
#endif
rtcOccludedV(data.g_scene,RTCRay_(shadow),&sargs);
rtcTraversableOccludedV(data.g_traversable,RTCRay_(shadow),&sargs);
RayStats_addShadowRay(stats);

/* add light contribution */
@@ -378,6 +378,7 @@ export void device_init (uniform int8* uniform cfg)

/* commit changes to scene */
rtcCommitScene (data.g_scene);
data.g_traversable = rtcGetSceneTraversable(data.g_scene);
}

/* task that renders a single screen tile */
2 changes: 2 additions & 0 deletions tutorials/intersection_filter/intersection_filter_device.isph
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@
struct TutorialData
{
RTCScene g_scene;
RTCTraversable g_traversable;
uniform Vec3f* uniform colors;

RTCFilterFunctionN intersectionFilter;
@@ -15,6 +16,7 @@ struct TutorialData
inline void TutorialData_Constructor(uniform TutorialData* uniform This)
{
This->g_scene = NULL;
This->g_traversable = NULL;
This->colors = NULL;
This->intersectionFilter = NULL;
This->occlusionFilter = NULL;
6 changes: 6 additions & 0 deletions tutorials/ispc2cpp.sh
Original file line number Diff line number Diff line change
@@ -140,9 +140,15 @@ sed -i.backup 's/RTCRay1/RTCRay/g' $2
sed -i.backup 's/rtcIntersectV/rtcIntersect1/g' $2
sed -i.backup 's/rtcOccludedV/rtcOccluded1/g' $2

sed -i.backup 's/rtcTraversableIntersectV/rtcTraversableIntersect1/g' $2
sed -i.backup 's/rtcTraversableOccludedV/rtcTraversableOccluded1/g' $2

sed -i.backup 's/rtcForwardIntersectV/rtcForwardIntersect1/g' $2
sed -i.backup 's/rtcForwardOccludedV/rtcForwardOccluded1/g' $2

sed -i.backup 's/rtcTraversableForwardIntersectV/rtcTraversableForwardIntersect1/g' $2
sed -i.backup 's/rtcTraversableForwardOccludedV/rtcTraversableForwardOccluded1/g' $2

sed -i.backup 's/rtcInterpolateV/rtcInterpolate/g' $2

sed -i.backup 's/Texture_FLOAT32/Texture::FLOAT32/g' $2
Original file line number Diff line number Diff line change
@@ -606,6 +606,7 @@ export void device_init (uniform int8* uniform cfg)

/* commit changes to scene */
rtcCommitScene (g_scene);
data.g_traversable = rtcGetSceneTraversable(data.g_scene);
}

/* task that renders a single screen tile */
@@ -625,7 +626,7 @@ Vec3f renderPixel(const uniform TutorialData& data, float x, float y, const unif
iargs.intersect = sphereIntersectFuncN;
#endif

rtcIntersectV(data.g_scene,RTCRayHit_(ray),&iargs);
rtcTraversableIntersectV(data.g_traversable,RTCRayHit_(ray),&iargs);
RayStats_addRay(stats);

/* shade pixels */
@@ -662,7 +663,7 @@ Vec3f renderPixel(const uniform TutorialData& data, float x, float y, const unif
#if USE_ARGUMENT_CALLBACKS
sargs.occluded = sphereOccludedFuncN;
#endif
rtcOccludedV(data.g_scene,RTCRay_(shadow),&sargs);
rtcTraversableOccludedV(data.g_traversable,RTCRay_(shadow),&sargs);
RayStats_addShadowRay(stats);

/* add light contribution */
Original file line number Diff line number Diff line change
@@ -21,6 +21,7 @@ struct TutorialData
uniform int frameID;

RTCScene g_scene;
RTCTraversable g_traversable;
uniform Vec3f* uniform face_colors;
uniform float g_time;

@@ -59,6 +60,7 @@ inline void TutorialData_Constructor(uniform TutorialData* uniform This)
{
This->frameID = 50;
This->g_scene = NULL;
This->g_traversable = NULL;
This->face_colors = uniform new uniform Vec3f[12];
This->g_time = 0;
This->g_accu = NULL;
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ namespace embree {
#define FEATURE_MASK \
RTC_FEATURE_FLAG_TRIANGLE | \
RTC_FEATURE_FLAG_INSTANCE

RTCScene g_scene = nullptr;
TutorialData g_data;
extern "C" bool g_changed;
Loading