Below is the code that I am using, my code gets stuck at rtcCommit(). I am not sure why this is happening...any clue would be great help.
geomID = rtcNewTriangleMesh(Scene, RTC_GEOMETRY_STATIC, nTriangles, embVertices.size(), 1);
EmbVertex* vertices = (EmbVertex*) rtcMapBuffer(Scene, geomID, RTC_VERTEX_BUFFER);
for(unsigned int i = 0; i < embVertices.size(); i++)
vertices.x = embVertices.x;
vertices.y = embVertices.y;
vertices.z = embVertices.z;
rtcUnmapBuffer(Scene, geomID, RTC_VERTEX_BUFFER);
cout<<"\nCompleted mapping vertices.\n";
EmbTriangle* triangles = (EmbTriangle*) rtcMapBuffer(Scene, geomID, RTC_INDEX_BUFFER);
int t = 0;
for(unsigned int i = 0; i < Triangles.size(); i++)
rtcUnmapBuffer(Scene, geomID, RTC_INDEX_BUFFER);
cout<<"\nCompleted mapping triangles.\n";
This is the message I get from Embree:
Embree Ray Tracing Kernels 2.3 (Jun 11 2014)
Compiler : Visual C++ Compiler 17.00.6103.0
Platform : Windows (32bit)
CPU : SSE SSE2 SSE3 SSSE3 SSE41 SSE42 POPCNT AVX F16C RDRAND AVX2 FMA3 LZ
CNT BMI1 BMI2
Features : intersection_filter bufferstride
WARNING: enabled 'intersection filter' support will reduce hybrid traversal pe
Embree: Unknown error, (cannot create thread)
I do not understand why it cannot create the threads
Sorry but I have no idea why the CreateThreads function fails. Look at the CreateThreads call in file embree/common/sys/thread.cpp, maybe you can find the problem there. Also, try to figure out what you do different than the tutorials.
You can call rtcInit and rtcExit in a constructor and destructor of a class. However, you should not call rtcInit from the constructor of a global variable, thus please create the class either with new or on the stack.
I am actually creating the class object with new but this is a global variable, the reason for that is I am using OpenGL to display the scene geometry and so the callback functions can access the class object. What is the reason for rtcInit() to not work on global variables?