-
Notifications
You must be signed in to change notification settings - Fork 221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle alpha in textures? #19
Comments
Seems like I can modify https://github.com/jpcy/xatlas/blob/master/extra/example_uvmesh.cpp#L83 to handle the 4 8-bit colors and 4 float colors. |
Apart from the repack example (which is incomplete), the other example output images are just for visualization. The rasterization used to generate them isn't precise, so I don't recommend using them for anything. |
My goal is to take multiple meshes make them use 1 texture and uv space. Then, merge the meshes. Is this not suitable? |
The repack example here does that, but it doesn't handle bilinear filtering yet. |
Why would it need to handle bilinear filtering? |
I have access to: INTERPOLATE_NEAREST |
Because bilinear filtering samples neighboring texels. The repack example copies texture data by conservatively rasterizing charts in the new UV space. A source texel on the edge of a texture may end up in the middle of the atlas and bilinear filtering would lerp with neighboring black texels. |
If we made the original texture twice as big using a filter like LANCZOS and would it have the same effect? Or the other way around shrinking by half... |
Going back to the theory. Sorry for my misunderstandings. |
Why can't we pad the charts with suitable pixels? https://github.com/jpcy/xatlas/blob/master/xatlas.h#L204 |
I have access to a function that takes a square size of image data and resizes it.
You create a bounding rectangle here https://github.com/jpcy/xatlas/blob/master/extra/example_repack.cpp#L359. Not sure where to go. |
@fire you can check AliceVision on github to see how it handles bilinear filtering. It uses geogram which uses xatlas. Here, this is how you do it. I'm going to implement it for example_repack in a week or so. |
There shouldn't be any artifacts with bilinear filtering now. Comparing input to output, they don't quite match and there's some distortion in the texture data. I think something is off by half a texel. |
Trying the revised code today. |
When combining texture charts values, does xatlas handle alphas in the 4th channel?
The text was updated successfully, but these errors were encountered: