Using AppGameKit Studio tier 1, subimages have successfully been imported from an image atlas.
However, the 2 outer columns (one column on each edge) of the pixels in the subimages (not the atlas image) are distorted compared to the other column widths in the subimage, thinner than all the other columns. The same thing (distortion; squashed pixels) occurs with the horizontal runs (rows) where the topmost and bottom rows are vertically squashed or heavily distorted in the subimage relative to the other rows.
Original bitmap with uniform pixels:
Subimage bitmap with distorted / squashed pixel rows and columns near edges:
The subimages are not blurry, but the proportion of the columns of pixels are distorted. Most of the columns are uniform width, but in particular the outer columns are squashed thinner, and for some images even to a hairline width.
Incidentally, the bitmap source file (atlas texture) is 320 x 200, which is a power of 2, if that affects anything.
I have tried the following remedies:
* Double-checked the coordinates and dimensions in the "... subimages.txt" file, and they are confirmed accurate.
* Tried using SetImageMagFilter() on the subimages, but this generates a run-time error (SetImageMagFilter() cannot be applied to subimages). However, both SetImageMagFilter(0) and SetImageMinFilter(0) are successfully applied to the atlas image loaded, resulting in the elimination of blurred pixels. The pixels appear sharp and crisp, as they should with these settings applied. But this does not seem to have any effect in fixing the squashed/distorted pixels.
* The virtual resolution was changed from its prior 1600 x 900 to instead 320 x 200 to match the source atlas file's resolution, but this had no effect on the subimages (pixel columns and rows continue to appear squashed).
* Tried adjusting the sprite's resolution (using SetSpriteSize(...)) to the exact same resolution as its image (subimage), but the distortion remains.
* Tried adjusting the sprite's resolution (using SetSpriteSize(...)) using parameters -1 and -1 for the dimensions (which should derive its dimensions from the image, and retain the original aspect ratio) but the distortion remains.
* A potential remedy could be to extract the images using some MemBlock functions, but even if successful this would defeat the purpose of establishing subimages (where the GPU loads the atlas as a single texture, and from that single texture creates subimages/subtextures without the need to redundantly or inefficiently create many individual independent textures).
* Tried using functions SetSpriteUVScale() and SetSpriteUVBorder() without effect; I'm not really sure what these functions do but I thought it might work or have some effect.
I have reviewed the following AppGameKit forum threads that seem to be (somewhat) related to this, but I haven't yet found a working remedy:
URL:
https://forum.thegamecreators.com/thread/211103
URL:
https://forum.thegamecreators.com/thread/216038
URL:
https://forum.thegamecreators.com/thread/228642
URL:
https://forum.thegamecreators.com/thread/220469
URL:
https://forum.thegamecreators.com/thread/225191
URL:
https://forum.thegamecreators.com/thread/192926 (explains the benefits of using an Atlas and subimages instead of individual textures)
URL:
https://forum.thegamecreators.com/thread/195871#msg2336207 (refers to UVBorder and half-width pixels)
Does anyone know of a remedy/solution that will result in uniform pixel widths in subimages? I am baffled at this odd behavior; I don't know what might be causing these strange distortions. It might be something simple or obvious that I am overlooking.
Thanks in advance for any help or advice!