Meshes get black faces if scaled up several times

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

The problem occurs when a model is scaled up several times, then the faces look like they are overlaying each other there in fact they aren't.

The first image shows the sphere scaled up 500x

The second image shows the sphere scaled down 0.5x

(to reproduce the second effect, scale down the parent (empty) 0.001x )

(Yafaray build with default optimization)

 

check the files below:

AttachmentSize
face_issue.blend231.38 KB
sphereupscaled.png954.09 KB
spheredownscaled.png557.02 KB

Comments

#1

Bug confirmed on Windows 7 64 bits / YafaRay 0.1.2 beta 2 / blender 2.5 exporter August 2011, using the scene posted by Aspen.

#2

Version:»

Still happening in YafaRay 012 beta 5a Blender 2.62a. You can try with the scene below, adapted to Blender 2.63

http://dl.dropbox.com/u/31120453/yafaray/bugs/faceissue/face_issue2.63a....

#3

Version:»

Confirmed this issue with latest development version of yafaray.

Also tested with an object containing fewer faces, artifacts are present with the diamond shape too.

AttachmentSize
face_issue_diamond.blend 363.81 KB
face_issue_diamond.png 960.58 KB

#4

I looked into this, I think it's related to numerical precision and the way Yafaray tries to avoid self-shadowing. When having a large-scale scene, the decimal precision is lost and the offset used to avoid self-shadowing may fail somewhat arbitrarily. One solution would be to scale down all scenes inside Yafaray, but this would lead to problems with texture scales etc. Another solution would be to finally change the self-shadowing bias to something adapted to the scene size.

#5

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

Hello,

I'm marking this as a duplicate because this problem is caused by the same issue affecting the issue here: http://www.yafaray.org/node/585

I've sent pull requests to expose the Shadow Bias to the user, so the user can fix these problems with black dots in the scenes where they happen.

https://github.com/YafaRay/Core/pull/77
https://github.com/YafaRay/Blender-Exporter/pull/22

With this change, I can render this image correctly if I increase the Shadow Bias from the default value (0.0005) to, for example. 0.005. This also changes automatically the minimum ray distance (1/10th of the shadow bias)

For more information and images, please see:

http://www.yafaray.org/community/forum/viewtopic.php?p=31057#p31057

#6

After discussing it with DarkTide, this needs more work. Instead of a temporary solution exposing the shadow bias parameter we will look for an automatic shadow bias calculation depending on the scene.

So, I've sent a very experimental change to automatically calculate the shadow bias and ray minimum distance based on the size of the scene.

The pull request is:

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

 

It needs to be extensively tested, but in my tests it gets rid of all these problems without obvious new issues, but such a fundamental change affects everything and needs to be tested thoroughly.

To avoid duplicating comments, I will continue the discussion in the bug report:

http://www.yafaray.org/node/585

#7

Status:duplicate» closed

The change for automatic bias calculation has been accepted in the official YafaRay code and I've made builds of an Experimental version with this fix included, so I will consider it fixed. See bug report http://www.yafaray.org/node/585 for more information.

As this is considered a duplicate bug report and the "original" one has been fixed, I will close this. In any case I want to include the scene in this bug report rendered with the new experimental version for future reference:

 

AttachmentSize
sphere automatic shadow bias version fixed self-shadow bug.png 112.87 KB

#8

Also the diamond image without the self shadow problem now:

AttachmentSize
diamond automatic shadow bias version fixed self-shadow bug.png 102.55 KB