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

Function updateEdgeLevel

tutorials/interpolation/interpolation_device.cpp:120–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

118};
119
120inline float updateEdgeLevel(const Vec3fa& cam_pos, Vec3fa* vtx, unsigned int* indices, const unsigned int e0, const unsigned int e1)
121{
122 const Vec3fa v0 = vtx[indices[e0]];
123 const Vec3fa v1 = vtx[indices[e1]];
124 const Vec3fa edge = v1-v0;
125 const Vec3fa P = 0.5f*(v1+v0);
126 const Vec3fa dist = Vec3fa(cam_pos) - P;
127 const float level = max(min(LEVEL_FACTOR*(0.5f*length(edge)/length(dist)),MAX_EDGE_LEVEL),MIN_EDGE_LEVEL);
128 return level;
129}
130
131/* adds a subdiv cube to the scene */
132unsigned int addTriangleSubdivCube (RTCScene scene_i, const Vec3fa& pos)

Callers 2

setQuadSubdivCubeLevelsFunction · 0.70

Calls 4

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

Tested by

no test coverage detected