Grease Pencil Line Art trouble with edges in Shifted Cameras in orthographic views #95984

Closed
opened 2022-02-23 09:16:02 +01:00 by Mauro Amoruso · 15 comments

Grease Pencil Line Art trouble with edges in Shifted Cameras in orthographic views

System Information
Operating system: Ubuntu 20.04.3 LTS
Graphics card: NVIDIA Corporation GK208BM [GeForce 920M] / Mesa Intel® HD Graphics 5500 (BDW GT2)

Blender Version
version: blender-3.1.0-beta+v31.517afcc858b0-linux.x86_64-release

Short description of error

Grease pencil Line art modifier seems to have some trouble generating strokes for orthographic shifted cameras
The problem seems related to the edges in an orthographic projection and disappear when the camera is not shifted (set to default value 0)

Exact steps for others to reproduce the error

- In the default scene select the camera, change its type to Orthographic and shift the camera in any value.
- Create a Grease pencil Object Line art with the default Collection 
- strokes appears distorted or out of place

Before.png

after.png

Line_art_issues_with_shifted_orthographic_camera.blend

Thanks

**Grease Pencil Line Art trouble with edges in Shifted Cameras in orthographic views** **System Information** Operating system: Ubuntu 20.04.3 LTS Graphics card: NVIDIA Corporation GK208BM [GeForce 920M] / Mesa Intel® HD Graphics 5500 (BDW GT2) **Blender Version** version: blender-3.1.0-beta+v31.517afcc858b0-linux.x86_64-release **Short description of error** Grease pencil Line art modifier seems to have some trouble generating strokes for orthographic **shifted** cameras The problem seems related to the edges in an orthographic projection and disappear when the camera is not shifted (set to default value 0) **Exact steps for others to reproduce the error** - In the default scene select the camera, change its type to Orthographic and shift the camera in any value. - Create a Grease pencil Object Line art with the default Collection - strokes appears distorted or out of place ![Before.png](https://archive.blender.org/developer/F12883779/Before.png) ![after.png](https://archive.blender.org/developer/F12883781/after.png) [Line_art_issues_with_shifted_orthographic_camera.blend](https://archive.blender.org/developer/F12883783/Line_art_issues_with_shifted_orthographic_camera.blend) Thanks
YimingWu was assigned by Mauro Amoruso 2022-02-23 09:16:02 +01:00
Author
Added subscribers: @Mauro_Amoruso, @MarcoFerrara, @lichtwerk, @ChengduLittleA
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Author

If the operator is implemented in Python, and someone can show me where is the implementation of this feature. I can give a try.

If the operator is implemented in Python, and someone can show me where is the implementation of this feature. I can give a try.
Member

Thanks for the report. I'll take care of it. In the mean time could you try temp-lineart-contained branch and use the "ortho tolerance" option, see if it's any better? The camera projection is handled a little differently than master. I could port that option to master as a fix if it helps...

@Mauro_Amoruso It's in C, lineart_cpu.c.

Thanks for the report. I'll take care of it. In the mean time could you try `temp-lineart-contained` branch and use the "ortho tolerance" option, see if it's any better? The camera projection is handled a little differently than `master`. I could port that option to `master` as a fix if it helps... @Mauro_Amoruso It's in C, `lineart_cpu.c`.
Author

@ChengduLittleA Thanks for your amazing work on this project, it really helps us all.

I have tried the same file with blender-3.1.0-alpha+temp-lineart-contained-linux.x86_64-release
it has different version of the same issues, and even when the Shift camera is 0 the problem appears (with or without ortho)

without Shifted camera with or without "ortho tolerance" (works in master 3.2 Beta)
alpha_issues.png

with Shifted camera without "ortho tolerance"
3.1Apha_build.png

with Shifted camera and with "ortho tolerance"
withorto.png

I tried play with Range or other stuff and it is not getting better even after regenerating the line art or creating a new cameras

@ChengduLittleA Thanks for your **amazing work** on this project, it really helps us all. I have tried the same file with blender-3.1.0-alpha+temp-lineart-contained-linux.x86_64-release it has different version of the same issues, and even when the Shift camera is 0 the problem appears (with or without ortho) without Shifted camera with or without "ortho tolerance" (works in master 3.2 Beta) ![alpha_issues.png](https://archive.blender.org/developer/F12885291/alpha_issues.png) with Shifted camera without "ortho tolerance" ![3.1Apha_build.png](https://archive.blender.org/developer/F12885271/3.1Apha_build.png) with Shifted camera and with "ortho tolerance" ![withorto.png](https://archive.blender.org/developer/F12885277/withorto.png) I tried play with Range or other stuff and it is not getting better even after regenerating the line art or creating a new cameras
Member

EHHHH why is it broken even more.... I'll clear it out tomorrow.

EHHHH why is it broken even more.... I'll clear it out tomorrow.
Member

图片.png

Turns out some of the problem in temp-lineart-contained is caused by the back face culling bug that's already fixed in master. Without shifting stuff is working correctly.

However shifting gives me very weird result which doesn't really reflect how line art work. I need to investigate more

![图片.png](https://archive.blender.org/developer/F12886270/图片.png) Turns out some of the problem in `temp-lineart-contained` is caused by the back face culling bug that's already fixed in master. Without shifting stuff is working correctly. However shifting gives me very weird result which doesn't really reflect how line art work. I need to investigate more

This issue was referenced by e7cae51877

This issue was referenced by e7cae5187773f41e62830be597c6f598bff0653f

This issue was referenced by 60af7a3496

This issue was referenced by 60af7a349614f9ebe88ebb71f4c8fad14a0e274f
Member

Alright, this is fixed now. It's the inconsistent geometry shifting that's causing the problem.

Alright, this is fixed now. It's the inconsistent geometry shifting that's causing the problem.
Member

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Author

Wow so fast!

{meme, src=itsawesome}

. thanks, btw I saw the issue in the main lineart_main_perspective_division function and how the W values are actually looped instead of the Z, ones the patch is pushed I am going to test my "real" blend files.

Wow so fast! {meme, src=itsawesome} . thanks, btw I saw the issue in the main `lineart_main_perspective_division` function and how the W values are actually looped instead of the Z, ones the patch is pushed I am going to test my "real" blend files.
Member

@Mauro_Amoruso The division is supposed to do xyz/w (z is non linear there), w is the linear distance to camera plane, thus div by w would give linear perspective effect.

Also you can already build it or wait for 3.1/3.2 daily build or lineart branch

@Mauro_Amoruso The division is supposed to do `xyz/w` (z is non linear there), `w` is the linear distance to camera plane, thus div by w would give linear perspective effect. Also you can already build it or wait for 3.1/3.2 daily build or lineart branch
Author

@ChengduLittleA thanks for helping me understand the code! I wanted just to confirm that I checked the my most complex .blend files with new built and it is beautifully consistent even when using occlusion feature.

@ChengduLittleA thanks for helping me understand the code! I wanted just to confirm that I checked the my most complex .blend files with new built and it is beautifully consistent even when using `occlusion` feature.
Member

@Mauro_Amoruso That's good to hear :)

@Mauro_Amoruso That's good to hear :)
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser Project (Legacy)
Interest
Asset System
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
4 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#95984
No description provided.