| 1663 | /***************************************************************************************/ |
| 1664 | |
| 1665 | inline float updateEdgeLevel( ISPCSubdivMesh* mesh, const Vec3fa& cam_pos, const unsigned int e0, const unsigned int e1) |
| 1666 | { |
| 1667 | const Vec3fa v0 = mesh->positions[0][mesh->position_indices[e0]]; |
| 1668 | const Vec3fa v1 = mesh->positions[0][mesh->position_indices[e1]]; |
| 1669 | const Vec3fa edge = v1-v0; |
| 1670 | const Vec3fa P = 0.5f*(v1+v0); |
| 1671 | const Vec3fa dist = Vec3fa(cam_pos) - P; |
| 1672 | return max(min(LEVEL_FACTOR*(0.5f*length(edge)/length(dist)),MAX_EDGE_LEVEL),MIN_EDGE_LEVEL); |
| 1673 | } |
| 1674 | |
| 1675 | void updateEdgeLevelBuffer( ISPCSubdivMesh* mesh, const Vec3fa& cam_pos, unsigned int startID, unsigned int endID ) |
| 1676 | { |
no test coverage detected