Commit Graph

2127 Commits

Author SHA1 Message Date
Jeroen Bakker
3da46a8d8d Implement a new dedicated weight painting shader.
Move the weight paint drawing to the fragment shader. The shader
uses a texture that uses the U.coba_weight custom color band, or
an internal color band.

In addition to actual weights, the shader has to display two
alert colors: missing vertex group, and zero weight. The zero
weight alert has to be blended with regular weight colors,
so that a single alert vertex surrounded by weighted ones is
still visible.

Reviewers: campbellbarton, fclem

Differential Revision: https://developer.blender.org/D3675
2018-09-27 17:33:33 +03:00
Antonioya
c722728b7f Fix T56927: Grease pencil materials issues with lock and hide 2018-09-27 12:07:43 +02:00
Clément Foucault
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
Clément Foucault
586ec7588f Cleanup: Edit Surface & Curve engines unused code 2018-09-26 16:42:57 +02:00
Clément Foucault
f7a81abe19 Edit Surface: Use edit curve engine to display edit surface
It's so similar in practice that we don't need a separate engine for edit
surface overlays.
2018-09-26 16:42:57 +02:00
Clément Foucault
1407a11138 Edit Curve: Fix "show handles" option hiding nurbs segments 2018-09-26 16:42:57 +02:00
Antonioya
81a7d3cd07 Fix T56926: Highlighted selection doesn't disappear when locking layer 2018-09-26 15:28:11 +02:00
Alexander Gavrilov
bb8023ff7f Fix misleading field naming.
This is not any kind of length, it is the number of true values.
2018-09-26 09:05:13 +03:00
Campbell Barton
741ed1029e Cleanup: naming of DRW mesh weight API 2018-09-26 10:16:17 +10:00
Campbell Barton
e40870c479 Cleanup: warnings, style 2018-09-26 10:01:32 +10:00
Clément Foucault
682c64d3e1 Curve Edit: Fix handles glitch when MSAA is enable 2018-09-26 00:49:50 +02:00
Clément Foucault
5158da9e37 Curve Edit: Cleanup/Improve/Fix handles drawing
Now handles are drawn using index buffer instead of duplicating memory
requirement.

Also make use of shader tricks to draw handles antialiased, and respond to
UI scalling.

Make vertex point match edit mesh vertex size.
2018-09-26 00:49:50 +02:00
Clément Foucault
0c21773199 Edit Curve: Fix cannot hide handles 2018-09-25 22:51:54 +02:00
Clément Foucault
2cff9b4cb6 Curves: Move draw options to overlays
This commit add one regression: it is impossible to currently hide handles
in the viewport. But this should be fixed in another commit.
2018-09-25 22:51:54 +02:00
Clément Foucault
05d0e5315b Weight Paint: Fix weight paint overlay not displaying correctly
This was because weight paint was using the original obj to show weights.
But the mesh can be deformed by the armature and this is not visible on
the original object.
2018-09-25 22:51:54 +02:00
Clément Foucault
9f6978a1ba Eevee: Don't render meshes in hidden wire mode 2018-09-25 22:51:54 +02:00
Clément Foucault
a3bb385ca0 Edit Mesh: Move Edit Mesh display settings to overlay's
This makes the Edit Mesh display settings common to all objects. They can
also be set differently per viewport.

Modifying extra data (seams, sharp edges etc...) will no longer set them
automaticaly visible.

Bumping version because we need to force set all extra draw options for
older files.
2018-09-25 22:51:54 +02:00
Clément Foucault
7cc9998809 Edit Mesh: Center text when Edge length & Edge Angle is activated
This is more readable as the informations will never overlap and be off the
center of the edge.
2018-09-25 22:51:54 +02:00
Antonioya
9df3467b4e GP: Add const to variable 2018-09-25 20:23:55 +02:00
Antonioya
4ad3182eb1 GP: Fix multi viewport onion error
For onion skin, the cache is set as dirty always because can be too many combinations of overlays and windows and makes impossible to control all changes of dirty flag.

This reduces performance, but it's safer and the onion is disabled while play animation, so the fps value is not affected.
2018-09-25 19:30:50 +02:00
Alexander Gavrilov
af998b40a0 Implement correct drawing of advanced Weight display features.
This adds existing behavior from calc_weightpaint_vert_array
that was missing from the new rendering code:

- No selected Vertex Group displays as a solid pink color.
- Zero weight displays as alert color depending on Options.
- Multipaint mode correctly displays collective weight.

In order to properly implement this variety, a data structure
holding all relevant parameters is introduced.

Reviewers: fclem, campbellbarton

Subscribers: jbakker

Differential Revision: https://developer.blender.org/D3722
2018-09-25 18:44:57 +03:00
Antonioya
2b628ba52b GP: Disable AA for material previews
This is not visible and it's using a lot of GPU memory
2018-09-24 22:10:08 +02:00
Jacques Lucke
19f46c6ac0 Weight Paint: Multiply overlay on the mesh
Use the multiply blending mode for the weight paint overlay.
To support the opacity slider, we need a new shader. Otherwise this combination of multiplication and mixing does not seem to be supported by glBlendFunc.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D3727
2018-09-24 17:10:29 +02:00
Clément Foucault
2ece296d4f Wireframe Mode: Fix missing wireframe if overlays are disabled 2018-09-21 18:29:25 +02:00
Jacques Lucke
684739c6f9 Fix: missing cache invalidation when the active vertex group changed
Reviewers: brecht

Differential Revision: https://developer.blender.org/D3716
2018-09-21 16:20:32 +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
Clément Foucault
667add5fc5 Eevee: Implement Wireframe Node
This implementation is a bit hacky but match cycles pretty close.

If pixel size is not enabled, it will use the geom shader to
compute distances between vertices. This will have a cost.

Implementation is a bit hacky in gpu_codegen to make the geom shader works
in an optional manner.
2018-09-20 17:53:47 +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
Dalai Felinto
cffae36381 Fix build for MSVC: Remove trailing double semicolon
Not sure why but MSVC is complaining for some of those.

In particular for the struct in BKE_subdiv_ccg.h. Those were the ones
crashing here..
2018-09-20 14:59:55 +00:00
Clément Foucault
73ac72fa89 DRW: Fix crash when new shader requires 0 customdata layers
It was using last cache->auto_layer_len which led to a buffer overflow.
2018-09-19 20:02:12 +02:00
Clément Foucault
7ad8272952 DRW: Only trash UV and tangent data when using BKE_MESH_BATCH_DIRTY_SHADING
This improves the problem encountered when animating materials on static
meshes but does not fix the core issue. See T55326.
2018-09-19 20:02:12 +02:00
Brecht Van Lommel
6b433f4eb3 Merge branch 'master' into blender2.8 2018-09-19 18:20:50 +02:00
Antonioya
a349527981 GP: Fix stupid mistake 2018-09-19 12:15:53 +02:00
Antonioya
25f25a6f30 GP: Remove unneeded flag 2018-09-19 12:15:05 +02:00
Campbell Barton
f35e9f047a Merge branch 'master' into blender2.8 2018-09-19 12:14:36 +10:00
Campbell Barton
345c348262 Cleanup: style 2018-09-19 10:29:57 +10:00
Antonioya
e6766287d6 Fix T56827: Crash when enable onion skin in multiwindow
The problem was the cache was not set as dirty if one of the window had the overlay disabled.
2018-09-18 23:18:48 +02:00
Clément Foucault
93780411e9 LookDev: Use theme background instead of world color
This is much less confusing than relying on an hidden parameter (the world
color) that you can only see if you disable the world node tree.
2018-09-18 22:18:49 +02:00
Clément Foucault
5aa3e33565 LookDev: Use black background color if world is not present 2018-09-18 21:39:53 +02:00
Campbell Barton
5ae531d813 Cleanup: spelling 2018-09-18 16:35:13 +10:00
Clément Foucault
731d0d8d0f Eevee: Fix shader linking error with volumetric shaders 2018-09-17 15:08:14 +02:00
Clément Foucault
3da5b03b8a Eevee: Fix crash when using refraction with alpha clip blend mode 2018-09-17 14:46:22 +02:00
Clément Foucault
68f139db0d Fix T56800: Reflection Plane in Eevee crashes Blender 2018-09-17 12:20:51 +02:00
Clément Foucault
ad8b187a53 Fix T56803: Indirect lightning bake crashes Blender 2018-09-17 12:20:51 +02:00
Clément Foucault
5bf32f3337 Fix T56801: Enabling smoke crashes Blender. 2018-09-17 12:20:51 +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
1f1d5e1dd2 Object Mode: Make Flat object selectable in ortho view ...
... when wireframe is enabled
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