Page MenuHome

Edges Issue during modeling
Closed, ArchivedPublic


System Information
Linux 64, GTX 560

Blender Version

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:
Here is the model:

Exact steps for others to reproduce the error

  • Go to edit mode
  • Zoom viewport camera



Event Timeline

paul geraskin (mifth) raised the priority of this task from to Needs Triage by Developer.
paul geraskin (mifth) updated the task description. (Show Details)
paul geraskin (mifth) set Type to Bug.
paul geraskin (mifth) updated the task description. (Show Details)

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

Bastien Montagne (mont29) lowered the priority of this task from Needs Triage by Developer to Normal.Apr 24 2015, 2:27 PM

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.

@Antony Riakiotakis (psy-fi) it's annoying for me. Does other 3d packages have such an issue?

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

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

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 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

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

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

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.

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.

@Antony Riakiotakis (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):

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.

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

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

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 T37727 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.

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

About the bug - 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.

paul geraskin (mifth) reopened this task as Open.EditedApr 29 2015, 9:15 AM

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:
The model to test:

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.

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 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.

Brecht Van Lommel (brecht) closed this task as Archived.May 2 2015, 3:47 PM
Brecht Van Lommel (brecht) claimed this task.

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.

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

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

Can this GPU feature by Mike Erwin fix this viewport issue?

Using shaders does not get around the depth offset issue, sorry! The recent work @paul geraskin (mifth) 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.

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.

Just read the nVidia paper @Antony Riakiotakis (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.

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

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:



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

Hi @paul geraskin (mifth), 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?

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:

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.

I guess this is just shader matters for a scene.

Here is a house for testing to you.

As Blender viewport looks really not good now.