0

Rendering objects with volume data in RGBA color space causes it to go invisible if there is nothing behind it. The object shows up in the final render window, but only disappears once saved as RGBA.

Final render Render window

Hunter
  • 3
  • 2
  • Blender stores png's transparency in the alpha channel, but the PNG in your post have a full white channel. It could be due to the website's uplodad system, but normally there should be no issue having a volumetric shader's transparency stored correctly. Have you generated this png in any other way than straight from Blender ? Do you use Blender v3.3 ? – L0Lock Oct 03 '22 at 01:23
  • The white background is due to the website's upload system, and no, I generated it straight from blender. I am currently using Blender v3.2. Would updating fix the issue? – Hunter Oct 03 '22 at 02:48
  • AFAIK there wasn't such a bugfix on v3.3's release and I can render volume shaders with alpha on 3.2 correctly. Can you try doing a render from your scene (low samples to not waste time) and show us how the alpha channel looks from Blender ? https://i.imgur.com/lwkXJVu.jpeg – L0Lock Oct 03 '22 at 03:12
  • or alternatively, upload your file on blend-exchange.com with textures packed into the file so that we can check ourselves what's going on. – L0Lock Oct 03 '22 at 03:13
  • Here's the alpha channel for the render. i.imgur.com/L4xqkFN.png – Hunter Oct 03 '22 at 03:56
  • I also uploaded the .blend file to the website. blend-exchange.com/b/nYYeKxs4 – Hunter Oct 03 '22 at 04:02
  • I think it's your point lights that are too bright (200MW). Try disabling them from render and see how it comes out. For me, the flame is visible, despite placing a background behind it (with the lights disabled). – Christopher Bennett Oct 03 '22 at 15:58
  • Disabling the lights doesn't make a difference. The issue only occurs once the image is saved onto my computer, not after it is rendered. – Hunter Oct 03 '22 at 19:08

1 Answers1

0

The issue is that you are not using a volume shader, you plugged an emission shader into your material's volume output. It's a dirty way to fake volumetric at a low render time cost. But physically speaking, an emission shader can't be a volume. It can only work on a surface shader. If any volume emits light, it's because it is composed of tiny particles that emit light or gas. Which is exactly what volume shaders are for.

So the first logical solution would be to turn your shader into a genuine volume shader using the Principled Volume BSDF:

volume shader

Edit: Leave the Density at 1, Anisotropy at -1, and crank up the emission strenght to like 30. IDK why I said to put the density to zero, it'd be the same as using just an emission shader in the volume output. Though, the issue is that it won't look the same.

result

It took me only about 3 seconds to render it, against 1.24 with the fake emission volume.

Then comes the different issue of "Blender doesn't display things as they are". Once you saved it and try to use the file elsewhere, the parts of volume with nothing behind will look considerably faded out compared to what it looked like in Blender. You can try two solutions specific to volumes here: rendering - render on a transparent background (volume is almost invisible) - Blender Stack Exchange.


The second solution is keeping your shader as is and use some compositing to "bring it back" in the opaque world using the Cryptomatte.

 Note: Because Cryptomatte is currently broken on v3.3.0, hence it doesn't look the same. Also, you will probably need to wait for a bugfix before using this solution. See the bug ticket here:
 ⚓ T101601 Cryptomatte doesn't show all objects available

First, enable the Cryptomatte pass, either object or material will do in your case:

cryptomatte pass

Then you need to render the image.

Once done, you will be able to add a Cryptomatte node in your compositing. Plug the Picker output to a viewer node to be able to see each material/object as a different color, and click the node's + icon to colorpick the colors you want to add to the Matte ID:

picking mattes

Then you should be able to mix the Cryptomatte's mask output to your liking, I.E. to combine it back to the original image's alpha or do any kind of compositing you need in the first place:

example

L0Lock
  • 15,965
  • 1
  • 20
  • 44
  • This seems to have worked to fix the alpha, however there's no color in the saved image. For some reason, copying your steps leads to it still being transparent. It only shows up when I turn up the density, and then it doesn't show the emission outside of the area where it did before. i.imgur.com/5vAVxiH.png – Hunter Oct 04 '22 at 00:09
  • Check with a dark background, it worked correctly: https://i.imgur.com/VKjn27t.jpeg – L0Lock Oct 04 '22 at 02:05
  • I'm really confused about this. The emission color doesn't show up when there's nothing behind it, only the volume density. However, even without emission, this issue still persists. Once again, the issue is only present after saving the image to my computer, not while in the render window. I think it may have something to do with the saving process, as all transparent elements are lost, however I'm not sure how to fix this, as this still happens with other file formats and saving methods. i.imgur.com/Wo1QMqv.mp4 – Hunter Oct 04 '22 at 03:03
  • Yes, that's a different issue of "Blender doesn't display things as they are". You can try two solutions specific to volumes here: rendering - render on a transparent background (volume is almost invisible) - Blender Stack Exchange. I also planned on showing a different solution using Cryptomatte but it seems broken for now. – L0Lock Oct 04 '22 at 19:57
  • I added the cryptomatte solution though it's broken for now. I also corrected my first solution. – L0Lock Oct 04 '22 at 20:46
  • Thank you so much for the help! – Hunter Oct 04 '22 at 21:19