Intel® Embree Ray Tracing Kernels
Discussion forum on the open source ray tracing kernels for fast photo-realistic rendering on Intel® CPU(s)

Embree version 3 to 4 upgrade

BartekZgo
Beginner
1,207 Views

I'm trying to update Embree library from version 3 to 4 to make it working with LuxCore.

The strange thing is that method rtcIntersect1() never hits a geometry.

I have done some tests with: https://github.com/embree/embree/blob/master/tests/integration/test_embree_release/test.cpp
When executing code I've got "Object reference not set to the instance of object" exception.

So I've tried to pass RTCIntersectArguments.

RTCRayQueryContext context;
rtcInitRayQueryContext(&context);

RTCIntersectArguments intersectArgs;
rtcInitIntersectArguments(&intersectArgs);
intersectArgs.context = &context;

rtcIntersect1(scene, &rayhit, &intersectArgs);


In that case there is no error anymore, but I've got the same result as with LuxCore.  For both test cases I've got:
    "Did not find any intersection"

Currently I'm using following version of Embree:
    https://github.com/embree/embree/releases/download/v4.2.0/embree-4.2.0.x86_64.linux.tar.gz

My machine does not have GPU.

The original code of LuxCore code can be found here:
https://github.com/LuxCoreRender/LuxCore/blob/master/src/luxrays/accelerators/embreeaccel.cpp

The only modifications that I've done to luxcore code are:

  • convert RTCIntersectContext to RTCRayQueryContex
  • pass intersect args to rtcIntersect1 method:
    RTCIntersectArguments intersectArgs;
    rtcInitIntersectArguments(&intersectArgs);
    intersectArgs.context = &context;

    rtcIntersect1(embreeScene, &embreeRayHit, &intersectArgs);
0 Kudos
5 Replies
FlorianR_Intel
Employee
1,192 Views

Hi,

 

I've skimmed over your code and can't find any obvious issue with it. Can you test the embree_minimal tutorial application and check whether this reports a hit? Output should be 

 

./build/embree_minimal
0.330000, 0.330000, -1.000000: Found intersection on geometry 0, primitive 0 at tfar=1.000000
1.000000, 1.000000, -1.000000: Did not find any intersection.

 

Can you maybe modify the minimal tutorial (in embree_root/tutorial/minimal.cpp) and create a reproducer for this problem?

 

Can you please also run one of the other tutorials in verbose mode and cut/paste the ISA and BVH information here, i.e.

 

./build/embree_triangle_geometry --verbose 2

 

Cheers,

Florian

0 Kudos
BartekZgo
Beginner
1,189 Views

Tomorrow I will try to run the test directly from Embree build.

At this moment I simply copy the code of minimal.cpp into luxcore embreaccel.cpp, and the output is twice "Did not find any intersection"

0 Kudos
BartekZgo
Beginner
1,175 Views

Hi,

when I run embree_minimal from command line the output is correct.

 

0.330000, 0.330000, -1.000000: Found intersection on geometry 0, primitive 0 at tfar=1.000000
1.000000, 1.000000, -1.000000: Did not find any intersection.

 

The same code pasted into LuxCore code, returns "Dind not find any intersection" twice. I have to analyze the LuxCore code. Maybe somewhere else there is a call to embree library that has to be modified. Maybe there is some filter function attached. Unfortunately I'm not a LuxCore developer, and I'm not familiar with LuxCore code. 

 

Bartek

0 Kudos
BartekZgo
Beginner
1,170 Views

one more question. Do you have any idea why calling

rtcIntersect1(scene, &rayhit)

so without intersectArgs makes luxcore application crash?

So when I call rtcIntersect1(scene, &rayhit) application immediately crash, when I add intersectArgs it does not crash.

0 Kudos
BartekZgo
Beginner
1,026 Views

Hi. I have found the reason. Another library was linking embree3. So at runtime the old version of embree was loaded. Now it works.

0 Kudos
Reply