# Volume scatter without rendering the volume object

Below is an uncomposited version of my Earth render. You can see the light haze around the edges. That's the atmospheric scatter sphere that's a little bigger than the Earth itself. Once the light passes through it, it affects the surface of the Earth resulting in this nice orange color around the edges of the day/night transition. The problem, however, is the white haze around the edges of the planet itself are sharp and in order to affect the surface color, the atmosphere scatter sphere must be on the same layer, therefore, I'm unable to blur it slightly.

This is the atmospheric scatter layer on it's own. I've tried duplicating it, moving the dupe onto a new layer behind the Earth and then blurring that to help hide the sharp edges but it's still not ideal, especially when up close.

Here's the finished composite. You may say "It looks fine". True, but this is at a distance and my project requires a gradual descend close to the planet.

My question is, can I still have the atmosphere scatter mesh affect the surface whilst not being a part of the render itself? Can it affect the light off camera, so to speak?

Render Layers:

1) Atmosphere Mask (Uses the 2nd layer(Earth) to mask the atmosphere mesh which removes noise) 2) Earth (Includes a Surface mesh, Cloud mesh and Atmosphere Scatter mesh) 3) Atmosphere (A different atmosphere volume that creates a blue outer glow) <-- Irrelevant to problem

VOLUME SCATTER NODE SETUP:

SOLUTION:

This is the best I could do with risingfall's answer. In order to get the light to change the surface I can't fade it as much as I'd like so from a far you can't really see the fade as much but it's miles better than before, I believe.

• – user1853 Feb 14 '18 at 4:16

Sorry if I'm not picking up on your situation exactly, but is your atmosphere scatter mesh using a volumetric shaded material? Is it only shaded by volume, or is there also a surface component?

If it is helpful, and if your volume scatter mesh is volume only, I can tell you how to add a gradient to the volume density. That means you can make the edges of the volume scatter effect fade out, rather than be abrupt.

Here is a two-sphere setup where the volume scatter sphere does not have the gradient:

Here is the same with the gradient enabled:

Hope this helps!

• This certainly helps with the edge sharp issue, the problem now however is that, because the color ramp in plugged into the Density input, the Earth surface and clouds no longer have an orange hue as the density is no longer as high as necessary. – Stewie Feb 13 '18 at 3:30
• One way to handle that, perhaps: stick a "Multiply" node in between the color ramp and the density input. See if multiplying by, I dunno, 5, 10, 20, 100 give you the results you want. By the way, as you probably noticed @R.M's response is very similar to mine, he just used a mathier (and more precise) approach to specifying the density gradient. – risingfall Feb 13 '18 at 3:45
• Yep, trying it out now. Will update once I've got a good result. – Stewie Feb 13 '18 at 3:58
• Sweet, I managed to get a good look using your method. I added a multiply between the color ramp and the volume scatter to deal with density. I did have to size up the atmosphere mesh slightly to get the orange to appear but It seems to nicely blend in now. – Stewie Feb 13 '18 at 18:35

If I understand correctly, you're mostly worried about the sharp edges. You could probably get rid of them by separating the layers and blurring, but that is just a workaround that would give you photographically unrealistic results. I suggest doing it all in one layer, but changing the atmosphere's texture slightly.

In reality, the atmosphere looks smooth because the air gradually decreasses in pressure as you go further away from the ground. There is actually less and less air higher up.

You can simulate this by decreasing the density of the volume shader as you go farther from the center:

(I'm not friends with the gradient texture, so I prefer to manually calculate the distance :)

My result is not as nice as yours, but it demonstrates how you can get that smooth atmosphere:

I had to play around a bit to get the falloff somewhat right. Good luck!

• This is the first thing I tried but unfortunately doing that removes the affect the volume has on the Earth surface. Because the volume is on the same layer, it allows the light to change the colour of the Earth and clouds as well, instead of just the volume itself so blurring in composite isn't an option. – Stewie Feb 13 '18 at 3:14
• @Stewie sorry, you probably misread my answer. I am not suggesting to blur anything in composite. I am saying you should create a falloff for the density of the material. My solution preserves the orange colour of the Earth (though maybe it diminishes it a little bit). – Reinis Mazeiks Feb 13 '18 at 3:24
• Ahh, that's my mistake. I'll give it a go and see how it goes, thanks for the suggestion! – Stewie Feb 13 '18 at 3:33
• Okay, I've tried adjusting the curves value and the closer they are to the right side the closer they get to each other, allowing for the orange hue to pop through the surface without the atmosphere looking too large. Now doing a render to see how it looks. Will update with results. – Stewie Feb 13 '18 at 3:52

I've dealt with this problem in a still image and I solved it in the compositor. Give an object ID to each of the spheres. Then, in compositing, subtract one from the other so that you are left with their difference( outline). Use a blur node to blur that part.