Creating thin volumetric layer around mesh with GN and shader

I want to create a thin volumetric layer around the mesh of an object. The object may have some inner faces.

My previous approach was to add a solidify modifier, but due to the geometry and the solidify modifier, I was experiencing many artifacts. Instead of that method, I’m considering dividing the process into two steps:

  1. Using Geometry Nodes to calculate the proximity to the faces of the object. Then, I capture the distance to the faces. Here basically I want to calculate “self proximity”.

  2. In the shader, I create a setup that adds a principled volume in all places where the distance is less than a threshold. Essentially, I’m not concerned about topology here and only care if a point is close enough to a face of the mesh. I am using the output of geometry node “store named attribute”.

My thought is that after doing this, I will have a thin volumetric layer all around the mesh. I’m only interested in the volumetric effect, not the surface. With the “Threshold” parameter in the “Less Than” node, I can control the width of the volumetric atmosphere.

I’ve been unable to make this work following some other solutions I’ve seen online, and I’m wondering what the error in my setup might be.

I’ve attached an image with the output and the shader and geometry nodes setups.

Do you know what’s wrong? How can I create this effect using Geometry Nodes and shaders in Blender 4.2 with Cycles?

You could try coverting the object into a volume with geo nodes and scale it up and just use a volumetric shader. To get a area around maybe just duplicate the object and boolean it away. Could all be done in geonodes

Thanks for the answer, but mesh to volume in geo nodes does not work good with planes and “flat” geometries.

Basically I want to do something like this tutorial but instead of the distance to the origin, I want to use the distance to another mesh