rtcCommit not working

rtcCommit not working

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.

Thanks

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[i].x = embVertices[i].x;
        vertices[i].y = embVertices[i].y;
        vertices[i].z = embVertices[i].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++)
    {
        if(valid[i])
        {
            triangles[t].v0 = Triangles[i].v0;
            triangles[t].v1 = Triangles[i].v1;
            triangles[t].v2 = Triangles[i].v2;
            embTriangles.push_back(Triangles[i]);
            t++;
        }
    }
    rtcUnmapBuffer(Scene, geomID, RTC_INDEX_BUFFER);
    cout<<"\nCompleted mapping triangles.\n";
    rtcCommit(Scene);

9 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

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
rformance
Embree: Unknown error, (cannot create thread)

I do not understand why it cannot create the threads

Do the tutorials run? e.g. ./tutorial00 -rtcore verbose=2

 

yes tutorials are running fine.

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. 

What is a good place to do rtcInit()?

Is it possible to do this inside a constructor of a class and then call rtcExit() inside the destructor?

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?

Because that way the rcInit could be called before initialization of global variables inside embree library

Login to leave a comment.