Altering the Prototype Grid Material Instance

I am trying to alter the new prototype grid material that comes with UE5. It’s a great material but if you create shapes that do not equate to an even number when dividing by 20 (e.g. a box that’s 300x300 or 100x100) the lines get drawn from the middle instead of from the side. Attached is a screenshot for reference. Ideally I would like the grid to be aligned to the bottom left of the shape (so if the shape is 100x100 you do not see anything dark lines. If the shape is 300x300 you would see 3 large boxes across, instead of 2 and 2 halves on each side).

Still somewhat new to Unreal so forgive my ignorance! I’m wondering if there is a straightforward way to achieve this by editing the blueprint or if I’m better off just trying to make my own material to achieve what I’m after. Thank you!

For anyone finding this in the future I found a solution and figured I’d share.

There’s probably a better way to do this (I’m just a beginner) but this is what I came up with.

Inside the material function the generates the grid (MF_ProcGrid) is where you need to add an offset that is based on the size of the given plane. The values will need tweaked for the offset calculation if you have the grid setup different from 100x5 (20cm grid spaces).

Equation to calculate offset:

Hope this helps!

If anyone has a better way of doing this I’d love to learn (there’s a brief flicker that occurs if you change the size of the shape in runtime that I assume could be fixed by doing this a different way).