Git Product home page Git Product logo

Comments (14)

fire avatar fire commented on August 25, 2024

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.

from xatlas.

jpcy avatar jpcy commented on August 25, 2024

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.

from xatlas.

fire avatar fire commented on August 25, 2024

My goal is to take multiple meshes make them use 1 texture and uv space. Then, merge the meshes.

Is this not suitable?

from xatlas.

jpcy avatar jpcy commented on August 25, 2024

The repack example here does that, but it doesn't handle bilinear filtering yet.

from xatlas.

fire avatar fire commented on August 25, 2024

Why would it need to handle bilinear filtering?

from xatlas.

fire avatar fire commented on August 25, 2024

I have access to:

INTERPOLATE_NEAREST
INTERPOLATE_BILINEAR
INTERPOLATE_CUBIC
INTERPOLATE_TRILINEAR
INTERPOLATE_LANCZOS

from xatlas.

jpcy avatar jpcy commented on August 25, 2024

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.

from xatlas.

fire avatar fire commented on August 25, 2024

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...

from xatlas.

fire avatar fire commented on August 25, 2024

Going back to the theory. Sorry for my misunderstandings.

from xatlas.

fire avatar fire commented on August 25, 2024

Why can't we pad the charts with suitable pixels? https://github.com/jpcy/xatlas/blob/master/xatlas.h#L204

from xatlas.

fire avatar fire commented on August 25, 2024

I have access to a function that takes a square size of image data and resizes it.

template <int CC, class T>
static void _scale_lanczos(const uint8_t *__restrict p_src, uint8_t *__restrict p_dst, uint32_t p_src_width, uint32_t p_src_height, uint32_t p_dst_width, uint32_t p_dst_height)

You create a bounding rectangle here https://github.com/jpcy/xatlas/blob/master/extra/example_repack.cpp#L359.

Not sure where to go.

from xatlas.

 avatar commented on August 25, 2024

@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.

from xatlas.

jpcy avatar jpcy commented on August 25, 2024

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.

from xatlas.

fire avatar fire commented on August 25, 2024

Trying the revised code today.

from xatlas.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.