3D texturing: Fix seam bleeding #97352
Version 1 (abandoned)
The concept of this approach is create a list of source pixels that should be copied to other areas of the texture. By doing this the seams will be fixed. During copying the pixels can be blended with near pixels to improve quality.
- Scan over all uv edges that make the bounds of an UV island.
- Scan over pixels that are 'intersect' with the found uv edges.
- Pixels that are already part of the PBVH Pixels should be ignored.
- Pixels that are not part of a PBVH Pixels should be 'fixed'
- Find a corresponding pixels that could be used as a source to fix the pixel.
- Add the source pixel to be copied to the pixel to be fixed. This should be added to the PBVHNode of the sourcing pixel. If the pixel was changed it should be copied to the target.
During test we decided that this solution doesn't get to the quality we want.
Version 2 (new approach)
- for now the unconnected uv edges will be the same as version 1, we can in the future change this by extending the edges. I left this out of scope for now.
- split the mesh into uv island.
- extract the pixels of the 'original' mesh.
- per UDIM tile create uv island map (2d array with ints)
- dilate the uv islands until they reach each other undecisive pixels should not be solved.
- This map is used as a mask where uv island can extended.
- per uv island find the sharpest corner.
- go over the 3d mesh fan of the corner and see how this fan can be extended. For now I see 3 scenarios
- the corner is a cut (both edges are connected in 3d space). for example see uvmap of cube. In this case we should duplicate the original faces and
- the corner connects to another edge on the same uv island. might be similar to the first case,
- the corner connects to one or multiple uv island. In this case the geometry that isn't connected in uv space, but is in 3d space should be added in between.
- this generates new primitices that could be extracted using the pixel extractor.
- the newly primitives should be stored in the PBVH as the uv coords must be stored somewhere.
- the new primitives should still be mappable to the original primitives.
Changed status from 'Needs Triage' to: 'Confirmed'
This issue was referenced by
It was mentioned that priority should not be added for regular development.
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?