I'm currently working on a visualisation of rays in a lens system, using lasers with homogeneous volume.
I'm trying to do it with a transparent background, but then the rays that are in front of the background get (mostly) cut off. Example renders attached.
Is there a setting for this somehwere? Viewport render doesn't show this behaviour.
Using Blender 2.81 and LuxCore 2.3rc1.
Transparent background, threshold level
Forum rules
Please upload a testscene that allows developers to reproduce the problem, and attach some images.
Please upload a testscene that allows developers to reproduce the problem, and attach some images.
Re: Transparent background, threshold level
Do you mind to share the scene?
CPU Bidir + Metropolis | Core i5-4570
Re: Transparent background, threshold level
I think I see the problem. I inspected the RGBA values pixel by pixel. The RGB values of the laser beam are in fact there, but the alpha-value remains zero for most of them, and small for the remaining. Thats why when I import it into another programm and add a background, the beam doesn't appear.
Thinking about this, I believe it is correct behaviour. Volumetric scattering in front of transparent probably just isn't easy.
For now, I can easily work around this problem in my use case.
Thinking about this, I believe it is correct behaviour. Volumetric scattering in front of transparent probably just isn't easy.
For now, I can easily work around this problem in my use case.
- Attachments
-
- transparency_forum.blend
- (1.07 MiB) Downloaded 253 times
Re: Transparent background, threshold level
I get it. Volume was just too thin. There I multiplied scattering scale by 10:
CPU Bidir + Metropolis | Core i5-4570
Re: Transparent background, threshold level
I assume it is the correct behavior: alpha will be an average of all the times the ray pass trough (alpha = 0.0) and all the times the ray is scattered (when the laser is visible, alpha = 1.0). So if the volume scatters the laser 1 out of 10 times, alpha should be equal to 0.1.CodeHD wrote: Wed Mar 04, 2020 4:04 pm I think I see the problem. I inspected the RGBA values pixel by pixel. The RGB values of the laser beam are in fact there, but the alpha-value remains zero for most of them, and small for the remaining.
Are you experiencing a different behavior (for instance alpha a lot smaller than the expected value) ?
Re: Transparent background, threshold level
Well, I don't have a reference what the values "should be" in this scene, but what I am seeing makes sense, so I again agree that this is correct behaviour.Dade wrote: Wed Mar 04, 2020 5:03 pm Are you experiencing a different behavior (for instance alpha a lot smaller than the expected value) ?
Hence my "problem" (i should have put it in quotation marks before

I just played around with a script that (basically) adds the color saturation or brightness to alpha. Works to some degree, but suffers from noise and white-scattered light from the scene illumination (If only OIDN worked with alpha

I will let it render for a while to get a clean image. maybe a decent workaround is possible. Its a corner case

Re: Transparent background, threshold level
Forgot to respond to this. It's not quite the solution I'm going for because is also increases scatter outside the beams, where i do want transparency. I'm currently trying to instead increase the brightness of the lasers.wasd wrote: Wed Mar 04, 2020 4:54 pm I get it. Volume was just too thin. There I multiplied scattering scale by 10: unisob_autodetect_camvol-2.png
Re: Transparent background, threshold level
I think you could just post-process the alpha channel: if (alpha > 0.0) than set alpha = 1.0CodeHD wrote: Wed Mar 04, 2020 5:57 pm I just played around with a script that (basically) adds the color saturation or brightness to alpha. Works to some degree, but suffers from noise and white-scattered light from the scene illumination (If only OIDN worked with alpha). So it may not really be a universal solution.
Re: Transparent background, threshold level
That won't work, since the alpha is the same over the whole volume.Dade wrote: Wed Mar 04, 2020 6:30 pm I think you could just post-process the alpha channel: if (alpha > 0.0) than set alpha = 1.0
The alpha is not modified by how much light was received for a pixel.
Re: Transparent background, threshold level
Maybe a compositing setup like this would work?