| 68 | } |
| 69 | |
| 70 | Color sampleVertexColor( const Mesh& mesh, VertId v, const MeshTexture& tex, const TriCornerUVCoords& triCornerUvCoords ) |
| 71 | { |
| 72 | Vector4f sumWC; |
| 73 | float sumW = 0; |
| 74 | for ( EdgeId e : orgRing( mesh.topology, v ) ) |
| 75 | { |
| 76 | auto l = mesh.topology.left( e ); |
| 77 | if ( !l ) |
| 78 | continue; |
| 79 | //auto lvs = mesh.topology.getTriVerts( l ); |
| 80 | const auto d0 = edgeVector( mesh.topology, mesh.points, e ); |
| 81 | const auto d1 = edgeVector( mesh.topology, mesh.points, mesh.topology.next( e ) ); |
| 82 | const auto angle = MR::angle( d0, d1 ); |
| 83 | sumWC += angle * Vector4f( tex.sample( tex.filter, getUV( v, mesh.topology.getTriVerts( l ), triCornerUvCoords[l] ) ) ); |
| 84 | sumW += angle; |
| 85 | } |
| 86 | if ( sumW > 0 ) |
| 87 | return Color( sumWC/ sumW ); |
| 88 | return {}; |
| 89 | } |
| 90 | |
| 91 | VertColors sampleVertexColors( const Mesh& mesh, const MeshTexture& tex, const TriCornerUVCoords& triCornerUvCoords ) |
| 92 | { |
no test coverage detected