The original offset was wrong because it applied a constant to
homogenous coordinates (the actual depth is z/w), which broke
totally if near clip distance was reduced.
A correct depth offset has to take slope into account like
glPolygonOffset in order to avoid dotted lines caused by
interpolation precision variations. When drawing wire lines
however only the slope of the line itself is accessible, so
also generally increase the offset when the object is close.
Fixes T57931 Particle weight edit mode is not supported.
There is a bug that prevent refresh of the toolsettings on which is based
the weight / non-weight display selection (see T58086).
Sometimes the text doesn't fit. What to do in this case?
* Overflow: The default behaviour still is to overflow the text.
* Truncated: If any text box is defined we can also not draw the text
that goes outside the text boxes.
* Scale to Fit: For single-text box texts we can scale down the text until
it fits.
To support textboxes we are bisecting the scale until we find a good
match. Right now the hardcoded iteration limit is 20, and the threshold 0.0001f.
An alternative in the future would be to tackle this by integrating existing
layout engines such as HarfBuzz.
Note: Scale to fit won't work for multiple text-boxes if any of them has
either width or height as zero.
Reviewers: campbellbarton
Differential Revision: https://developer.blender.org/D3874
Feature development sponsored by Viddyoze.
Implement strand selection visualisation but without any shading.
I think this is not the overlay job to draw the strands shaded.
We can already view the children strands shaded for now but we might add
an option to draw the shaded strand instead of (or in addition to) the
guide strand.
In 2.79 hiding works in paint modes with selection enabled,
so it is a missing feature. This implements it in texture
paint overlays and in workbench base shading.
Reviewers: fclem
Differential Revision: https://developer.blender.org/D3989
So far this makes a new pass for image empties that does not write to the depth buffer.
Todo:
- Sort empties using `DRW_pass_sort_shgroup_z`.
- Calculate correct bounding boxes.
- fix bounding box memory leak.
Reviewers: fclem
Differential Revision: https://developer.blender.org/D3922
* Fixes vertices with bad coloring. Now vertices draw with depth write so
they occlude the underlying face geom overlay, avoiding double drawing the
vertex.
* Decrease the z_offset of edges so they don't poke too much through
geometry. Also delete this offset in ortho view.
* Add zoffset to active and selected vertices so they always draw on top
if they overlap a non selected vertex.
* Fix alpha of edge_fix in vertex selection mode
Now that the 3d grid is infinite, antialiased, not occluded, and overlaid
on top of rendered view, being able to decrease its opacity to reduce
visual strain is a must.
Make edge decoration a bit thinner and try to reduce missing edge segment
due to triangle barycentrics.
This invert the "edge fix" strip offset direction, meanning there is now
the possibility that these triangles poke through nearby geometry depending
on the viewport near/far clips distances.
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
2.7x was displaying 2 additional subdivision for theses views. Bumping to 3
just to say we improved it!
Hypothetically it can be increased as much as we want but float precision
can quickly become an issue.
As it turned out the issue wasn't that we were drawing only the active,
but that the "object mode" lattice drawing was drawing on top of the
drawing for all the edit mode lattice objects.
We are doing the same original behaviour for curves and even meshes. To be
investigated if it is ok for those other cases.
First problem is that enabling the "in front" option made the wire object
test against an not updated stencil buffer.
Second problem is that the "in front" option was useless on wire objects.
To fix this we bypass the depth test and live with some sorting problem.
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