Modifying shaders for debugging purposes is always worth it. Yes the math makes sense but then why isn’t it working? Visual debugging to the rescue.

Here’s my LOD (Level of Detail) system off center by a forth.

My LOD scheme is to draw each level of detail as a 4x4 grid so there are 16 grid cells per level. Since each level is a multiple of two, the next smaller level of detail will fit in 4 grid cells. These 4 cells will always be adjacent and are allowed to move around the parent 16.