Commit Graph

251 Commits

Author SHA1 Message Date
a04dd15193 Edit Mesh: Only draw vertices once
Only add each vertices to point ibo once. That requires tagging each mvert
in the case of modifier preview.
2019-02-07 20:36:29 +01:00
ea30767997 Edit Mode: Reduce number of edges drawn
This make sure only one line is drawn per edge.

It makes the function mesh_create_edit_loops_points_lines() non-thread safe
but this is fine as of now because nothing is multithreaded at this point.
Also this is the only function use this flag so it might be OK.

The side effect is that we don't need to use depth test in edit mode
overlay so the masking artifact will not appear.
2019-02-07 19:11:01 +01:00
7584ef85bf Edit Mode: Fix edge partially displayed as selected with modifier preview
Force set the flag vertice selected in this case.
2019-02-07 19:06:54 +01:00
eef4077f18 Cleanup: remove redundant doxygen \file argument
Move \ingroup onto same line to be more compact and
make it clear the file is in the group.
2019-02-06 15:45:22 +11:00
a13fb30917 Edit Mode: Fix loose edges edit mode normal display broken 2019-02-05 15:02:15 +01:00
86193d25db Edit Mesh: Refactor Edit cage drawing to use old style drawing
This is work in progress. Look is not final.

This align data VBO data structure used for edti cage drawing to the one
use for normal drawing.

We no longer use barycentric coords to draw the lines an just rasterize
line primitives for edge drawing. This is a bit slower than using the
previous fast method but faster than the "correct" (edge artifact free)
method. This also make the code way simpler.

This also makes it possible to reuse possible and normal vbos used for
shading if the edit cage matches the

This also touches the UV batch code to share as much render data as
possible. The code also prepare for edit cage "modified" drawing cage (with
modifier applied) but is not enabled since selection and operators does not
work with modified cage yet.
2019-02-05 15:02:15 +01:00
65ec7ec524 Cleanup: remove redundant, invalid info from headers
BF-admins agree to remove header information that isn't useful,
to reduce noise.

- BEGIN/END license blocks

  Developers should add non license comments as separate comment blocks.
  No need for separator text.

- Contributors

  This is often invalid, outdated or misleading
  especially when splitting files.

  It's more useful to git-blame to find out who has developed the code.

See P901 for script to perform these edits.
2019-02-02 01:36:28 +11:00
68cab3aff6 Cleanup: replace attrib w/ attr
Also rename GPUVertexAttribs to GPUVertAttrLayers,
avoids confusion with GPUVertAttr which isn't closely related.
2019-01-29 08:32:25 +11:00
f20dbc293f Cleanup: blank lines over doxy headers 2019-01-26 21:43:24 +11:00
19b5f5493c Cleanup: draw manager headers 2019-01-26 20:08:52 +11:00
a4fe338dd8 Cleanup: add missing braces to draw manager 2019-01-25 07:12:13 +11:00
bc32240105 Fix T60810: crash editing mesh with subdivision modifier
typo in rBdc7e49298940

Reviewers: fclem

Maniphest Tasks: T60810

Differential Revision: https://developer.blender.org/D4244
2019-01-24 14:36:01 +01:00
dc7e492989 Fix T60545: Buffer overflow in selection batch creation
Use loose_edges and loose_verts buffer instead of detecting them manually.
2019-01-17 19:48:00 +01:00
9d8445d6a9 Cleanup: de-duplicate loose vert/edge checks 2019-01-17 13:20:44 +11:00
76fdd33df2 Fix T60578: Crash selecting after hiding vertices 2019-01-17 13:05:45 +11:00
6f9e3e9d33 Fix T60476 Loose vertices only partially drawn
Was caused by a missing vbo attachement.

Also fix said Vbo refreshing when selecting.
2019-01-14 18:33:07 +01:00
9f51fc656e EditUV: Only clear data VBO when selection changes
This is a small optimisation that make UV selection faster.
2019-01-11 20:09:42 +01:00
3a9909f38e Fix T59990: Crash when entering edit mode with skin modifier enabled
The skin modifier does not keep the UV layers.

This just add a safety check when there is no UV layers.
2019-01-11 18:56:05 +01:00
1c91b6ee29 UVEdit: Port texpaint_loop_wire to batch request
This removes code duplication and put an end to the old "create at request"
batch creation.

Also it uses the same vbo as the uv layer used for shading. Reducing VRAM
usage.

Also fixes the modified uv display in uv edit mode.
2019-01-11 16:00:23 +01:00
621a6d4a5d UVEdit: Add back uv angle stretch aspect correction
This is now done in shader so that the batches are shared across ImageUV
areas.
2019-01-11 16:00:23 +01:00
5f3fdee53a UVEdit: Port batches to batch request
This is in order to allow more spaces to have their batches created at the
same time and sharing the batches.

This is part of the effort fo making the drawing code more optimized. This
commit however should not introduce any difference.

This commit bypass the aspect ratio correction for angle stretch display
but this should be fixed in the next commit.
2019-01-11 16:00:23 +01:00
a46dc9b234 Mesh Batch Cache: Cleanup Unused 2019-01-11 16:00:23 +01:00
55ddb21b7c Mesh Selection: Port to batch cache request
This makes it more future proof and remove baked id offset inside the vbos.
Instead we add the offset as a uniform. This makes it possible to reuse
the vbos instead of discarding them all the time.

Also using batch request may reduce batches creation time.
2019-01-11 16:00:23 +01:00
4c0c4e7f9f Mesh Batch Cache: Fix wrong assert 2019-01-11 16:00:23 +01:00
943852c0dc Mesh Batch Cache: Put context evaluation out of batch cache
This is in order to be able to call DRW_mesh_batch_cache_create_requested
outside of the draw manager
2019-01-11 16:00:23 +01:00
369e1d46f0 Fix T56545: Material referencing missing UV crash 2019-01-09 01:05:43 +11:00
543ddbe6bf Cleanup: warnings (clang) 2018-12-30 15:15:05 +11:00
7a26e930a8 Cleanup: macro hygiene, line length 2018-12-21 10:46:26 +11:00
217727cb35 Mesh Batch Cache: Fix missing flag for looptris indexbuf generation
Fix T59637: Crash report - Overlays -> Face Orientation causes crash
2018-12-20 23:42:21 +01:00
a9706476e3 Mesh Batch Cache: Fix uninitialized loop variable 2018-12-19 22:56:15 +01:00
1a7fe54a85 Fix T59578: enabling "vertex group weights" in edit mode results in crash 2018-12-19 12:32:13 +01:00
5b277d7a18 Mesh Batch Cache: Port loose_edges to batch request 2018-12-18 22:17:53 +01:00
2f00e0a37b Mesh Batch Cache: Cleanup / Reorder function for more consistency 2018-12-18 22:17:53 +01:00
604101d262 Mesh Batch Cache: Port edge_detection to batch request
Also add proper support for mapped meshes (deformed by modifiers in edit
mode). So this fixes the shadows of workbench in edit mode.
2018-12-18 20:51:52 +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
df88b6a48d Mesh Batch Cache: Port all_edges batch to batch request 2018-12-18 20:51:52 +01:00
8839152abf Fix T59529: Auto smooth not working 2018-12-18 14:27:13 +01:00
a68edaf11d Mesh Batch Cache: Port vertex paint surface to batch request 2018-12-18 02:19:52 +01:00
bcf390a6c3 Mesh Batch Cache: Port weight paint surface to batch request 2018-12-18 02:19:52 +01:00
6a1315d6e7 Weight Paint Overlay: Refactor wire drawing
This reduce the number of batch/data needed. Stores a select/visiblee
flag inside the vert/loop normals.
2018-12-18 02:19:52 +01:00
f6a77a759b Fix error when Blender starts - variable not initializated 2018-12-17 19:09:27 +01:00
4cd558b711 Mesh Batch Cache: Port Texture paint wires to new batch request 2018-12-17 17:11:45 +01:00
7ac49a07c6 Mesh Batch Cache: Port Texture paint batches to new batch request 2018-12-17 17:05:57 +01:00
36cc42e796 Mesh Batch Cache: Optimization & Refactor shaded surface support
This now only upload data per loops to the GPU, making use of index buffer
to draw polygon. This make use of the vertex cache, speed up renders
and saves a lot of vram.

Update performance is also slightly faster and can even be improved further
by updating only uvs or vcol independently.

This commits breaks texture paint batches. It will be added back in another
commit.
2018-12-17 17:05:57 +01:00
f371e633f9 Curve Batch Cache: Add support for loose edges and curve/surf modifier
Fixes T58298 Nurbs circle and curve dont draw in objectmode
Fixes T58107 Modified curves/surfaces/fonts do not show their eval mesh
2018-12-14 16:17:29 +01:00
2afed99da3 Curve Batch Cache: Rework Implementation to use new batch request
Shaded triangles are not yet implemented (request from gpumaterials).

This also changes the mechanism to draw curve normals to make it not
dependant on normal size display. This way different viewport can
reuse the same batch.
2018-12-14 16:17:29 +01:00
dd4c87cd04 Merge branch 'master' into blender2.8 2018-12-14 11:09:42 +11:00
10eb92035c Fix T59234: Crash when enter in Edit mode
Edit mode triangles does always need to have access to faces for visibility
and select/active flags.
2018-12-12 15:19:21 +01:00
cf92795953 Mesh Batch Cache: Fix crash when using edit mode normal display. 2018-12-12 15:19:21 +01:00
b87b6e8e28 Fix T59211: Edit-mesh display crashes
Caused by ae1f563899
2018-12-12 11:16:56 +11:00