World Background IBL texture incorrect

Component:YafaRay Core
Category:bug report
Assigned:David Bluecame


During my tests while preparing the Material Preview with camera rotation I've found a bad problem in the world background.

There are two different issues happening, when using a background image texture:

* Artifacts in the image: I used a black texture with a yellow circle on it and when rendering the yellow circle has strange black artifacts.

* Incorrect IBL light position. This is bad: when using a background image texture in Angular mode and enablign IBL, the light from the IBL is in a DIFFERENT position respect to the texture!  This would cause the illumination in the scene NOT MATCHING the background texture!

I've checked with older YafaRay versions and both problems also happen. So, this seems to be a very old problem that for some reason went unnoticed?

I've attached an example (and very simple) blend file showing this problem. Please unpack the jpg texture before rendering.

world_bg_issues.blend535.74 KB
world_bg_issues.jpg106.02 KB



As you can see in the image, the test scene is very simple, it just has:

* Sphere

* Texture background angular + IBL


- The texture has black artifacts

- The sphere is illuminated by the IBL in the OPPOSITE! side of the Sphere respect to where the yellow spot is placed!



Status:active» ready to commit


It looks like this has been wrong, causing bad IBL illumination when using Angular textures for YEARS!  :-(

I've made some changes, one commit for each problem:

* Black artifacts:

* Incorrect IBL lighting when using Angular:

I hope these changes solve these problems without causing new issues. The changes will be included in the upcoming YafaRay-E version 2.1.1

I've attached an image rendered with the changes. It looks ok without artifacts and without the weird IBL problem, and when I rotate the scene to check the IBL, it's apparently correct now.




VERY IMPORTANT: This IBL problem has affected the illumination (and therefore the realism) for all scenes rendered with World Background Texture in Angular mode for years.

One of the biggest problems is this: until this fix, when setting a World Background Texture in Angular mode:

- The glossy/specular components of the materials were showing the reflections CORRECTLY

- The diffuse components of the materials were illuminated IN THE WRONG PLACE by the IBL

This means that the objects had, until now, an incorrect material lighting grossly reducing the realism in the scenes.

I hope this change improves the realism and lightning of the objects and materials from now on. Please let me know how this works for you.


I've uploaded another .blend scene (please download the HDRI texture "probe_foyer_FINAL.hdr" I used from its original website  before rendering)

As you can see, currently YafaRay is doing an incorrect lighting of the object. The reflections (including mirror and glossy) are correct, but the IBL lighting for the diffuse component is in the opposite side. That reduces a lot the realism of the scene and causes wrong illumination issues. This is the example of the wrong result:

wrong IBL lightingwrong IBL lighting

















With my latest changes, that will be available in YafaRay-E v2.1.1, the IBL in diffuse is in the same place as the reflections, giving a much better (and correct!) result:


correct IBL lightingcorrect IBL lighting


For some reason the .blend file did not appear in the previous post. You can download it from here.

world_bg_issues_1b.blend 484.33 KB


Indeed there seems to be some issue going on. I can confirm wrong results here too. Spherical maps seem to provide correct results though. This bug went unnoticed probably because spherical maps are much more common nowadays than angular ones.


Status:ready to commit» fixed

Fixed in YafaRay-E v2.1.1. See:


Status:fixed» closed

Fixed for 2 weeks without further comments, closing...