UI Canvas Scaler Constant Physical Size with Tiled Image

(Using Unity 2019.1.12)

I am trying to set up a background grid in my UI by tiling a sprite. I would like this grid to have a constant physical size, the target is 1cm per grid cell regardless of resolution. So, I set my Canvas Scaler to constant physical size, and set the units to millimeters. This means that a grid cell should be 10 units wide / tall. To make things easy for testing, I’ve set reference pixels per unit to 1 (should mean 1 pixel per millimeter).

alt text

I set my game window to have a resolution of 600x1024 to emulate a smaller res mobile device. at 600 pixels wide assuming a DPI of 96, that would mean 600 / 96 dpi * 25.4 (mm per in) = 158.75 units wide. And, looking at my panel size when I stretch it to fill the width, it makes perfect sense:

alt text

My sprite I am using for the background grid is a 200x200 tileable image with a cell centered in the middle. This means a cell is 100x100 pixels wide in my source image. In the import settings, I set Wrap to “Repeat” for tiling, and pixels per unit to 1, making me expect 1 pixel in the image should correspond to 1 millimeter on screen (making my cell size 10cm for now):
alt text

I then create an Image that fills this area and set the Image type to “Tiled”. However, instead of the 1 pixel / mm I was expecting (which would produce 10 cm cells, not much more than 1 cell on screen), it seems to be ignoring scaling entirely, and instead I get 6 cells on screen, consistent with a pixel-to-pixel correspondence between my sprite and the actual screen pixels:

alt text

Do tiled images ignore scaling? If so, what is the recommended approach given what I want to accomplish? Been very confused / banging my head at the wall for a while now, hopefully someone here can coach me on the right way to do this! Thanks in advance!!

Have you gotten around this? I’m struggling with the same problem. I have a tiled imaged but I have no idea how to calculate its size to make it repeat as many times as I need, the numbers dont make sense (sprite size in pixels vs pixels per unit vs image size).