Support for showing images in background/foreground and only in perspective/orthographic view.
Internally the depth of the image is modified in the fragment shader by setting `gl_FragDepth` explicitly.
The UI still needs some work to improve usability, see D3863 for details.
Currently there is one duplicated function, not sure how to best deduplicate it yet. (`is_image_empty_visible`)
Reviewer: fclem, brecht, campbellbarton
Differential Revision: https://developer.blender.org/D3863
This brings a big difference to meshes with edit cage adjusted for modifiers.
In my tests, the suzanne with subdivision modifier level 3 went from 4.80ms to 3.05ms.
By the tests I could only observe a considerable difference in the peformanse when the vertex size is 30.
Vertice 3 showed no difference in a suzzane with subdivision modifier level 3 + show-on-cage.
Point Size 30: 7.29ms vs 2.55ms
Reviewers: fclem
Reviewed By: fclem
Differential Revision: https://developer.blender.org/D3805
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).
Add an option to display contour lines tracing through points with the
same interpolated weight value in weight paint mode. This can be useful
for working on gentle gradients over a relatively high resolution mesh,
where the difference in color between adjacent vertices is very small.
The contour grid has 3 levels of detail going down to step 0.001,
which automatically fade in or out based on the weight gradient.
Fade out works by capping both screen space and weight space line
width, and reducing alpha when the screen space width becomes too
small for moire and noise-less rendering.
Reviewers: fclem
Differential Revision: https://developer.blender.org/D3749
Move the weight paint drawing to the fragment shader. The shader
uses a texture that uses the U.coba_weight custom color band, or
an internal color band.
In addition to actual weights, the shader has to display two
alert colors: missing vertex group, and zero weight. The zero
weight alert has to be blended with regular weight colors,
so that a single alert vertex surrounded by weighted ones is
still visible.
Reviewers: campbellbarton, fclem
Differential Revision: https://developer.blender.org/D3675
Now handles are drawn using index buffer instead of duplicating memory
requirement.
Also make use of shader tricks to draw handles antialiased, and respond to
UI scalling.
Make vertex point match edit mesh vertex size.
Do note that we force showing the face dot if we are in face select mode
but faces and edges overlays are disable to not loose the selected faces
entirely.
* Remove support for diffuse color in the pbvh buffers.
* Upload raw data to GPU.
* Only draw nodes that have mask data when drawing the overlay.
This should fix T56466
Now wireframe does update in sculpt mode using the sculpt mesh VBOs.
The only thing that does not work is simplified wireframe (the wireframe
slider) when the mesh is shaded flat. In this case all edges are shown.
For this we need to add a bias depending on the viewing angle.
But increasing the hardness of the test make float precision issues in
the mesh transformation more prominent (actual geometry is far below the
surface). So to solve this issue we use a more subdivided grid mesh
8x8 quads instead of 1 triangle.