Edges Issue during modeling #44505

Closed
opened 2015-04-24 11:28:42 +02:00 by paul geraskin · 44 comments
Member

System Information
Linux 64, GTX 560

Blender Version
2.74

Short description of error
I found that edges are seen through other objects. Even if other parts have distance from other parts. Is it possible to fix? It happens only during modeling which makes a bit problematic work.

I don't know how it's going in other 3d packages. But if it's possible to fix - it would be great!

Here is my video test: https://youtu.be/j5RgQyTVxGo
Here is the model: temp2.blend

Exact steps for others to reproduce the error

  • Go to edit mode
  • Zoom viewport camera
**System Information** Linux 64, GTX 560 **Blender Version** 2.74 **Short description of error** I found that edges are seen through other objects. Even if other parts have distance from other parts. Is it possible to fix? It happens only during modeling which makes a bit problematic work. I don't know how it's going in other 3d packages. But if it's possible to fix - it would be great! Here is my video test: https://youtu.be/j5RgQyTVxGo Here is the model: [temp2.blend](https://archive.blender.org/developer/F166470/temp2.blend) **Exact steps for others to reproduce the error** - Go to edit mode - Zoom viewport camera
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'
Author
Member

Added subscriber: @PaulGeraskin

Added subscriber: @PaulGeraskin
Antonis Ryakiotakis was assigned by Bastien Montagne 2015-04-24 14:27:12 +02:00

Added subscriber: @mont29

Added subscriber: @mont29

This looks like a float precision issue, Antony, minds having a look?

This looks like a float precision issue, Antony, minds having a look?

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'

We can't alleviate it completely. The problem is that we give wires a little offset in depth so they can appear in front of their respective solid shaded counterparts. This just means their depth value is slightly lower than what you would expect. We can just decrease that offset slightly but given that the depth buffer loses precision the further away we are from the camera (such as in this report), this won't be fixable for the general case. Also I'm worried that we might get cases where the wires overlap with the original mesh which is not so nice either.

Long story short, it's not completely fixable and it's not too annoying, so we can live with it.

We can't alleviate it completely. The problem is that we give wires a little offset in depth so they can appear in front of their respective solid shaded counterparts. This just means their depth value is slightly lower than what you would expect. We can just decrease that offset slightly but given that the depth buffer loses precision the further away we are from the camera (such as in this report), this won't be fixable for the general case. Also I'm worried that we might get cases where the wires overlap with the original mesh which is not so nice either. Long story short, it's not completely fixable and it's not too annoying, so we can live with it.
Author
Member

Added subscriber: @Psy-Fi

Added subscriber: @Psy-Fi
Author
Member

@Psy-Fi it's annoying for me. Does other 3d packages have such an issue?

@Psy-Fi it's annoying for me. Does other 3d packages have such an issue?
Author
Member

Ok, i found Modo and houdini on my machine.
Here is video comparison of the same model (look in HD to see better) : http://youtu.be/wzdKltQ2208

As you can seee only blender has such an issue. So do you think it's still not fixable?
This thing will make blender more pro.

Ok, i found Modo and houdini on my machine. Here is video comparison of the same model (look in HD to see better) : http://youtu.be/wzdKltQ2208 As you can seee only blender has such an issue. So do you think it's still not fixable? This thing will make blender more pro.

If they don't it's because they use a different approach at drawing wires, such as this http://developer.download.nvidia.com/SDK/10/direct3d/Source/SolidWireframe/Doc/SolidWireframe.pdf

You'll notice that the technique uses shaders - even worse, geometry shaders- which we don't use yet for general display. The viewport project is supposed to add shaders everywhere to mesh drawing but until then you'll have to bear it I'm afraid.

I checked the code to see if the offset is avoidable but if we don't have it the mesh and wire overlap quite badly, so I really don't think it's possible to turn off.

If they don't it's because they use a different approach at drawing wires, such as this http://developer.download.nvidia.com/SDK/10/direct3d/Source/SolidWireframe/Doc/SolidWireframe.pdf You'll notice that the technique uses shaders - even worse, geometry shaders- which we don't use yet for general display. The viewport project is supposed to add shaders everywhere to mesh drawing but until then you'll have to bear it I'm afraid. I checked the code to see if the offset is avoidable but if we don't have it the mesh and wire overlap quite badly, so I really don't think it's possible to turn off.
Author
Member

If we leave it as it's now it will be worse too.

Could you add it at improvements for nearest future? As this the most important thing for modeling. I'm talking about hipolygonal detailed modeling for sure.

I mean such modeling http://www.render.ru/images/uploads/Image/Articles/Medic/image26.jpg

It's pretty difficult to make with such an issue.

If we leave it as it's now it will be worse too. Could you add it at improvements for nearest future? As this the most important thing for modeling. I'm talking about hipolygonal detailed modeling for sure. I mean such modeling http://www.render.ru/images/uploads/Image/Articles/Medic/image26.jpg It's pretty difficult to make with such an issue.

Changed status from 'Archived' to: 'Open'

Changed status from 'Archived' to: 'Open'

Ok, this should be fixable, looks like we give too much offset indeed

Ok, this should be fixable, looks like we give too much offset indeed
Author
Member

Super!

Super!

So, I tried to alleviate this and it should be better - but not completely fixed- for your file. To fix completely it needs shader support or use polygons for wireframe drawing - possible, but will make drawing more expensive. So I will leave this for later, probably we will end up having some sort of wireframe shader available anyway.

So, I tried to alleviate this and it should be better - but not completely fixed- for your file. To fix completely it needs shader support or use polygons for wireframe drawing - possible, but will make drawing more expensive. So I will leave this for later, probably we will end up having some sort of wireframe shader available anyway.

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Author
Member

Thank you.

I hope we will have shader based edges to get PRO quality of the viewport in edit mode. GPU is pretty good nowadays.

Thank you. I hope we will have shader based edges to get PRO quality of the viewport in edit mode. GPU is pretty good nowadays.
Author
Member

@Psy-Fi Looking at your commit - you fixed only Perspective viewport.
But Orthographic viewport had no changes in your commit.

Orthographic view looks even more ugly.
Here is screenshot of the model (I just pressed 5 key):
cache0.png

It's really difficult to model in Ortho. Is it possible to fix ortho too?
Or set the priority of Shader Edges To high?

I'm really sorry. But we really need super pro modeling viewport. As now 2015 year. Not 203. :) Well, you understand me.

@Psy-Fi Looking at your commit - you fixed only Perspective viewport. But Orthographic viewport had no changes in your commit. Orthographic view looks even more ugly. Here is screenshot of the model (I just pressed 5 key): ![cache0.png](https://archive.blender.org/developer/F167686/cache0.png) It's really difficult to model in Ortho. Is it possible to fix ortho too? Or set the priority of Shader Edges To high? I'm really sorry. But we really need super pro modeling viewport. As now 2015 year. Not 203. :) Well, you understand me.
Author
Member

I also can provide about 5 other models for testing. I have this issue almost every time.
If you want.

I also can provide about 5 other models for testing. I have this issue almost every time. If you want.
Author
Member

Here is just another comparison Blender and Houdini.
File (just switch to ortho and perspective) temp2.blend

cache0.png

cache1.png

I can also add more models with such an issue.

Here is just another comparison Blender and Houdini. File (just switch to ortho and perspective) [temp2.blend](https://archive.blender.org/developer/F167694/temp2.blend) ![cache0.png](https://archive.blender.org/developer/F167691/cache0.png) ![cache1.png](https://archive.blender.org/developer/F167690/cache1.png) I can also add more models with such an issue.

You do realize that sensationalist statements like that or comparisons to Houdini are not going to make this happen faster if the algorithm we use can't support this with an easy patch, right?

This is truly unfixable for the general case. I found an older bug report of yours here #37727 with camera objects and making this work for ortho view breaks the use case from within ortho cameras (it's "fixable" if you increase the far clip value).

I'm going to commit this anyway since I think that working outside a camera is more important and that's it.

You do realize that sensationalist statements like that or comparisons to Houdini are not going to make this happen faster if the algorithm we use can't support this with an easy patch, right? This is truly unfixable for the general case. I found an older bug report of yours here #37727 with camera objects and making this work for ortho view breaks the use case from within ortho cameras (it's "fixable" if you increase the far clip value). I'm going to commit this anyway since I think that working outside a camera is more important and that's it.
Author
Member

I just point the issue. Sorry if i do it wrong somehow.

About the bug https://developer.blender.org/T37727 - it was the issue for entire mesh drawing. Not for close parts.
Now only close parts of mesh have the issue.

To fix the issue i need to DECREASE the distance clipping. As your formula has multiplication for ortho. "offs = 0.0001f * dist;" - The more distance the more offset. Posibly you need to divide it?

Another idea for fast fix:
Can you add this offset as a parameter in UserPreferences. So that we could tweak it manually and find the best value for our own cases?
But of course the shader would be better.

I just point the issue. Sorry if i do it wrong somehow. About the bug https://developer.blender.org/T37727 - it was the issue for entire mesh drawing. Not for close parts. Now only close parts of mesh have the issue. To fix the issue i need to DECREASE the distance clipping. As your formula has multiplication for ortho. "offs = 0.0001f * dist;" - The more distance the more offset. Posibly you need to divide it? Another idea for fast fix: Can you add this offset as a parameter in UserPreferences. So that we could tweak it manually and find the best value for our own cases? But of course the shader would be better.
Author
Member

Changed status from 'Resolved' to: 'Open'

Changed status from 'Resolved' to: 'Open'
Author
Member

Hi guys.

I saw your commits to Ortho. I downloaded latest build from "Wed Apr 29 03:13:44 2015". Ortho has become worse. It was better before your commits for Ortho. Could you have a look at Ortho formula again?

Here is my test: http://youtu.be/mlEMsaQtfwE
The model to test: https://developer.blender.org/F167694

I'm a bit picky, but belive me this is very important for modeling.
Perspective is fixed. Only Ortho is left.
I reopen the task if you don't mind.

Hi guys. I saw your commits to Ortho. I downloaded latest build from "Wed Apr 29 03:13:44 2015". Ortho has become worse. It was better before your commits for Ortho. Could you have a look at Ortho formula again? Here is my test: http://youtu.be/mlEMsaQtfwE The model to test: https://developer.blender.org/F167694 I'm a bit picky, but belive me this is very important for modeling. Perspective is fixed. Only Ortho is left. I reopen the task if you don't mind.
Antonis Ryakiotakis removed their assignment 2015-04-29 10:05:06 +02:00

yes, looks like it makes things worse. I am going to revert the ortho part but I'm personally not touching this anymore, if anyone else wants to try be my guest.

yes, looks like it makes things worse. I am going to revert the ortho part but I'm personally not touching this anymore, if anyone else wants to try be my guest.
Author
Member

Yes no probem.
Thank you a lot for Perspective fix. And for the attempt to fix the Ortho.

I'll try to compile blender these weekends and try some experiments.

Yes no probem. Thank you a lot for Perspective fix. And for the attempt to fix the Ortho. I'll try to compile blender these weekends and try some experiments.

Reverted the perspective fix, causes cases such as loopcuts on cube to have z fighting artifacts.

Reverted the perspective fix, causes cases such as loopcuts on cube to have z fighting artifacts.

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Brecht Van Lommel self-assigned this 2015-05-02 15:47:23 +02:00

I suggest closing this, this issue is as old as Blender and I doubt other 3D software does much better here (the Houdini screenshots clearly show perspective instead of orthographic views).

If someone wants to investigate ways to improve Z buffer precision and submit that as a patch then that's fine, but I don't see a good reason to keep this open as a bug.

I suggest closing this, this issue is as old as Blender and I doubt other 3D software does much better here (the Houdini screenshots clearly show perspective instead of orthographic views). If someone wants to investigate ways to improve Z buffer precision and submit that as a patch then that's fine, but I don't see a good reason to keep this open as a bug.
Author
Member

In houdini as in other 3d packages all looks good. In perspective and orthographic views.

Here is the test again. Left - ortho, Right - Perspective:
cache1.png

cache0.png

In houdini as in other 3d packages all looks good. In perspective and orthographic views. Here is the test again. Left - ortho, Right - Perspective: ![cache1.png](https://archive.blender.org/developer/F169419/cache1.png) ![cache0.png](https://archive.blender.org/developer/F169420/cache0.png)
Author
Member

Can this GPU feature by Mike Erwin fix this viewport issue? https://plus.google.com/u/0/114974350337816613813/posts/dmLUF5Sn25v

Can this GPU feature by Mike Erwin fix this viewport issue? https://plus.google.com/u/0/114974350337816613813/posts/dmLUF5Sn25v
Member

Added subscriber: @MikeErwin

Added subscriber: @MikeErwin
Member

Using shaders does not get around the depth offset issue, sorry! The recent work @PaulGeraskin linked to is wireframe only, which is easier to get right than wires overlaid on the surface. I'm very interested in drawing quality issues though and will keep yours in mind when working on the viewport.

Using shaders does not get around the depth offset issue, sorry! The recent work @PaulGeraskin linked to is wireframe only, which is easier to get right than wires overlaid on the surface. I'm very interested in drawing quality issues though and will keep yours in mind when working on the viewport.

You could modify the depth coordinate but this will have performance implications (no early depth test). Generally fixing this will have some extra cost for sure.

You could modify the depth coordinate but this will have performance implications (no early depth test). Generally fixing this will have some extra cost for sure.
Author
Member

We could have 2 edges drawing approaches. And we could switch them in settings.
For good graphics cards could GPU approach be ok? In this way we can have Pro quality edges.

We could have 2 edges drawing approaches. And we could switch them in settings. For good graphics cards could GPU approach be ok? In this way we can have Pro quality edges.
Member

Just read the nVidia paper @Psy-Fi posted, agree that there's hope for the future and mild suffering for now. Unless that technique can be adapted for vertex + fragment shaders only... Will think about it and get back to you.

Just read the nVidia paper @Psy-Fi posted, agree that there's hope for the future and mild suffering for now. Unless that technique can be adapted for vertex + fragment shaders only... Will think about it and get back to you.
Author
Member

Could you reopen the issue for a while?
As it's cloased now.

Could you reopen the issue for a while? As it's cloased now.
Author
Member

Another thing why is important to improve edges and add shader based support is Retopology.
For retopology modeling we need hide edges of backside faces.

Here is example:
File: temp.blend

Image:
cache0.png

Another thing why is important to improve edges and add shader based support is Retopology. For retopology modeling we need hide edges of backside faces. Here is example: File: [temp.blend](https://archive.blender.org/developer/F181373/temp.blend) Image: ![cache0.png](https://archive.blender.org/developer/F181374/cache0.png)
Brecht Van Lommel was unassigned by Mike Erwin 2016-10-26 10:46:07 +02:00
Mike Erwin self-assigned this 2016-10-26 10:46:07 +02:00
Author
Member

Hi,

Is this task closed or it's in development now?

Hi, Is this task closed or it's in development now?
Member

Hi @PaulGeraskin, it's in development for Blender 2.8. No way to fix this for 2.7x

Do you mind if I use one of the files you attached to publicly demo the problem?

Hi @PaulGeraskin, it's in development for Blender 2.8. No way to fix this for 2.7x Do you mind if I use one of the files you attached to publicly demo the problem?
Author
Member

It's good to hear that it's in development! No problem, use any files.

I just want to mention that in Modo and Houdini (and possibly Maya) it's possible to see all edge even in Object Mode. Not only in Edit mode during modeling. It helps to see all the scene with edges.

Here is an example:
Selection_011.png
Selection_010.png

I just switched to edges support in viewport and all my objects are seen with edges. Or I can press Shift+W and edges will be toggled.
It's very very useful. Could you add it to Blender 2.8 too? To see edges for all objects in Object Mode.

Thanks a lot.

It's good to hear that it's in development! No problem, use any files. I just want to mention that in Modo and Houdini (and possibly Maya) it's possible to see all edge even in Object Mode. Not only in Edit mode during modeling. It helps to see all the scene with edges. Here is an example: ![Selection_011.png](https://archive.blender.org/developer/F386741/Selection_011.png) ![Selection_010.png](https://archive.blender.org/developer/F386743/Selection_010.png) I just switched to edges support in viewport and all my objects are seen with edges. Or I can press Shift+W and edges will be toggled. It's very very useful. Could you add it to Blender 2.8 too? To see edges for all objects in Object Mode. Thanks a lot.
Author
Member

I guess this is just shader matters for a scene.

I guess this is just shader matters for a scene.
Author
Member

temp_house.blend

Here is a house for testing to you.

[temp_house.blend](https://archive.blender.org/developer/F386747/temp_house.blend) Here is a house for testing to you.
Author
Member

As Blender viewport looks really not good now.
Selection_012.png

As Blender viewport looks really not good now. ![Selection_012.png](https://archive.blender.org/developer/F386748/Selection_012.png)
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
5 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#44505
No description provided.