ray offsetting giving precission problems / render artifacts / cracks on far away geometry #43835

Closed
opened 2015-02-28 01:38:25 +01:00 by Yousef Harfoush · 85 comments

System Information
windows 8.1.1 x64, geforce 660

Blender Version
Broken: tested 2.65 till 2.73 #bbf09d9
Worked: !

Short description of error
strange cracks appear on model in cycles render, if i reset rotation most of them disappears, if i reset position all then disappears.

Exact steps for others to reproduce the error

  • after opening shift-z to render and you'll see these cracks:strange_cracks.blend
    strange_cracks.png

  • reset rotation -> some disappears
    strange_cracks_reset_rotation.png

  • reset position -> all disappears
    strange_cracks_reset_posistion.png

i have checked the mesh no overlapping !

**System Information** windows 8.1.1 x64, geforce 660 **Blender Version** Broken: tested 2.65 till 2.73 #bbf09d9 Worked: ! **Short description of error** strange cracks appear on model in cycles render, if i reset rotation most of them disappears, if i reset position all then disappears. **Exact steps for others to reproduce the error** - after opening shift-z to render and you'll see these cracks:[strange_cracks.blend](https://archive.blender.org/developer/F146211/strange_cracks.blend) ![strange_cracks.png](https://archive.blender.org/developer/F146204/strange_cracks.png) - reset rotation -> some disappears ![strange_cracks_reset_rotation.png](https://archive.blender.org/developer/F146206/strange_cracks_reset_rotation.png) - reset position -> all disappears ![strange_cracks_reset_posistion.png](https://archive.blender.org/developer/F146208/strange_cracks_reset_posistion.png) i have checked the mesh no overlapping !
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'
Author
Member

Added subscriber: @bat3a

Added subscriber: @bat3a

#94830 was marked as duplicate of this issue

#94830 was marked as duplicate of this issue

#94175 was marked as duplicate of this issue

#94175 was marked as duplicate of this issue

#94205 was marked as duplicate of this issue

#94205 was marked as duplicate of this issue

#93346 was marked as duplicate of this issue

#93346 was marked as duplicate of this issue

#94056 was marked as duplicate of this issue

#94056 was marked as duplicate of this issue

#91758 was marked as duplicate of this issue

#91758 was marked as duplicate of this issue

#88723 was marked as duplicate of this issue

#88723 was marked as duplicate of this issue

#87617 was marked as duplicate of this issue

#87617 was marked as duplicate of this issue

#87301 was marked as duplicate of this issue

#87301 was marked as duplicate of this issue

#84676 was marked as duplicate of this issue

#84676 was marked as duplicate of this issue

#84500 was marked as duplicate of this issue

#84500 was marked as duplicate of this issue

#82721 was marked as duplicate of this issue

#82721 was marked as duplicate of this issue

#79679 was marked as duplicate of this issue

#79679 was marked as duplicate of this issue

#54284 was marked as duplicate of this issue

#54284 was marked as duplicate of this issue

#52994 was marked as duplicate of this issue

#52994 was marked as duplicate of this issue

#51034 was marked as duplicate of this issue

#51034 was marked as duplicate of this issue
Sergey Sharybin was assigned by Bastien Montagne 2015-02-28 14:40:10 +01:00

Added subscriber: @mont29

Added subscriber: @mont29

Think you are hitting a float precision limit here, your model is rather small and quite far away from origin. Yet, I would not expect that kind of issue to happen so soon (not even three orders of magnitude between size and offset)…

Sergey, this one is for you too I guess?

Think you are hitting a float precision limit here, your model is rather small and quite far away from origin. Yet, I would not expect that kind of issue to happen so soon (not even three orders of magnitude between size and offset)… Sergey, this one is for you too I guess?
Author
Member

the model is ~0.4 cubed, which is normal for a character, also this sample is taken from a big environment, in which the character should be in place to act.

the model is ~0.4 cubed, which is normal for a character, also this sample is taken from a big environment, in which the character should be in place to act.
Author
Member

any progress or a work around? my chars. already been animated and i still can't render them, thank you.
and sorry to annoy.

any progress or a work around? my chars. already been animated and i still can't render them, thank you. and sorry to annoy.

@bat3a, it's not strictly speaking easy to solve issue, seems machine arithmetic backfires here.

The possible workaround is to scale the scene up.

@bat3a, it's not strictly speaking easy to solve issue, seems machine arithmetic backfires here. The possible workaround is to scale the scene up.
Author
Member
 The possible workaround is to scale the scene up.

i didn't understand, you mean the scaling assets! which i tried but couldn't because they are already animated.

i also understand it may need time to resolve, thanks for your time.

``` The possible workaround is to scale the scene up. ``` i didn't understand, you mean the scaling assets! which i tried but couldn't because they are already animated. i also understand it may need time to resolve, thanks for your time.

Added subscriber: @ideasman42

Added subscriber: @ideasman42

The problem isnt exactly the object scale, Its the size of the object combine with it being nearly 160 units away from the scene center.

160 isn't really all that big though. (typically these issues happen at around ~5000+).

The problem isnt exactly the object scale, Its the size of the object combine with it being nearly 160 units away from the scene center. 160 isn't really all that big though. (typically these issues happen at around ~5000+).

@ideasman42, it's not that huge numbers to make single precision floats to become an issue imo. But i still didn't nail the root of the issue down and it'll take some time still i'm afraid.

@ideasman42, it's not that huge numbers to make single precision floats to become an issue imo. But i still didn't nail the root of the issue down and it'll take some time still i'm afraid.

Added subscriber: @MarcClintDion

Added subscriber: @MarcClintDion

This comment was removed by @MarcClintDion

*This comment was removed by @MarcClintDion*
Author
Member

@MarcClintDion: even if the scale is big, it is very expected, the character head in the sample is ~0.4 unit which is near human, also the environment scale is almost real, so this should not happen at the very least.

also the problem is that i already animated the chars.,i use a simple workflow -my team is very small actually 2- it's just single file that contains everything, so the full environment with various scenes are game like, if i needed a shot i move the chars. to the scene place, so taking the chars to origin is very hard if not impossible.

@MarcClintDion: even if the scale is big, it is very expected, the character head in the sample is ~0.4 unit which is near human, also the environment scale is almost real, so this should not happen at the very least. also the problem is that i already animated the chars.,i use a simple workflow -my team is very small actually 2- it's just single file that contains everything, so the full environment with various scenes are game like, if i needed a shot i move the chars. to the scene place, so taking the chars to origin is very hard if not impossible.

This comment was removed by @MarcClintDion

*This comment was removed by @MarcClintDion*

Developer information:
The issue is actually coming from the way how ray bounce is happening: it is using ray_offset() in order to avoid self-intersection. This function will push ray along the face normal by a small value. This small value is different for different axis and actually depends on magnitude of the original coordinate. In this case ray is getting pushed a bit more along Y axis than along X and Z axis. This makes ray to be moved into the surface itself, causing light artifacts.

I'm not really sure how to solve this with current approach to ray bounce, but the idea i was testing is to avoid having ray_offset() all together and perform "near clip" check in triangle intersection code. Here's a really quick patch which demonstrates the idea: tnear.patch. It is only done for triangles, motion triangles and hair would give artifacts with it.

This approach could make it simplier to deal with #43865, increasing ray_tnear for a huge values of det would avoid false-positive intersections.

Developer information: The issue is actually coming from the way how ray bounce is happening: it is using `ray_offset()` in order to avoid self-intersection. This function will push ray along the face normal by a small value. This small value is different for different axis and actually depends on magnitude of the original coordinate. In this case ray is getting pushed a bit more along Y axis than along X and Z axis. This makes ray to be moved into the surface itself, causing light artifacts. I'm not really sure how to solve this with current approach to ray bounce, but the idea i was testing is to avoid having `ray_offset()` all together and perform "near clip" check in triangle intersection code. Here's a really quick patch which demonstrates the idea: [tnear.patch](https://archive.blender.org/developer/F152649/tnear.patch). It is only done for triangles, motion triangles and hair would give artifacts with it. This approach could make it simplier to deal with #43865, increasing `ray_tnear` for a huge values of `det` would avoid false-positive intersections.

This comment was removed by @MarcClintDion

*This comment was removed by @MarcClintDion*

The patch i've attached only to show an idea, i didn't mention it fixes anything. It still needs quite some work to be done.

The patch i've attached only to show an idea, i didn't mention it fixes anything. It still needs quite some work to be done.

This comment was removed by @MarcClintDion

*This comment was removed by @MarcClintDion*

Added subscriber: @jerryno

Added subscriber: @jerryno

A related bug report: #41073.

A related bug report: [#41073](https://developer.blender.org/T41073).

Moving to a TODO since it's known floating point issue which existed in all releases.

Moving to a TODO since it's known floating point issue which existed in all releases.
Author
Member

Added subscriber: @Sergey

Added subscriber: @Sergey
Author
Member

@Sergey: do i need to redo my animation now! or is there a work around that can overcome this till it is fixed, frankly a TODO task means years+ of waiting, thank you.

@Sergey: do i need to redo my animation now! or is there a work around that can overcome this till it is fixed, frankly a TODO task means years+ of waiting, thank you.

it is not a trivial issue to fix in a general case without causing render slowdown. TODO does not mean years+ of waiting, there's WIP patch which you can potentially use already.

Non-code workaround for you would be to parent your scene to an empty and move it closer to the scene origin.

it is not a trivial issue to fix in a general case without causing render slowdown. TODO does not mean years+ of waiting, there's WIP patch which you can potentially use already. Non-code workaround for you would be to parent your scene to an empty and move it closer to the scene origin.
Author
Member

ok i tried the batch you've made, it works! i didn't try it before because of the artifacts that @MarcClintDion mentioned, which i didn't find any of it ! but maybe it would exist in some extreme situation.

one thing arises is that the viewport is darker than the final render (or it turns smoothing off), here is a test:
viewVSf12.png

also i didn't notice a slowdown in my case, notice the render time for viewport and render.

thank you.

ok i tried the batch you've made, it works! i didn't try it before because of the artifacts that @MarcClintDion mentioned, which i didn't find any of it ! but maybe it would exist in some extreme situation. one thing arises is that the viewport is darker than the final render (or it turns smoothing off), here is a test: ![viewVSf12.png](https://archive.blender.org/developer/F161593/viewVSf12.png) also i didn't notice a slowdown in my case, notice the render time for viewport and render. thank you.

@bat3a, the issue mentioned by @MarcClintDion are happening with really insane coordinates, which are totally stressing single precision floating point arithmetic. Those cases are quite tricky to solve in general case and requires some black magic (which would still fail in certain circumstances btw).

The viewport issues are rather interesting, i'll have a look into them ASAP.

@bat3a, the issue mentioned by @MarcClintDion are happening with really insane coordinates, which are totally stressing single precision floating point arithmetic. Those cases are quite tricky to solve in general case and requires some black magic (which would still fail in certain circumstances btw). The viewport issues are rather interesting, i'll have a look into them ASAP.

This comment was removed by @MarcClintDion

*This comment was removed by @MarcClintDion*
Author
Member

hi
this patch is not applicable to latest git, i would appreciate if someone updates it cause the problem still exist.

thank you.

hi this patch is not applicable to latest git, i would appreciate if someone updates it cause the problem still exist. thank you.
Author
Member

anyone could update this thank you.

anyone could update this thank you.

Added subscriber: @midan-3

Added subscriber: @midan-3

the problem still occurs in latest build 9b29233

the problem still occurs in latest build 9b29233

Added subscribers: @ManuJarvinen, @VukGardasevic

Added subscribers: @ManuJarvinen, @VukGardasevic

This comment was removed by @MarcClintDion

*This comment was removed by @MarcClintDion*

Added subscribers: @LukaszDebita, @brecht, @Foaly

Added subscribers: @LukaszDebita, @brecht, @Foaly
Sergey Sharybin removed their assignment 2020-03-13 16:20:51 +01:00

There is D6250 which addresses this issue.

There is [D6250](https://archive.blender.org/developer/D6250) which addresses this issue.
Member

Added subscribers: @BlakeF24, @EAW, @vasiln, @zaster

Added subscribers: @BlakeF24, @EAW, @vasiln, @zaster
Member

Added subscriber: @MOSESNES

Added subscriber: @MOSESNES

In #43835#464224, @MarcClintDion wrote:
If behind the scenes, Blender were to move the entire scene using the inverse of the camera transform instead of moving the camera itself, then visible close-up models would never be far from the origin. Now round-off/precision errors would likely be mostly eliminated.

In other words, why is Cycles performing any calculations in world space? Wouldn't camera space be a more appropriate space for these operations? Perhaps offset by some fraction of far clip?

> In #43835#464224, @MarcClintDion wrote: > If behind the scenes, Blender were to move the entire scene using the inverse of the camera transform instead of moving the camera itself, then visible close-up models would never be far from the origin. Now round-off/precision errors would likely be mostly eliminated. In other words, why is Cycles performing any calculations in world space? Wouldn't camera space be a more appropriate space for these operations? Perhaps offset by some fraction of far clip?
Member

Added subscribers: @B_Engstler, @constantin.kormann

Added subscribers: @B_Engstler, @constantin.kormann
Philipp Oeser changed title from strange cracks appear on model to ray offsetting giving precission problems / render artifacts / cracks on far away geometry 2021-02-01 17:19:50 +01:00
Member

Added subscribers: @imrevarga, @lichtwerk

Added subscribers: @imrevarga, @lichtwerk

So looks like we have to live with that.

By the way, I got around my problem on hand by having the cyclist cycle in place and moving the landscape. This is the equivalent to (marcclintdion) 's proposal.

So looks like we have to live with that. By the way, I got around my problem on hand by having the cyclist cycle in place and moving the landscape. This is the equivalent to (marcclintdion) 's proposal.
Member

Added subscriber: @IPv6

Added subscriber: @IPv6
Contributor

Added subscriber: @Eary

Added subscriber: @Eary
Contributor

Don't know if this is the same issue, but I am having a similar problem, a large scale scene with a character far away from world origin
image.png

This eyebrow's material has a Alpha value of 0, so it should have been completely transparent. It works fine at the world's origin, but does not work at all at where the character should be. This is a serious issue, hope it gets fixed soon.

Don't know if this is the same issue, but I am having a similar problem, a large scale scene with a character far away from world origin ![image.png](https://archive.blender.org/developer/F9929886/image.png) This eyebrow's material has a Alpha value of 0, so it should have been completely transparent. It works fine at the world's origin, but does not work at all at where the character should be. This is a serious issue, hope it gets fixed soon.
Member

Added subscriber: @imdjs

Added subscriber: @imdjs
Member

Added subscriber: @roman-13

Added subscriber: @roman-13

Added subscribers: @etufo2, @ktdfly

Added subscribers: @etufo2, @ktdfly

Added subscriber: @MarcelLegindi

Added subscriber: @MarcelLegindi

Added subscribers: @3di, @deadpin

Added subscribers: @3di, @deadpin

Removed subscriber: @MarcClintDion

Removed subscriber: @MarcClintDion
Member

Added subscribers: @sharukh345, @leesonw, @Alaska

Added subscribers: @sharukh345, @leesonw, @Alaska
Member

Added subscriber: @binke

Added subscriber: @binke
Member

Added subscriber: @A-T

Added subscriber: @A-T

This issue was referenced by blender/cycles@e38b69de0f

This issue was referenced by blender/cycles@e38b69de0f5d47bed2784ba63c71a0cba4eda7ec

This issue was referenced by 74afc86d4b

This issue was referenced by 74afc86d4bf1a559e5b7a0cf5cea29cb508a3e99
Member

Added subscriber: @animation.entertainmenttv

Added subscriber: @animation.entertainmenttv

Added subscriber: @b5327157

Added subscriber: @b5327157

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Brecht Van Lommel self-assigned this 2022-01-26 17:55:33 +01:00

This should be much improved now with the latest changes:

Remove small ray offsets that were used to avoid self intersection, and leave
that to the newly added primitive object/prim comparison. These changes together
significantly reduce artifacts on small, large or far away objects.

The balance here is that overlapping primitives are not handled well and should
be avoided (though this was already an issue). The upside is that this is
something a user has control over, whereas the other artifacts had no good
manual solution in many cases.

There is a known issue where the Blender particle system generates overlapping
objects and in turn leads to render differences between CPU and GPU. This will
be addressed separately.

However it doesn't mean all artifacts are necessarily generated, there will always be some larger/smaller value that causes problems. If any remaining issues are still considered bugs we'll have to check case by case.

This should be much improved now with the latest changes: ``` Remove small ray offsets that were used to avoid self intersection, and leave that to the newly added primitive object/prim comparison. These changes together significantly reduce artifacts on small, large or far away objects. The balance here is that overlapping primitives are not handled well and should be avoided (though this was already an issue). The upside is that this is something a user has control over, whereas the other artifacts had no good manual solution in many cases. There is a known issue where the Blender particle system generates overlapping objects and in turn leads to render differences between CPU and GPU. This will be addressed separately. ``` However it doesn't mean all artifacts are necessarily generated, there will always be some larger/smaller value that causes problems. If any remaining issues are still considered bugs we'll have to check case by case.

For rendering, could the precision centre be the camera instead of world 0? That way you'd never get perceivable precision artefacts (only on very distant stuff).

For rendering, could the precision centre be the camera instead of world 0? That way you'd never get perceivable precision artefacts (only on very distant stuff).

That way you'd never get perceivable precision artefacts (only on very distant stuff).

This assumption is not correct, there are many artifacts that would not be helped by this.

And besides that, there are other trade-offs related to this as well. Issues with frame-to-frame coherence in animation, impossible to efficiently support for interactive viewport render, additional overhead in texturing/shading, etc.

> That way you'd never get perceivable precision artefacts (only on very distant stuff). This assumption is not correct, there are many artifacts that would not be helped by this. And besides that, there are other trade-offs related to this as well. Issues with frame-to-frame coherence in animation, impossible to efficiently support for interactive viewport render, additional overhead in texturing/shading, etc.

I'll have to give it a whirl by setting the entire scene as a collection instance and move that horizontally and the camera vertically only. I never get perceivable geometry changes with adaptive displacement, so I reckon it'll be the only solution for unreal engine size worlds.

I'll have to give it a whirl by setting the entire scene as a collection instance and move that horizontally and the camera vertically only. I never get perceivable geometry changes with adaptive displacement, so I reckon it'll be the only solution for unreal engine size worlds.

I still have the same problem even in Blender 3.0.1. Nothing has been improved on my end. This problem is persistent. Blender Render With Error.png

Blender Render Without Error.png

I still have the same problem even in Blender 3.0.1. Nothing has been improved on my end. This problem is persistent. ![Blender Render With Error.png](https://archive.blender.org/developer/F12826937/Blender_Render_With_Error.png) ![Blender Render Without Error.png](https://archive.blender.org/developer/F12826936/Blender_Render_Without_Error.png)
Member

In #43835#1295700, @animation.entertainmenttv wrote:
I still have the same problem even in Blender 3.0.1. Nothing has been improved on my end. This problem is persistent. Blender Render With Error.png

Blender Render Without Error.png

This will only be in 3.1, not 3.0.1

> In #43835#1295700, @animation.entertainmenttv wrote: > I still have the same problem even in Blender 3.0.1. Nothing has been improved on my end. This problem is persistent. ![Blender Render With Error.png](https://archive.blender.org/developer/F12826937/Blender_Render_With_Error.png) > > ![Blender Render Without Error.png](https://archive.blender.org/developer/F12826936/Blender_Render_Without_Error.png) This will only be in 3.1, not 3.0.1

Added subscriber: @JanKaderabek

Added subscriber: @JanKaderabek

Added subscriber: @Alex-Ducos

Added subscriber: @Alex-Ducos

image.png

My scene has this issue as well! I am, indeed, pretty far from the origin. (By necessity - this is a large scene!)

image.png

^ current distance from the scene origin ^

Setting location to the scene origin DOES remove artifacts.

image.png
image.png

Seeing as this issue cannot be avoided for large scenes, within CYCLES (in RECENT builds) I would actually request that we re-open this "closed, resolved" case! (Seeing as this is a TOTALLY nasty issue, which can't always be hacked around!!)

Anyone who should see this comment, PLEASE - help me to know how to notify a developer! (this is the first time I have done anything which smells even remotely of a bug report - so I have no idea what I'm doing!)

THANK YOU!!!

![image.png](https://archive.blender.org/developer/F12915448/image.png) My scene has this issue as well! I am, indeed, pretty far from the origin. (By necessity - this is a large scene!) ![image.png](https://archive.blender.org/developer/F12915673/image.png) *^ current distance from the scene origin ^* Setting location to the scene origin DOES remove artifacts. ![image.png](https://archive.blender.org/developer/F12916192/image.png) ![image.png](https://archive.blender.org/developer/F12916364/image.png) Seeing as this issue cannot be avoided for large scenes, within CYCLES (in RECENT builds) I would actually request that we re-open this "closed, resolved" case! (Seeing as this is a TOTALLY nasty issue, which can't always be hacked around!!) Anyone who should see this comment, PLEASE - help me to know how to notify a developer! (this is the first time I have done anything which smells even remotely of a bug report - so I have no idea what I'm doing!) *THANK YOU!!!*
Member

@Alex-Ducos It's probably best if you make a new bug report. This can be done by:

  1. Opening Blender.
  2. Selecting from the top of Blender Help -> Report a bug and a form will open in your web browser.
  3. Fill out all the information related to the bug you're experiencing (and include a .blend file if you can). The triaging team will then take a look at your bug report.
@Alex-Ducos It's probably best if you make a new bug report. This can be done by: 1. Opening Blender. 2. Selecting from the top of Blender `Help -> Report a bug` and a form will open in your web browser. 3. Fill out all the information related to the bug you're experiencing (and include a .blend file if you can). The triaging team will then take a look at your bug report.
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
22 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#43835
No description provided.