Using Depth-Fade/Fresnel on cubes?

Hey all I am attempting to make a simple slime material for an enemy.

Just a material that has a different color for the sides/edges and then gradually fades to a darker and more opaque color in the center. I figured I could use a simple depth fade and fresnel to do just that. But it seems these nodes don’t really work on cubes?

If anyone has any experience, tips, or could point me in the right direction of how I could achieve this; it would be much appreciated.

Maybe the cube doesn’t have enough geometry and the edges are too sharp? In order for shading to work properly you need more geometry on the sharp edges of your mesh I think.

I have got this problem too…