Hello,
I've been investigating this further and my previous solution was incomplete and did not solve all the issues with Volumes.
For example, when rendering a volume over a transparent background (for compositing purposes) the area of the volume and boundary box had still an Alpha=1 which did not allow for compositing.
So, I have cancelled my previous Pull Request and created a new Pull Request with different changes:
https://github.com/YafaRay/Core/pull/73This time I focused on trying to fix the Alpha calculation, trying to get a more correct Alpha values for all the volume pixels. Apparently this has fixed the problems with Alpha > 1.0 so I could remove the check I used in my previous fix.
Some examples (you can download all files from
https://github.com/DavidBluecame/YafaRay---unofficial-Builds/raw/master/YafaRay%20volumetrics%20fix%20-%20example%20files.zip )
Rendering over other objects:
Before this fix, incorrect:
.png)
After this fix, apparently correct:
.png)
Rendering over opaque background:
Before this fix, incorrect:
.png)
After this fix, apparently correct:
.png)
Rendering over transparent background (this is the problem that was not fixed with my previous fix and it's hopefully solved now):
Before this fix, incorrect:
.png)
After this fix, apparently correct:
.png)
Example of composition made in GIMP with a background image and the new (correct) volume generated with transparent background:
Maybe it's not yet a perfect solution (in the composition I can still see that the edge of the volume is not 100% transparent, but I still believe it's working much better than before. To make it perfect I would need help from the experts and senior developers as I don't yet understand well the internals of the renderer.
In any case, I hope you find this useful. However, as it's a big change in a main component of YafaRay, please test it thoroughly with your scenes to make sure it does not cause any new issues.
[EDIT] I just made a Beta4 for Blender 2.74 in Windows 7 / 8.1 64 bits and these Volumetric fixes applied, so I've edited this post to include the link as well:
https://github.com/DavidBluecame/YafaRay---unofficial-Builds/raw/master/YafaRay%20v0.1.5%20-%20Beta%204%20(2015-04-04)%20unofficial%20build%20for%20Blender%202.74%20Windows%207-8.1%2064bit.zipBest regards. David.