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

Function updateEdgeLevel

tutorials/viewer/viewer_device.cpp:32–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30}
31
32inline float updateEdgeLevel( ISPCSubdivMesh* mesh, const Vec3fa& cam_pos, const unsigned int e0, const unsigned int e1)
33{
34 const Vec3fa v0 = Vec3fa(mesh->positions[0][mesh->position_indices[e0]]);
35 const Vec3fa v1 = Vec3fa(mesh->positions[0][mesh->position_indices[e1]]);
36 const Vec3fa edge = v1-v0;
37 const Vec3fa P = 0.5f*(v1+v0);
38 const Vec3fa dist = cam_pos - P;
39 return max(min(LEVEL_FACTOR*(0.5f*length(edge)/length(dist)),MAX_EDGE_LEVEL),MIN_EDGE_LEVEL);
40}
41
42
43void updateEdgeLevelBuffer( ISPCSubdivMesh* mesh, const Vec3fa& cam_pos, unsigned int startID, unsigned int endID )

Callers 1

updateEdgeLevelBufferFunction · 0.70

Calls 4

Vec3faClass · 0.50
maxFunction · 0.50
minFunction · 0.50
lengthFunction · 0.50

Tested by

no test coverage detected