Way to render spotlights in a transparent background in Eevee?

I would like to get some disco / spotlight moving lights rendering in Eevee in a transparent background.
But for the moment I didn’t found another way to create them than using volumetric lights (to make the spot light cone visible), that cause the volume density to waste the transparency.

Also Eevee seems to not render Bloom / light leaks effects when transparency is activated.

I render in .png sequences

Thanks by advance if you have any idea!

I would do that as a transparent cone, maybe with a gradient to resemble light falloff, sure. Works with eevee, too.
What you did would use too much time in tweaking.

1 Like

Yes that’s the kind of thing I had in mind too. Thanks!

If someone has another way in mind still do not hesitate to share.

It isn’t that EEVEE isn’t rendering those effects, it is that the PNG format isn’t capable of storing them because of certain decisions that were made when the format was created and the specification was written.

The specification states that the alpha must be stored as unassociated (aka straight) alpha. EEVEE outputs associated alpha, as do all 3D render engines that I am aware of, as it is the natural output of render engines. Associated alpha is also confusingly called ‘premultiplied’ alpha. When talking about associated alpha, the alpha is occlusion. It represents the amount of light that the object blocks from other light sources that are behind it. The RGB color values represent the amount of light that the object reflects or emits toward the camera. Luminescent objects such as a glow or fire, do not block any of the light from light sources behind themselves. Therefore, their alpha is 0. When a render engine creates luminescent light, there isn’t any multiplying of the color values by the alpha, so the term ‘premultiplied’ doesn’t accurately describe the process. In 1984, when the paper by Porter and Duff came out that invented ‘premultiplied’ alpha, it described a two step process: multiplying the RGB values by alpha for subpixel compositing coverage, then subtracting an opacity factor ‘omega’ from only the alpha term to create luminescent objects, before storing the RGBA values in a file to be composited later. At some point this two step process got optimized to just write the light to the RGB values and not involve the alpha value since it would be zero anyway.

So back to the PNG specification. It states that associated alpha is to be converted to unassociated alpha by dividing the color channels by the alpha channel before storage. As dividing by zero is undefined, PNGs cannot store luminescent light.

The recommended format to save renders that you plan on doing additional work on, eg compositing and color correction, is OpenEXR.

1 Like

A Best Practice suggestion, I would say. Well said.

that’s complex but very interesting thanks for the explanation. I’m not sure OpenEXR can properly be exported as image sequences in After Effect just like PNG sequences to create an animation, then add effects to it, render it properly etc… If that’s the case i’ll definitly go for this option for my scenes with some bloom and transparency, thanks again.

About the spotlight, i finally found some default spotlight that I edited by removing background with after effect linear color masking, then import it as image plane in Blender, then making it emissive & alpha with some nodes colorRamp etc… Was a bit tricky but worked.