NOTE: There is a float imprecision near the focus plane
due to the current technique used for DOF. This makes the alpha channel
transparent on nearly in focus objects even when they should not.
This artifact should be fixed when the DOF will use scatter as gather for
low brightness areas.
Fix T57042 : Eevee does not render alpha when DOF is turned on
On my test it's 30% faster than before.
Test case : Suzanne, subsurf lvl3, 64K tris, Edge select mode for fair
comparison.
0.95ms before optimization
0.64ms after optimization
Note that this only optimize the "nicest" display of edit mesh overlays,
not the one when rotating the view where half of the border edges are
missing.
... display vertex even when occluded.
Add back the vertex display because occluded vertex are not visible when
the triangle is almost parallel to the view.
The problem with the barycentric coord is that they are hard to work with
and their derivatives not enough precise to compute the vertex positions.
So we need to pass the vertices scree positions down to the fragment shader.
This decouple the vertex display from the face+edges.
This is to reduce the number of triangles required to fix the edges
artifacts (aliasing) and increase viewport reactivity when not actively
navigating (ie. mouse scroll).
Also it makes all vertices visible (not cut-off) even when navigating.
However it makes the navigation drawing a bit slower because it has to
render twice.
Also add a depth bias to the wires to avoid depth fighting when previewing
final mesh (modifiers applied).
This makes is easy to create nested drawcalls that will inherit all the
parents properties. This is usefull if only a few uniforms changes for that
drawcall.
Encountered on Nvidia + Linux, it seems that doing everything all at once
can make the driver give up the whole command list and return nothing as
the output of the render.