MCPcopy Create free account
hub / github.com/RenderKit/embree / main

Function main

tutorials/bvh_access/bvh_access.cpp:208–241  ·  view source on GitHub ↗

main function in embree namespace */

Source from the content-addressed store, hash-verified

206
207 /* main function in embree namespace */
208 int main(int argc, char** argv)
209 {
210 /* for best performance set FTZ and DAZ flags in MXCSR control and status register */
211 _MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON);
212 _MM_SET_DENORMALS_ZERO_MODE(_MM_DENORMALS_ZERO_ON);
213
214 /* create new Embree device and force bvh4.triangle4v hierarchy for triangles */
215 RTCDevice device = rtcNewDevice("tri_accel=bvh4.triangle4v");
216 error_handler(nullptr,rtcGetDeviceError(device));
217
218 /* set error handler */
219 rtcSetDeviceErrorFunction(device,error_handler,nullptr);
220
221 /* create scene */
222 RTCScene scene = rtcNewScene(device);
223 addCube(device,scene,Vec3fa(-1,0,0));
224 addCube(device,scene,Vec3fa(1,0,0));
225 addCube(device,scene,Vec3fa(0,0,-1));
226 addCube(device,scene,Vec3fa(0,0,1));
227 addHair(device,scene);
228 addGroundPlane(device,scene);
229 rtcCommitScene (scene);
230 /* print triangle BVH */
231 print_bvh(scene);
232
233 /* cleanup */
234 rtcReleaseScene (scene);
235 rtcReleaseDevice(device);
236
237 /* wait for user input under Windows when opened in separate window */
238 waitForKeyPressedUnderWindows();
239
240 return 0;
241 }
242}
243
244int main(int argc, char** argv)

Callers

nothing calls this directly

Calls 15

rtcNewDeviceFunction · 0.85
rtcGetDeviceErrorFunction · 0.85
rtcNewSceneFunction · 0.85
addHairFunction · 0.85
rtcCommitSceneFunction · 0.85
print_bvhFunction · 0.85
rtcReleaseSceneFunction · 0.85
rtcReleaseDeviceFunction · 0.85
error_handlerFunction · 0.70
addCubeFunction · 0.70
addGroundPlaneFunction · 0.70

Tested by

no test coverage detected