Volumes behind glass and transparent objects are not rendered

Project:YafaRay
Component:YafaRay Core
Category:bug report
Priority:normal
Assigned:David Bluecame
Status:closed
Description

I tried to render some objects with fully transparent regions inside a volumetric region and discovered that where the objects are supposed to be transparent, the background is seen trough. In the attached scene the color texture is mapped normally to COL and the alpha map (black where the object must be opaque, white where transparent) is mapped to ALPHA and NORGB. The glitch is visible the most when the transparent object is in front of the volumetric region and gradually fades out as the object moves behind the volume.

In the scene the leftmost leaf is behind the volumetric region, the middle is inside and the rightmost is infront.

 

Software used:

- YafaRay 0.1.1 (431)

- Ubuntu 9.10 64

- Blender 2.49b

The attached .blend file contains packed textures.

AttachmentSize
volumetrics_bugrep.blend590.73 KB

Comments

#1

In te original post the image was not attached properly

sample render 2 with sunsky

AttachmentSize
volglitch.02.jpg 20.01 KB

cgmo.net

#2

Version:»

Issue remains in YafaRay 0.1.2 beta2 / Blender 2.5 exporter

Blender 2.5 to test with below:

http://dl.dropbox.com/u/31120453/yafaray/bugs/volumetrics/volumetrics_bu...

Regards.

#3

I'm not sure if it is related, but it would be great to have the possibility to save volumetric regions with alpha backgrounds for compositing in a different background later. At the moment volume regions have no transparency when saved.

#4

Version:»

Confirmed this bug is still present in the current development version of yafaray.

It seems that Samo's file has changed settings on the volumetric object compared to the original, and these settings make the volumetric effect very difficult to see.  So I am attaching a new blend file with the settings I used, plus a render.

AttachmentSize
volumetrics_bugrep_updated.blend 634.38 KB
volumetrics_bug.png 181.04 KB

#5

Assigned to:Anonymous» David Bluecame

#6

Assigned to:David Bluecame» Anonymous
Status:active» postponed

From what I've seen, the volumes are composed with the rest of the objects at the level of integrator.cc. Although I'm not 100% sure, I believe that this means that volumes are rendered in a slightly independent way of other objects.

This causes that if you place a volume behind a transparent object, including transparency, glass materials, etc, the volume does not appear at all when behind such objects.

A change could be made in integrator.cc so the volumes are rendered "in front" of other objects, but then it would also render wrongly in front of opaque objects.

This issue looks complex and probably will require a major change in the way the fundamental integrators work. So, I'm postponing this for now.

#7

Title:Transparency with volumetrics rendering glitch» Volumes behind glass and transparent objects are not rendered

#8

Assigned to:Anonymous» David Bluecame
Status:postponed» ready to commit

Hello,

I've made a change relocating part of the Volumes integration code to include them in the normal raytracing process. After the change this scene seems to be rendering fine and  I can integrate better now volumes with glass objects, for example.

I've sent a pull request to YafaRay master for the developers to review:

https://github.com/YafaRay/Core/pull/96

EDIT 2015-10-13: I've closed the original pull request to make a small adjustment and created a new pull request. I've changed the link to the current pull request.

See attached file for the example of the render after this fix. I can still see some artifacts in the image, but it looks much better than before!

AttachmentSize
volumetrics_bugrep_fixed.jpg 33.27 KB

#9

Another example (attached blend file and rendered images), mixing a glass object and a volume.

Using the current YafaRay, the glass object looks wrong as it's not refracting the volume (which is obvious as volumes are not currently part of the recursive raytracing!)

After applying my changes and relocating the volumes to the ray tracing process, the glass object looks (apparently) correct.

EDIT: To avoid confusion: I mistakenly named the second image "absorbscatter-2spots_glass-original_yafaray_(looks_ok).jpg" but it was rendered using the modified yafaray... I cannot change the filename now...

AttachmentSize
absorbscatter-2spots_glass.blend 630.25 KB
absorbscatter-2spots_glass-original_yafaray (wrong).jpg 21.16 KB
absorbscatter-2spots_glass-original_yafaray_(looks_ok).jpg 22 KB

#10

Another example of something that cannot be done in the standard YafaRay: using volumes and mirrors. See attached blend and example renders.

As YafaRay does not include (yet) volumes in the ray tracing process, volumes are not refracted nor reflected. For example putting a mirror would not reflect the volume at all, only its shadow.

With the changes I propose in the pull request above, volumes are correctly reflected as well as refracted.

I think there is still something more that needs correction, but I also think the results now are way better than before.

AttachmentSize
stepsize_mirror.blend 608.65 KB
stepsize_mirror-yafaray_original_(missing_volume_in_mirror).jpg 7.73 KB
stepsize_mirror-yafaray_modifications_(correctly_volume_in_mirror).jpg 7.92 KB

#11

Status:ready to commit» fixed

Fixed in YafaRay-E (Experimental) v1.0.0

 

For more information, see:  http://www.yafaray.org/community/forum/viewtopic.php?f=12&t=5117

 

If you still have this issue with the new version please let us know.

#12

Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.