I want to have a gradient towards the volume of a torus shape, but it won't work

I basically want this donut shape to have a spherical gradient inside to use for volumetrics, I’ll provide a link to the solution I thought would work but didn’t (applied a curve modifier to a cylinder as a shape key to keep the “generated” texture coordinate vector the same as it would be if it wasn’t deformed)

Would really appreciate the help!

As far as I know, Blender simply has no way of doing what you are trying to do. If there is a way to fade a volume’s edges, I would like to know it.

Maybe it’s possible to get something close to that by rendering the volume object separately from the rest of the scene and fading its edges in the compositor.

Or, if you don’t mind rendering with Eevee, it could be possible to fake the effect by stacking a bunch of alpha hashed transparent surfaces with the gradient baked on them.

With etn249 suggesting that this may be impossible, I am wondering if I may have misunderstood what you want to achieve.
If you just want a ring of volume/fog, it’s quite possible…

red cube added for clarity of the example.
If this is what you want, it’s just a cylinder with a volume shader. Here’s the shader…

If not, sorry :wink:

It’s totally possible to have a ring. If that’s what they need, your way is the solution.

I meant more like you cant deform an object and expect a volumetric texture to follow.

Also, this would not help to fade the edges of a volume with a more complex shape, which is something I would like to see a way of doing.