Using Proximity from Curve to control Volume Shader in Cube

I’m experimenting with the Geometry Proximity node in Geo Nodes, using Blender version 3.2.1. The effect I want to achieve is a volumetric shader within a cube domain that is controlled by the distance from a Curve.

I can achieve the effect I’m looking for on the surface of the cube (see figure below). You can see the Bezier curve poking out of the left face and the front face of the cube. Small distances to the curve are colored blue on the faces of the cube with larger distances colored green and red. This test case of a surface shader appears to work fine.

However, when I plug the Emission Shader into the Volume socket on the Material Output node the volume is colored a uniform blue inside the cube.

Any ideas why this setup works for a surface shader but not a volume shader? Maybe this use case isn’t supported yet by Geometry Proximity? Or perhaps a setting or setup I’m not using correctly?

Blend file attached below. Any help is greatly appreciated!

P.S. This is a cross-post from Blender StackExchange (same title), in case I can improve the chances someone who can help with this will see the posting.

GN-Proximity-Distance-for-Shading01.blend (851.1 KB)

The Emission Shader is a Surface Shader- it doesn’t work with Volume. Use a Principled Volume and plug the Emission color (with a Shader to RGB) into the Emissive Color

It looks like you are generating a mesh cube, then calculating the distance to that mesh cube and outputting that distance. The attribute only has data for the surfaces of that cube, not the volume.

I haven’t played with volumes much in GN, so I’m not sure if you can output volumetric attributes yet.

Emission does work with volumes, but it is a little more cumbersome.


@SterlingRoth Thanks for the reply. Do you know who I could contact among the devs to find out if distance is calculated within a volume?

@joseph The “Principled” version of the volume shader is a conveniently packaged mix of the other relevant shaders: Emission, Volumetric Absorption, Volumetric Scattering. You can use the shaders individually instead of the Principled Volume.

1 Like

I’m not sure who is in charge of volumes in GN.

Volume support is present, but not fully developed yet. you can use a curve to points, then points to volume node and this will give you a density grid, but I’m not sure how to transfer that to another mesh.