-
-
Notifications
You must be signed in to change notification settings - Fork 18
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
Support for texel size as input parameter #1
Comments
Hi @reduz Currently the packing is pack to a square area, which means the same size with with and height, and the final texture coords is normalized to 0.0 ~ 1.0; So I guess you can multiply to what size you want. Unless you want specify the ratio of texture width and height. Maybe need a new api such as setPackRatio(float ratio). |
The problem with this is the padding between the elements. If you know the right texel size, you can do proper padding in the packer (since the actual sizes are known). Otherwise I may scale the texture but padding will be wrong. |
Ok, after I read the code in xatlas, I got what you mean. I will add this parameter for specify the texel size in the following days. |
The texel size api is ready: simpleuv/simpleuv/uvunwrapper.h Line 16 in 8375bb4
I also removed the Qt dependence. |
@huxingyi btw I see you allow setting texel size, but how do you actually obtain the texture size back? |
simpleuv/simpleuv/uvunwrapper.h Line 21 in 8375bb4
This can be used to fetch the actual square size, width and height are the same. |
oh i see, looks great |
Hello, may you help to use this library please, some example please. I want to contact with you. |
Hi @FSSRepo Please see the example here: https://github.com/huxingyi/dust3d/blob/610bc978a8021ee34be33ca45ff90fb14ef444de/src/uvunwrap.cpp#L58 |
Thank you, :), I hope it works |
For game engines, you often need to specify what a texel size will be in world coordinates (as in, meters or centimeters), then the unwrapper not only unwraps but decides what the texture size should be in order to make sure texels are the specified size.
The text was updated successfully, but these errors were encountered: