Sphere Outline Using Sphere Mask

I’m currently using TwoSidedSign and VertexNormalWS to accomplish an outline effect on a sphere, shown below.

sphere

I’m using a slightly smaller regular sphere inside of the two-sided masked sphere. Is there a better way to do this? Since the outline is emissive, the light bleeds on to the inner sphere, which I don’t want. When using DLSS, a lot of artifacts also appear when the spheres are changing colors. Here’s the base sphere material graph:

And this is the outline sphere material graph:

Thanks,
Mark

Edit: just applying more search tags:
Sphere mask, absolute world location, object position, object radius, always face camera material

This sort of works, but it only works if I’m the right distance away from the sphere. Is there a way to make it always look like this?

EDIT Found a solution:

This ended up working. Just subtracting a scalar value from the distance wouldn’t work for some reason, but subtracting a portion of the object radius did work. It appears like the picture above when viewed from all distances and angles!

1 Like