Skip to content
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

VOXCONVERT: when converting .qb to .obj, the uv coordinates are misaligned #403

Open
hkunz opened this issue Mar 4, 2024 · 2 comments
Open
Labels
bug format Voxel or mesh format related

Comments

@hkunz
Copy link

hkunz commented Mar 4, 2024

When converting the attached .qb file to .obj (and possibly other formats), the color scheme is incorrect due to misplaced sampling points on the UVMap. The sampled points are placed between 2 colors causing the resulting value to mix. Tested by importing the resulting .obj in Blender:

image

The correct placement should probably be the following in order to set the sampling point to be at the center of each color:

u = index * 1/256 + 1/256/2
v = 0.5

or

u = (index + 0.5) / 256
v = 0.5

Here's a sample .qb file https://drive.google.com/file/d/1WoSwlgCiSybYkdqxdm_Ir5nFOVFtTYyk/view?usp=sharing

test.zip

mgerhardy added a commit that referenced this issue Mar 4, 2024
@mgerhardy
Copy link
Collaborator

The issue should be fixed now. Feedback welcome.

@mgerhardy mgerhardy added bug format Voxel or mesh format related labels Mar 4, 2024
@hkunz
Copy link
Author

hkunz commented Mar 4, 2024

Hi martin i checked and it's almost fixed not perfect yet. Because it's not perfectly centered, it will produce a slight mixed shade of the adjacent color. Please see gif below this pic for demo.

image

Notice the shade of blue moving closer to the perfect shade of the blue pixel once it reaches the center
c

@mgerhardy mgerhardy reopened this Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug format Voxel or mesh format related
Projects
None yet
Development

No branches or pull requests

2 participants