UV mapping with TOP_TO_CHOP not working as expected

See attached images. In the first image, the TOP viewer shows that (0,0.333) (lower left pixel of red square) maps to a red pixel, and indeed, when I sample it using TOP_TO_CHOP, I get a the red color out as expected.

But in the second image, the TOP viewer shows that (0, 0.667) (lower left pixel of white square) maps to a white pixel, and when I sample it using TOP_TO_CHOP, it maps to the green color of the pixel below it.

Shouldn’t (0, 0.667) map to white? Am I understanding something wrong or is this a bug?

Hello,
It seems its an interpolation problem : UV is a fraction of the image length and 10 is not divisible by 3…
If you want a more precise calculus, use “Pixels” instead of “0 to 1” as UV Units
Jacques

If it’s using nearest pixel interpolation, shouldn’t this still give the right answer, despite the fractional units involved?

Is this a bug in TD?

Hey @dougbrowne,

This behavior has changed in the recent experimental build that is available for download.
previously the first pixel in the bottom/left corner had the u/v coordinate 0,0 yet this describes the edge between 2 pixels. The values displayed in the TOP viewer up to the current official always gave you the uv for the edges:

So you always had to add 1/2 a pixel to this value to get to the center of it and fetch the color correctly.
In your example with a resolution of 36x36 pixels, you would always want to add (1/72) to these values.

The experimental builds have now changed this. The displayed UVs for the pixels already return the center of the pixels instead of the edge.

image

cheers
Markus