Material grid

I want to use the matrerial gird but I also want to make sure, that each cell in the grid will cover an exact size of an area, no matter the size of the shape I create.
So there will always be more cells (more rows and columns) in a bigger shape, because there is more area to cover with a specific size of a cell.

Is there any way to accomplish that?


You’ll need to write a custom grid material so you can write a custom shader. I believe Ed Mackey and I’m sure some others in the forum could help direct you to examples of how to get started doing that.

When you say exact size, do you mean in screen space (pixels) or in world space (physical area)?

If you are talking about screen space, then you can see this example: You can copy and paste the code into Sandcastle As you zoom out, the grid will stay the same size. You can swap out that image for a transparent grid image.

If you are talking about “world space” then the grid material already does what you want, you just need to calculate the proper number of rows/columns based on the overall area of your geometry.

Thank you so mush Matthew for your quick response.

The example works great!

Even though I ment for “world space”, I might use the screen space instead.

Thanks again!