| 30 | } |
| 31 | |
| 32 | inline 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 | |
| 43 | void updateEdgeLevelBuffer( ISPCSubdivMesh* mesh, const Vec3fa& cam_pos, unsigned int startID, unsigned int endID ) |
no test coverage detected