Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

I pushed a new build of PixMap with some fixes addressed!

It should now be in better parity with B.Map with these fixes too. Lemme know how it goes!

(1 edit)

Thank you, seems to be more stable, but the tiling is pinned to corner which messes up scaling of STMaps, compared to B.Map where it is pinned to center and works OK. Also it flips the texture vertically.

(+1)

I think the vertical flip you are experiencing is due to the (0,0) pivot of your UV map being at the bottom left corner rather than the top-left. The darkness of the pixels at the bottom-left here indicate this is where your origin is and is why your image is flipped vertically due to it using OpenGL conventions(Y is Up rather than Y is Down):

OpenGL is the only graphics API that defines its texture-space like this. While DirectX/Vulkan/Metal/After-Effects/etc define the top-left corner of their texture-space as the 0,0-origin.

My unit tests have PixMap and B.Map behaving the same, except for how their scale operation works(B.Map scales about the center (0.5,0.5) while PixMap scales about the origin (0.0, 0.0). In my next update I'll can tweak the texture scaling-operation so that they both scale about the center!

(+1)

The changes have been made! See:

https://wunkolo.itch.io/pixmap/devlog/844001/bmap-compatibility

Fantastic! Works very great. Thank you ☺

(1 edit)

Great work, anyway there's one last thing wrong with PixMap compared to B.Map, it's the coordinate mapping. The B.Map correctly maps UV coordinates to pixel position, while PixMap does not take account for the half-pixel offset in the UV space, as the center of first pixel is 0.5/Dimensions.

The correct formula for mapping pixel index coordinates XY starting from [0, 0] to UV is [U, V] = [(X+0.5)/Width, (Y+0.5)/Height]
And for mapping of UV to XY is [X, Y] = [U*Width-0.5, V*Height-0.5]. Width and Height are the dimensions of sampled texture as 1920x1080.

Basically the UV coordinates start from edge to edge, that's why first pixel center has a value of 0.5/dimensions and pixel coordinates start from the center of first pixel.

(2 edits) (+1)

Yep! I get ya. I haven't gotten to it just yet due to some other priorities right now for this time of the year but I'll get to it! In this case, After Effect's built in sampler function considers the origin of the pixel at the top-left of the Texel. And it just needs a (0.5, 0.5) texel-offset (0.5/width,  0.5/height).

https://ae-plugins.docsforadobe.dev/effect-details/tips-tricks.html?where-s-the-center-of-a-pixel#where-s-the-center-of-a-pixel

https://ae-plugins.docsforadobe.dev/effect-details/graphics-utility-suites.html#...

Deleted 32 days ago