Skip to content

Commit

Permalink
[WIP] port of multi_instanced_geometry tutorial to RTCTraversable
Browse files Browse the repository at this point in the history
interface was missing
  • Loading branch information
freibold committed Nov 26, 2024
1 parent 7cf0a59 commit 190b4aa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ void renderPixelStandard(const TutorialData& data, int x, int y,

RandomSampler sampler;
Ray primaryRay = samplePrimaryRay(data, x, 0, y, 0, camera, sampler, stats);
rtcIntersect1(data.g_scene, RTCRayHit_(primaryRay), &iargs);
rtcTraversableIntersect1(data.g_traversable, RTCRayHit_(primaryRay), &iargs);

Vec3fa color = Vec3fa(0.f);
if (primaryRay.geomID != RTC_INVALID_GEOMETRY_ID)
Expand All @@ -242,7 +242,7 @@ void renderPixelStandard(const TutorialData& data, int x, int y,
Vec3fa emission;
sampleLightDirection(RandomSampler_get3D(sampler), lightDir, emission);
Ray shadowRay = makeShadowRay(primaryRay, lightDir, stats);
rtcOccluded1(data.g_scene, RTCRay_(shadowRay), &sargs);
rtcTraversableOccluded1(data.g_traversable, RTCRay_(shadowRay), &sargs);
color = shade(data, primaryRay, shadowRay, lightDir, emission);
}

Expand Down Expand Up @@ -305,6 +305,7 @@ extern "C" void device_init(char* cfg)
{
TutorialData_Constructor(&g_data);
g_scene = g_data.g_scene = initializeScene(g_data, g_device);
g_data.g_traversable = rtcGetSceneTraversable(g_scene);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ struct InstanceLevels
struct TutorialData
{
RTCScene g_scene;
RTCTraversable g_traversable;
InstanceLevels g_instanceLevels;

/* accumulation buffer */
Expand Down Expand Up @@ -51,6 +52,7 @@ extern "C" void cleanupScene(TutorialData& data);
inline void TutorialData_Constructor(TutorialData* This)
{
This->g_scene = nullptr;
This->g_traversable = nullptr;
This->g_accu = nullptr;
This->g_accu_width = 0;
This->g_accu_height = 0;
Expand Down

0 comments on commit 190b4aa

Please sign in to comment.