Commit Graph

2523 Commits

Author SHA1 Message Date
Antonioya
1578ce46c5 GP: Fix Onion Skin slow performance
The number of vertex for VBO was not calculated for onion skin and made the realloc of memory very slow.
2018-12-16 12:19:20 +01:00
Campbell Barton
3e311fdcd1 Cleanup: style 2018-12-16 09:30:05 +11:00
Antonioya
351f537fa8 GP: New Curve primitive and other primitive improvements
This commit adds support for new curve tool and adds more functionalities to the existing primitives, including new handles, editing, stroke thickness curve, noise, preview of the real stroke, etc.

Thanks to @charlie for his great contribution to this improvement.
2018-12-15 17:21:47 +01:00
Clément Foucault
98f6f7bc78 Fix T59182: Blender 2.8 win64 crashes on start 2018-12-14 16:53:45 +01:00
Antonioya
780f0f646d GP: Rename CTX and OB modes
Part of T59335.
2018-12-14 16:52:12 +01:00
Clément Foucault
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
Clément Foucault
e4b3fe4b69 Wireframe: Fix wireframe color in edit mode for surfaces 2018-12-14 16:17:29 +01:00
Clément Foucault
f37e45c26b DRW Batch Cache: Fix hack being a bit too much hacky 2018-12-14 16:17:29 +01:00
Clément Foucault
531e5ad49a Displist: Reuse tesselated pos and nor for wireframes
This lower the memory usage and also fix a bug with metaballs normals/tris
winding being reversed.
2018-12-14 16:17:29 +01:00
Clément Foucault
18d0566013 Curve Batch Cache: Add back support for shaded geometry
This changes a bit the batches data structure. Instead of using one
vbo per material we use one for all material and use index buffers for
selecting the correct triangles.

This is less optimized than before but has potential to become more
optimized by merging the wireframe data vbo into the shading one.

Also the index buffers are not strictly necessary and could be just
ranges inside the buffer. But this needs more adding things inside
GPUIndexBuf.
2018-12-14 16:17:29 +01:00
Clément Foucault
0ee0f0ebf6 Wireframe: Fix Object Viewport display "all edges" options not working 2018-12-14 16:17:29 +01:00
Clément Foucault
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
Clément Foucault
77164e30c7 DRW: Simplify text edit drawing
This is to simplify the curve batch cache.
2018-12-14 16:17:29 +01:00
Philipp Oeser
c1adf86a2e fix relationship line always drawing from the parents origin
this can be different though (e.g. vertex parenting) and correct location
is already stored in ob->orig

spotted while looking into T59332

Reviewers: fclem, brecht

Differential Revision: https://developer.blender.org/D4076
2018-12-14 13:27:49 +01:00
Campbell Barton
9e82499d2d Fix T59347: Crash drawing empty image 2018-12-14 14:13:59 +11:00
Campbell Barton
dd4c87cd04 Merge branch 'master' into blender2.8 2018-12-14 11:09:42 +11:00
Campbell Barton
a3375729f8 Cleanup: macro hygiene, style, doxy comments 2018-12-13 23:04:14 +11:00
Antonioya
a4afbe1153 GP: Cleanup const variables 2018-12-13 12:41:46 +01:00
Antonioya
0c011fd689 GP: Missing change of texture format in previous commit 2018-12-13 12:19:06 +01:00
Antonioya
6c39ea27c8 GP: Create Framebuffer textures only if needed
Now, if there aren't grease pencil objects, the textures and framebuffers are not created. This unload GPU Memory when not using GP.
2018-12-13 11:51:41 +01:00
Antonioya
715ab529f1 GP: Changes textures from DEPTH24_STENCIL8 to DEPTH_COMPONENT24
As we are not using stencil info, we don't need this in the texture.
2018-12-13 11:51:41 +01:00
Campbell Barton
7d4d9e9dbd Cleanup: style 2018-12-13 12:30:38 +11:00
Antonioya
9c5d104224 Fix T59248: Crash in Grease Pencil Edit mode when adding Annotation 2018-12-12 19:48:24 +01:00
Clément Foucault
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
Clément Foucault
cf92795953 Mesh Batch Cache: Fix crash when using edit mode normal display. 2018-12-12 15:19:21 +01:00
Campbell Barton
49490e5cfb Merge branch 'master' into blender2.8 2018-12-12 13:02:09 +11:00
Campbell Barton
b87b6e8e28 Fix T59211: Edit-mesh display crashes
Caused by ae1f563899
2018-12-12 11:16:56 +11:00
Clément Foucault
5049322e62 GPUState: Change isolated glLineWidth usage to GPU_line_width 2018-12-11 23:05:36 +01:00
Clément Foucault
c541f3abef DRW: Fix redundant texture creation 2018-12-11 21:25:17 +01:00
Clément Foucault
4de5478409 Edit Mesh: Make edit cage stick to the mesh when possible
and correctly offset it when it's not possible, otherwise we get zfighting.
2018-12-11 18:21:12 +01:00
Clément Foucault
1b8e1bb635 DRW: Add polygon offset mode. 2018-12-11 18:18:36 +01:00
Clément Foucault
2a6bc4a82c Fix T58266 : Bottom half of meshes are transparent with eevee render 2018-12-11 16:21:17 +01:00
Campbell Barton
c7ec1fa5e6 Cleanup: use BKE_object_* prefix for object API
Also minor style cleanup.
2018-12-11 15:09:09 +11:00
Campbell Barton
9a8b6d51c1 Fix T58850: NDOF navigation guide not shown 2018-12-11 12:35:18 +11:00
Clément Foucault
3dfbb72b29 Workbench: Fix shadow artifact caused by degenerate triangles
Fixes T58735 Incorrect workbench shadow from n-gons

This also optimize the degenerate triangle detection by searching if
their area is near 0.0.
2018-12-11 01:25:45 +01:00
Clément Foucault
8c8e9b5586 DRW: Deprecate / Remove DRW_STATE_STIPPLE_*
This was unused and used the old drawing paradygm
2018-12-10 23:17:20 +01:00
Clément Foucault
1d23024014 Object Mode: Make point clouds a bit less like uniform blobs
Also this display is optimized. It does not use blending and pixel discard.
Working with scanned data should be more pleasant with this.

A better option would be to use gl_FragDepth to have a better sense of
volume but this discards early depth test.
2018-12-10 23:17:20 +01:00
Antonioya
bfb9680e9e GP: Fix problems with stroke Caps
Now the start cap is done and during drawing the end cap is not set because needs to have a UV calculated and this is not done while drawing.
2018-12-10 20:18:45 +01:00
Antonioya
18d354a5eb GP: Remove Object Onion Skin switch
It was confusing to have two switches.
2018-12-10 20:18:15 +01:00
Antonioya
bcb5293b9b GP: Enable Object Onion Skin by default
Now, the main switchis on, and the layer onion skin is off.
2018-12-10 20:17:49 +01:00
Clément Foucault
9def295d57 Edit Mesh: Opti: Reduce max_vertices in geometry shader
This is a really small win that had been overlooked when optimizing the
shader.
2018-12-10 19:02:17 +01:00
Clément Foucault
0c3535df9f Edit Mesh: Fix edges poking through the verts points in xray/seethrough mode 2018-12-10 19:02:17 +01:00
Clément Foucault
8e37eb10a1 Edit Mesh: Make "fresnel effect" not transparent but mix between 2 colors
Alpha blending is causing too many issues.
Revert back to something simpler.
2018-12-10 19:02:17 +01:00
Clément Foucault
834bf357c8 Edit Mesh: Draw inner edge selected in vert edit mode if both verts selected
This only make the edge fully selected. There is still no gradient like in
2.79 when only one vertex is selected.
2018-12-10 19:02:17 +01:00
Clément Foucault
f7b558cbdc DRW: Batch Cache: Mesh: Port edit mesh batches to batch request method
This also do some renaming/cleanups.
2018-12-10 19:02:17 +01:00
Clément Foucault
ae1f563899 DRW: Batch Cache: Mesh: Port more batches to batch request method 2018-12-10 19:02:17 +01:00
Clément Foucault
1d92888ee8 DRW: Batch Cache: Add batch request system
This makes it possible for engines to ask for batches and only fill their
data after all engine populate functions have run.
This means that, when creating the batches data we already know all the
batches that are needed for this redraw and the needed data.

This allows for less redundant data preparation and better attrib masking.
Ideally, we should run all viewports populate function before executing
the batch construction but this is not the scope of this patch.

Conversion from the old request method will be progressive and both can
coexist (see uses of mesh_create_pos_and_nor()).
2018-12-10 19:02:17 +01:00
Clément Foucault
64bca2e648 Fix T58950: wireframe/orthographic/front/side/topview crash 2.8 2018-12-08 11:32:58 +01:00
Clément Foucault
0fe5a78983 Fix T58949: Transform feedback shaders not having fragment shader 2018-12-07 21:19:14 +01:00
Antonioya
a8e459e452 Fix T58360 "Use object as pivot" in GP "Shadow effect" crashes Blender 2018-12-07 20:01:01 +01:00