Commit Graph

490 Commits

Author SHA1 Message Date
Clément Foucault
2ece296d4f Wireframe Mode: Fix missing wireframe if overlays are disabled 2018-09-21 18:29:25 +02:00
Clément Foucault
d2dba449fe Edit Mesh Mode: Increase Face dot Z bias 2018-09-21 15:45:03 +02:00
Clément Foucault
37fea2c0f0 Edit Mode: Merge Xray and "Limit selection to visible" options behaviour
We now treat Xray as being the mode where Limit selection to visible is off.
If Xray is OFF, Limit selection to visible is considered ON.

To allow 'see through wires' with solid shading (not Xray shading) we still
draw solid shading if Xray is ON with Xray Alpha set to 1.0.
2018-09-21 15:45:03 +02:00
Clément Foucault
3523958de9 DRW: Add back wireframe mode
This is using the existing engine (workbench forward) with 0.0 xray_alpha
and forcing wireframes on all objects.

There is no workflow/shortcut changes in this commit.
2018-09-21 15:45:03 +02:00
mano-wii
5c20161f81 Fix compilation error in the stick bones shader for some Intel gpus. 2018-09-20 12:11:23 -03:00
Brecht Van Lommel
6b433f4eb3 Merge branch 'master' into blender2.8 2018-09-19 18:20:50 +02:00
Clément Foucault
424aeda112 Object Mode: Draw object center after the floorgrid 2018-09-14 18:32:04 +02:00
Clément Foucault
b62d140be9 Object Mode: Make Flat object outline visible in orthographic view 2018-09-14 18:32:04 +02:00
Clément Foucault
5a134910b1 Fix T56705: Z axis do not displays in side views 2018-09-06 15:00:44 +02:00
Clément Foucault
b2d82d096a Fix T56706: Lattice crash when enter in edit mode 2018-09-06 15:00:44 +02:00
Campbell Barton
fa6ed6259c Cleanup: style 2018-09-06 10:47:46 +10:00
Clément Foucault
f2a166b227 Fix T56657: Crash when creating a collection instance containing probes 2018-09-05 19:32:12 +02:00
Clément Foucault
41997d171b Edit Mesh: Add back the option to not highlight selected faces/edges
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.
2018-09-05 19:00:13 +02:00
Clément Foucault
b3aa0cfe75 Cleanup: Remove unnecessary uniform 2018-09-05 19:00:13 +02:00
Clément Foucault
457df4fa9b Edit Mesh: Add support for draw option parameters
The visuals was already implemented but we could not toggle them off.
2018-09-05 19:00:13 +02:00
Clément Foucault
c05b9bbcc0 Fix T56692: The edges are not highlighted in Mark Freestyle Edge
This was not ported yet.
2018-09-05 19:00:12 +02:00
Campbell Barton
e1a4d58ecc Cleanup: style 2018-09-05 08:54:11 +10:00
Clément Foucault
30ae0ce0e1 Xray: Add possibility to select wires in priority before surfaces
If no wires were found, try to select surfaces in a second loop.
2018-09-04 17:15:00 +02:00
Dalai Felinto
27c954386b Weightpaint mode: Removing barbarian batch tagging on engine init
This was introduced in the original implementation of weightpaint
in 2.8 (20f95de6ba). But this is very shortsighted, we can't assume only one
object will be edited at once, nor should we tag things during drawing.

There is a chance this introduces "bugs". If it does, we then tackle them in the
proper way (usually tagging DEG after operators changing the weight paint data).
2018-09-03 11:17:53 -03:00
Campbell Barton
ae57383648 Cleanup: comment blocks 2018-09-02 18:28:27 +10:00
Dalai Felinto
6c87958dac Fix Text Boxes not drawing
I'm using a different shading group for the active text box and the others.
This way I can assign different colors to them.

The alternative would be to create a new `shgroup_dynlines_dashed_flat_color`,
but I find this overkill for such a simple use case.
2018-08-31 09:53:44 -03:00
Campbell Barton
e74d7d6f81 3D View: option to always show center in face mode
This matches 2.7x behavior
2018-08-30 16:21:03 +10:00
Campbell Barton
7dd24ba6e8 3D View: use thicker edges when in edge-mode
Without this there is no visual differentiation between face/edge mode.
2018-08-30 15:54:23 +10:00
Campbell Barton
46fc3f39c5 Weight Paint: use black for unselected vertices
Contrast for selected vertices mode wasn't very strong.
2018-08-29 12:22:33 +10:00
Clément Foucault
0ba3a1a686 Sculpt: Optimize Mask Overlay drawing
* 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
2018-08-24 16:46:59 +02:00
Pablo Vazquez
19fe267823 Hide Grease Pencil ornaments if overlay setting is disabled 2018-08-23 22:48:05 +02:00
Clément Foucault
fb7fc3be19 Wireframe: Add support for sculpt mode
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.
2018-08-23 22:29:45 +02:00
Dalai Felinto
613523d5f5 Rename: *_batch_cache_dirty > *_batch_cache_dirty_tag 2018-08-23 10:20:16 -03:00
Clément Foucault
f894db794f 3D Grid: Fix grid not showing in camera view 2018-08-23 13:56:39 +02:00
Clément Foucault
745123024d 3D Grid: Fix axes color blending 2018-08-23 13:56:39 +02:00
Clément Foucault
55f122264c 3D Grid: Fix grid passing through objects too much
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.
2018-08-23 13:56:39 +02:00
Clément Foucault
890623f886 Object Mode: Add back spot cone display 2018-08-22 19:49:32 +02:00
Clément Foucault
f4f97d1c7f Overlay: Fix wrong framebuffer bound. 2018-08-22 15:23:03 +02:00
Clément Foucault
fdce78c936 Armature: Fix outline jitter in orthographic mode 2018-08-22 13:51:03 +02:00
Clément Foucault
4d09129ffb Fix T56470: unfreed shader in edit mode 2018-08-22 13:51:02 +02:00
Campbell Barton
7eaf00bfb0 Cleanup: style 2018-08-22 10:10:12 +10:00
Dalai Felinto
53dfb4895c Fix relationship lines selectable 2018-08-20 14:20:25 -03:00
Dalai Felinto
bfdaa9a979 Object constraint lines viewport drawing
The core logic of this implementation comes from the drawobject.c from 2.7x.
I'm using `ts.colorGridAxisZ` for its color because of the legacy code:

```
UI_GetThemeColor3ubv(TH_GRID, col1);
UI_make_axis_color(col1, col2, 'Z');
glColor3ubv(col2);
```

There is nothing stopping us from adding this to the theme though, as it should
have been the case to start with.
2018-08-20 14:07:40 -03:00
Clément Foucault
47d43c5a00 Bone Display: fix flickering issue with BBones in ortho view 2018-08-20 15:47:22 +02:00
Clément Foucault
31a1c2b7d2 Object Mode: Add back support for the object "Maximum draw type" option 2018-08-20 13:19:17 +02:00
Clément Foucault
52d75d5127 Overlay: Add support for per object wirefram options
This patch has a known bug on AMD + mesa because of the drivers. I will
send a bug report to mesa.
2018-08-20 10:46:11 +02:00
Clément Foucault
f031e8d3ac Object Mode: Add back the extra object axes drawing option 2018-08-17 13:04:26 +02:00
Clément Foucault
435f308eed Object Mode: Use same empty (arrow) drawing as the bone axes display 2018-08-17 13:04:26 +02:00
Clément Foucault
77e1942e0e Armature: Add ghosting support (old x-ray) 2018-08-16 23:58:29 +02:00
Clément Foucault
4711e0ee26 Non-Meshes: Add ghosting support (old x-ray) 2018-08-16 23:58:29 +02:00
Clément Foucault
7d29c9a16b Overlay: Fix crash when ghosting is enabled without wireframe 2018-08-16 23:58:29 +02:00
Clément Foucault
a01dec2d9c Cleanup: Remove unused uniform and UBO. 2018-08-16 23:58:24 +02:00
Clément Foucault
c761153f64 Overlays: Support for wireframes and edit mode overlay on xray objects 2018-08-16 23:57:59 +02:00
Dalai Felinto
461b3c817e Camera Reconstruction: Camera Path
The only difference from 2.7x is that we were using glLineWidth(2.0) before,
which is not supported reliably in the latest OpenGL.

Big thanks to Clément Foucault for helping with this, on the design as well as
debugging the implementation.

For the records, I'm creating and destroying batches for the path geometry at
every draw. The pipeline is as follows:

 1. Create GPUBatch with all the points
 2. Create new shgroup with simple shader
 3. Add call with the gpubatch
 4. Save it in a linked list in stl->g_data
 5. Free it after all drawing is done
2018-08-15 19:26:05 -03:00
Dalai Felinto
248c049b70 Camera Reconstruction: Draw solid spheres
If in SOLID "mode", and x-ray, draw the empty spheres still.
2018-08-15 19:25:53 -03:00