Fade edges of a cube material - Dot product doesn't work

Just wondering if it’s possible to mathematically fade out the edges of a cube - not at an intersection point (I’m aware of depth fade) but permanently. Dot product or Fresnel works for a sphere but not on a cube. Is this possible to do with math in a material or would I need to set it up with a unique unwrap and alpha texture?

Dot and Fresnel work on the angle between viewing vector and pixel’s normal. Which in case of a flat surface is identical. You’re looking for a difference in position. For plane it could be distance from center in X, and in Y, remapped to 0-1 range and multiplied one by another (to combine those masks). For a cube… well, that’s probably a matter of screen-space detection of distance to closest space outside of the cube. I have no idea how to approach the last one :slight_smile:

Hmm… well, thanks for the explanation anyway :slight_smile: