Material to make hollow cube?

Hi all,

I’m currently trying to make a grid like material for a cube that masks the top and bottom faces (i.e. only the four walls of the cube are grid like, all other sides are hollow). See the figure below, where the blue check marks are good, and the red x needs to be masked.

269275-capture.png

I’m using a custom material which cuts the gameobject into a grid by using its world and object position, and then inverts the material to create a grid-like opacity mask. See figure below:

Anyways, I’m a little stuck on this and does anyone have any recommendations? (Would also love to find a way to remove the glitching that occurs when the grid size is overlapping, see preview window top side of cube by material of blueprint).

Thank you for your time!

if you aren’t rotating the cube the vertex normal vector for the top face is 0,0,1 the other the side faces are something,something,0. I think the bottom face is 0,0,-1
so I think if you took the vertexnormalws then use a component mask so you only get the blue channel, then use and abs node, you should get a mask for the top and bottom of the cube.

It worked, thank you so much @IndieGameCove!!!