9
$\begingroup$

I'm creating a simple fireball sprite for my game and I want to render a fire animation.

I would like to get the upper images with transparent background, but when is set the transparency on under Render -> Film one of my frames will look like lower pictures.

You can see the difference of these two images.

without transparency with transparency

$\endgroup$
6
  • $\begingroup$ This works for me in 2.76b $\endgroup$
    – J Sargent
    Commented Dec 12, 2015 at 23:17
  • $\begingroup$ Oh. I am very sorry for asking it then... I was still using an obsolete version of Blender... $\endgroup$ Commented Dec 13, 2015 at 0:30
  • $\begingroup$ That's ok. Try using the latest version from Blender.org, it should work correctly. There are a lot of cool new features too :) $\endgroup$
    – J Sargent
    Commented Dec 13, 2015 at 0:43
  • $\begingroup$ Also note that if you have an Emission Shader plugged into the Volume output it won't be visible against a transparent background unless you are rendering out to EXR format. I don't know what kind of node setup you have, but figured it wouldn't hurt to mention that. $\endgroup$
    – Mentalist
    Commented Dec 13, 2015 at 2:10
  • $\begingroup$ I used the transparency setting with the latest Blender version, but something went wrong. I didn' t get the result I desired. Here's the image of the basic settings I use to test, whether my flame gets rendered. gyazo.com/f3829e2e83d284344ecd841473c4397a And here's my node system for domain. Not sure, but I think I have missed something important. gyazo.com/de7a3281fa693f06440e0924b8f68e2f $\endgroup$ Commented Dec 13, 2015 at 13:53

2 Answers 2

7
$\begingroup$

Blender's viewer is broken for that kind of images, so it's possible that your fire is rendered properly but the viewer isn't showing it correctly when you activated the "transparent" checkbox. Try to switch the channels preview setting in the viewer from "color and alpha" (RGBA) to "color" (RGB).

enter image description here

enter image description here

If after doing that you can see the fire on black background, then your output is ok. (The ball occludes and emits, while the fire only emits.)

The next step is making sure that you're exporting the image correctly: You'll have to use a format that supports associated alpha. As @mentalist mentioned, EXR is one of those formats. You'll have to make sure that the program where you're going to use that sprite supports EXR and associated alpha images, otherwise it won't be composited properly.

Keep in mind that PNG won't work for that, as it uses unassociated alpha.

EDIT:

On version 2.92 the viewer has been fixed, so you can see the proper associated alpha.

$\endgroup$
1
  • $\begingroup$ In 2.93 the issue srill persist and you get an empty image when rendering a tranparent background png. Using composition method results in a ugly green flame. $\endgroup$
    – Ebi
    Commented Oct 20, 2021 at 13:32
2
$\begingroup$

The emission shader renders almost completely transparent to PNGs, I believe, because it is rendering no volume. You can use the Emission Strength and Emission Color properties of the Principled Volume shader to correct this, and then you don't need the emission shader. Shader Configuration

Transparent Fire

$\endgroup$
2
  • $\begingroup$ Hey, I appreciate the downvotes.. What I'd appreciate more is some constructive criticism. This method works for me. How can I improve it? $\endgroup$
    – wizulus
    Commented Jan 27, 2021 at 19:15
  • $\begingroup$ This worked for me too. The critical step seems to be setting "Density Attribute" to "flame". $\endgroup$ Commented Jun 13, 2022 at 12:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .