Commit Graph

65 Commits

Author SHA1 Message Date
dc3b5024be Cleanup: add BEGIN/END to GPL headers 2019-01-23 11:32:43 +11:00
7f40d553f9 Cleanp: use single global for draw manager
Add 'G_draw' for all draw manager globals,
avoids adding extern to each file.

Connection between `ts` and `globals_ubo` wasn't obvious,
now called `G_draw.block` & `G_draw.block_ubo`.
2019-01-22 12:09:27 +11:00
14adca06e4 Cleanup: use DRW_shader_create_from_arrays
Avoids messy conditional defines and inline lib allocation.
2019-01-22 11:09:17 +11:00
8beab3e339 Cleanup: remove redundant '_sh' suffix, add '_shgrp' 2019-01-22 08:31:07 +11:00
3d9bee2db1 Cleanup: rename shader containers
These only contain shaders, so name Shaders instead of ShaderData.
2019-01-22 08:26:43 +11:00
9bc47ed0f6 Fix clipping shaders with some AMD/Intel drivers
Caused:
    error: unsized array index must be constant

Use hard coded number of clipping planes, copying the 4th to 5 & 6
when only 4 are used.
2019-01-21 23:55:53 +11:00
78d2abd9c1 DRW: Support wire overlay clipping 2019-01-21 19:08:42 +11:00
2d98dce7ee Cleanup: rename BASE_FROMDUPLI -> BASE_FROM_DUPLI
Matches `BASE_FROM_SET`.
2019-01-15 23:30:31 +11:00
9327013796 3D View: use faded wire for set-scene objects
Matches 2.7x behavior.
2019-01-11 15:02:52 +11:00
ee6e02ccf3 3D View: use dupli wire color for shaded wire drawing
Was only working for loose wire.
2019-01-11 15:02:21 +11:00
670b2944f4 Cleanup: indentation (right shift) 2019-01-04 19:08:09 +11:00
b655bf6363 Wireframe Overlay: Make use of colorTransform when transforming an object 2018-12-18 22:17:53 +01:00
99fb654ffd DRW: Cleanup / Renaming of mesh batch cache functions
THis is in order to avoid the jungle of names being different at each
step of the API.

Also removes some unused functions.
2018-12-18 20:51:52 +01:00
45e1d4d9ac DRW: Fix flat object not being selectable in wireframe view
The problem was double. They were not selectable in wireframe view and
they would not display with the right color, thus always appearing
un-selected.
2018-12-18 20:51:52 +01:00
e4b3fe4b69 Wireframe: Fix wireframe color in edit mode for surfaces 2018-12-14 16:17:29 +01:00
0ee0f0ebf6 Wireframe: Fix Object Viewport display "all edges" options not working 2018-12-14 16:17:29 +01:00
64bca2e648 Fix T58950: wireframe/orthographic/front/side/topview crash 2.8 2018-12-08 11:32:58 +01:00
e929cad706 DRW: Rework wireframe overlay implementation
The shader is way simpler and run way faster on lower end hardware
(2x faster on intel HD5000) but did not notice any improvement on AMD Vega.

This also adds a few changes to the way the wireframes are drawn:
- the slider is more linearly progressive.
- optimize display shows all wires and progressively decrease "inner" wires
  intensity. This is subject to change in the future.
- text/surface/metaballs support is pretty rough. More work needs to be done.

This remove the optimization introduced in f1975a4639.
This also removes the GPU side "sharpness" calculation which means that
animated meshes with wireframe display will update slower.
The CPU sharpness calculation has still room for optimization. Also
it is not excluded that GPU calculation can be added back as a
separate preprocessing pass (saving the computation result [compute or
feedback]).

The goal here was to have more speed for static objects and remove
the dependency of having buffer textures with triangle count. This is
preparation work for multithreading the whole DRW manager.
2018-12-07 05:33:53 +01:00
5bc7b9c3c6 Cleanup: unused var, style 2018-12-06 08:45:41 +11:00
0424ee86f0 Fix T58407: Wire frames are not showing with subdivision surfaces 2018-12-05 21:57:49 +01:00
6f198f7851 Wireframe: Optimization: Only draw triangles that have edges
This only happens after a certain wireframe threshold.

We sort triangles into 2 bins (start and end of the buffer) based on a
threshold and just draw the first bin if the wireframe slider is low enough.

This optimization is disabled for deformed meshes when playback is active.
This optimization is only implemented for meshes object for now.

This should help resolve (to some extent) T58188.
2018-12-04 17:52:32 +01:00
f1975a4639 Wireframe: Optimization: Only draw triangles that have edges
This only happens after a certain threshold.

We sort triangles into 2 bins (start and end of the buffer) based on a
threshold and just draw the start bin if the wireframe slider is low enough.

This optimization is disabled for deformed meshes.

This should help resolve (to some extent) T58188.
2018-12-04 17:52:32 +01:00
0d0c79e879 DRW: Make non Mesh object wire show in edit mode 2018-11-23 18:03:18 +01:00
e16ef56a0d Fix T57980: Assert failure in draw manager when opening file 2018-11-22 16:55:29 +01:00
740adf2a4b Cleanup: style 2018-11-19 13:37:18 +11:00
b4640ea020 DRW: Fix object wire appearing when object is drawn as bounds 2018-11-17 14:56:17 +01:00
ffcf193653 UI: Make Wireframe size respect DPI settings 2018-10-30 19:07:49 +01:00
28d5ebbc15 Wireframe: Fix wireframe object drawtype with "in front" draw option
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.
2018-10-23 18:04:45 +02:00
b31fc40fcd DRW: Fix missing uniform warning in debug mode
Fix T57318
2018-10-22 15:56:12 +02:00
66738d4aa0 Merge branch 'master' into blender2.8 2018-10-11 09:08:30 +11:00
8ed17c37c5 DRW: Fix unselectable wire object in solid mode 2018-10-01 18:56:26 +02:00
5732d9e1dc Wireframe/Xray: Make Xray option local to wireframe mode
This commit make the Xray option for the wireframe different from the other
shading mode. This makes it possible to rapidly switch between wireframe +
Xray and Solid mode without Xray.

Xray alpha is also decoupled.

Both variables are duplicated and exposed separately through RNA.
2018-09-26 20:31:20 +02:00
2ece296d4f Wireframe Mode: Fix missing wireframe if overlays are disabled 2018-09-21 18:29:25 +02:00
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
6b433f4eb3 Merge branch 'master' into blender2.8 2018-09-19 18:20:50 +02:00
b62d140be9 Object Mode: Make Flat object outline visible in orthographic view 2018-09-14 18:32:04 +02:00
b3aa0cfe75 Cleanup: Remove unnecessary uniform 2018-09-05 19:00:13 +02:00
e1a4d58ecc Cleanup: style 2018-09-05 08:54:11 +10:00
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
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
f4f97d1c7f Overlay: Fix wrong framebuffer bound. 2018-08-22 15:23:03 +02:00
31a1c2b7d2 Object Mode: Add back support for the object "Maximum draw type" option 2018-08-20 13:19:17 +02:00
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
7d29c9a16b Overlay: Fix crash when ghosting is enabled without wireframe 2018-08-16 23:58:29 +02:00
c761153f64 Overlays: Support for wireframes and edit mode overlay on xray objects 2018-08-16 23:57:59 +02:00
8cd7828792 GWN: Port to GPU module: Replace GWN prefix by GPU 2018-07-18 11:49:15 +02:00
9bd0c63382 Merge branch 'master' into blender2.8 2018-06-29 08:05:38 +02:00
f9ca750bdf Wireframe: Change / Optimize the limited wireframe visibility option.
This make the limited wireframe not a performance problem anymore.

However, this does change the number of edges displayed as the threshold
is now computed per vertex instead of per edges.

For this reason we extended (internaly) the range of the slider so that the
users can hide more edge.
2018-06-07 18:01:36 +02:00
a16d835f7b Wireframe: Frustum cull them. 2018-06-07 14:50:01 +02:00
d5ce40a5ed Wireframe: Add slider to hide edges from coplanar faces
The default behaviour is to show the same amount of edges as 2.7.
The slider makes it possible to show all edges or even less.
2018-06-05 19:35:36 +02:00