Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYimingWu <xp8110@outlook.com>2021-06-02 15:55:54 +0300
committerYimingWu <xp8110@outlook.com>2021-06-02 15:55:54 +0300
commit5b176b66da1f85f19e042f69dc302e8e72e0dc44 (patch)
treea28dbecc2133344f7c73916f366eec55dbc09165 /source/blender/gpencil_modifiers/intern
parenta55b73417f023a74c62773a6dc467146a2218519 (diff)
LineArt: Tolerance for faces perpendicular to view
This is due to cam->obmat precision issue, where it affects view vector precision. Reviewed by Sebastian Parborg (zeddb) Differential Revision: https://developer.blender.org/D11461
Diffstat (limited to 'source/blender/gpencil_modifiers/intern')
-rw-r--r--source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
index 0b439c20d65..b546aaa683e 100644
--- a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
+++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
@@ -2064,7 +2064,11 @@ static bool lineart_triangle_edge_image_space_occlusion(SpinLock *UNUSED(spl),
dot_r = dot_v3v3_db(Rv, tri->gn);
dot_f = dot_v3v3_db(Cv, tri->gn);
- if (!dot_f) {
+ /* NOTE(Yiming): When we don't use `dot_f==0` here, it's theoretically possibile that _some_
+ * faces in perspective mode would get erroneously caught in this condition where they really are
+ * legit faces that would produce occlusion, but haven't encountered those yet in my test files.
+ */
+ if (fabs(dot_f) < FLT_EPSILON) {
return false;
}