Commit Graph

2729 Commits

Author SHA1 Message Date
Brecht Van Lommel
83f8f44791 Fix T59495, T59992, T59904, T59178, T60598: broken keyframed value editing.
This removes a bunch of animation/driver evaluations and recalc flags that
should be redundant in the new depsgraph, and were incorrectly affecting
the evaluated scene in a permanent way.

Still two cases that could be removed if the depsgraph is improved, in
BKE_object_handle_data_update and BKE_cachefile_update_frame.

For physics subframe interpolation there are also still calls to
BKE_object_where_is_calc that should ideally be removed as well, though
they are not known to cause keyframing bugs.

Differential Revision: https://developer.blender.org/D4274
2019-01-31 12:04:57 +01:00
Campbell Barton
293f4d88da Cleanup: style, unused variable 2019-01-31 15:54:37 +11:00
Clément Foucault
d16e4d077d Fix T61028: Crash when entering wireframe view 2019-01-31 01:35:09 +01:00
Campbell Barton
da1da3053d Cleanup: add trailing commas
Improve clang-format output.
2019-01-31 08:30:45 +11:00
Antonioya
6164983f9d GP: Remove DEG_get_original_id() from draw manager
Only keep this function when drawing to avoid COW overhead that reduce performance.

After some changes I did some time ago, the use of original ID was not required and this only added depsgraph overhead and problems.

This change solves the problems with updates in render mode.

Related to T57484 and the changes requested by Sergey.
2019-01-30 16:29:38 +01:00
Clément Foucault
1a61c209a0 Workbench: Make Material transparency part of the rgba color picker
It is only used for solid mode for now but could be used by eevee in the
future.
2019-01-29 20:34:37 +01:00
Clément Foucault
43150b02a0 Workbench: Opti: Only request OIT buffers if needed 2019-01-29 20:34:11 +01:00
Clément Foucault
2cc69a5e20 Workbench: Support transparency from object color alpha
Support the alpha channel use of the object color in solid mode.

The Transparency effect is still using the Xray algorithm and not
true Alpha blending.
2019-01-29 20:34:11 +01:00
Clément Foucault
8134f3f0a6 Workbench: Add "Shadow" factor to Xray
This just maintain more parity accross the 2 visuals. Note that this is not
"real shadowing" just the facing factor shadowing.
2019-01-29 15:07:53 +01:00
Clément Foucault
bc99f4903c Workbench: Add transparency support for materials
This adds the posibility of having certain materials transparent in solid
mode. The option is (for now) per material only and thus only shows in
material color mode.

This uses the same rendering technique as Xray mode.

Note that objects are not considered transparent for selection with this.
2019-01-29 15:07:53 +01:00
Clément Foucault
d88492d4ad Object Mode: Fix reading past buffer end when drawing camera 2019-01-29 15:05:51 +01:00
Clément Foucault
314ea1b1c7 Workbench: Depth Of Field: Improve noise and Large radius
- Add noise to remove undersampling artifact
- Create 2 mipmaps to the scene color buffer in order to have bigger blurs
- Replace blur2 with a 3x3 median filter that doesn't dilate the highlights
- Use temporal accumulation to remove noise

For some reason all of this exacerbate some bleeding issues happening on
far foreground elements from near foreground elements. The actual problem
was already happening before but was not really noticeable. It needs some
more work to be fixed.
2019-01-29 15:05:51 +01:00
Campbell Barton
851d58b34f DRW: support clipping for all lamp types 2019-01-29 20:27:28 +11:00
Campbell Barton
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
Campbell Barton
9bc43223c1 DRW: support clipping for object & lamp centers 2019-01-29 00:27:43 +11:00
Campbell Barton
66e6cd5315 Cleanup: unused struct declarations 2019-01-28 22:06:53 +11:00
Campbell Barton
c0f88ed8a8 Cleanup: sort forward declarations of enum & struct
Done using:
  source/tools/utils_maintenance/c_sort_blocks.py
2019-01-28 21:17:58 +11:00
Brecht Van Lommel
d97df138d1 Fix T60908: crash in workbench render after DoF changes. 2019-01-27 13:55:18 +01:00
Campbell Barton
f20dbc293f Cleanup: blank lines over doxy headers 2019-01-26 21:43:24 +11:00
Campbell Barton
1e4aab36c2 Cleanup: remove redundant BKE/BLI/BIF headers 2019-01-26 21:20:25 +11:00
Campbell Barton
19b5f5493c Cleanup: draw manager headers 2019-01-26 20:08:52 +11:00
Campbell Barton
b8467273b8 Cleanup: redundant defines
Comment or remove unused defines.
2019-01-26 19:15:30 +11:00
Campbell Barton
edd34c924b Cleanup: wrapper for built-in shader access 2019-01-26 16:39:05 +11:00
Campbell Barton
77b66a9666 DRW: support clipping for empty object 2019-01-26 15:49:14 +11:00
Clément Foucault
c1814d593d Workbench: Depth Of Field: Add toggle option in shading popover
Pretty straight forward. Just an option to turn the DoF per viewport.
Default is off as in 2.79.
2019-01-25 21:56:10 +01:00
Clément Foucault
3223644d14 Workbench: Depth Of Field: Cleanups 2019-01-25 21:56:10 +01:00
Antonioya
ca739ac1d5 GP: Apply scale to particles
The particles were using the scale of the original object and the thickness of the stroke was not correct. Now, the scale is applied by particle.
2019-01-25 20:40:56 +01:00
Clément Foucault
71e3002824 Workbench: Depth Of Field: Optimisation
- Compute samples positions on CPU.
- Use 3x3 Box blur instead of 2x2.
- Implement bokeh parameters.

With this commit, dof performance is almost negligeable.
The quality is a bit lower than before but can be improve. Also now big
Circle of confusion are supported (up to 200px).
Cost is ~1.25ms on AMD Vega with a 2560p viewport than full HD and
pretty shallow depth of field.

Coc downsampling and dilation is not used anymore for now (commented).
2019-01-25 15:04:18 +01:00
Clément Foucault
3f6e14e667 Workbench: Depth Of Field: Initial Commit
The algorithm used is borrowed from :
http://tuxedolabs.blogspot.com/2018/05/bokeh-depth-of-field-in-single-pass.html

This makes it possible to have a decent blur for foreground over defocused
background in one pass only.

The algorithm is using a gather approach that is much faster
than the scatter approach used in Eevee. This makes it possible to have
custom bokeh shapes (not implemented yet) which would be impossible with
a separable gaussian technique.

The blur is done in 2 steps. The first one define the shape of the bokeh
and the second that fill the undersampling.

A downsample max-CoC tile texture speed up the gathering process.
2019-01-25 15:02:49 +01:00
Antonioya
3fb72a5432 GP: Use Fill color when drawing strokes for no stroke materials
Artists requested to show the stroke while drawing a new stroke using a material with fill color only, because it's very difficult to see the stroke.

Now the stroke shows always but using the fill color, not the stroke color because maybe is not set.
2019-01-25 14:34:56 +01:00
Campbell Barton
a761233261 Correct last commit, wire xray is supported 2019-01-25 23:36:31 +11:00
Campbell Barton
30762a0b39 DRW: disable clipping background drawing w/ xray mode
This interfered with drawing the mesh.
2019-01-25 23:30:27 +11:00
Campbell Barton
2218bf02dd Cleanup: sort cmake file lists 2019-01-25 08:30:33 +11:00
Campbell Barton
e72fa714a8 Cleanup: remove duplicated shaders that only added clipping checks
Originally I wanted to avoid adding draw manager specific ifdef's all
over generic shaders however this isn't needed in so many places.

Also there are shaders that are only used by the draw manager so
duplicating them only to have the original unused doesn't make sense.
2019-01-25 08:01:07 +11:00
Campbell Barton
6d8394d38b DRW: support clipping for camera objects 2019-01-25 07:13:02 +11:00
Campbell Barton
a4fe338dd8 Cleanup: add missing braces to draw manager 2019-01-25 07:12:13 +11:00
mano-wii
95db2e8749 Fix GPU linking Error.
"The geometry shader uses varying _I;gl_PerVertex;gl_ClipDistance, but previous shader does not write to it."
2019-01-24 12:42:20 -02:00
Philipp Oeser
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
Antonioya
b3ba97ccce Fix T60805: Grease Pencil Rim Effect Problem
The problem was related to cache data that was removed from memory before the FX  finished. This could affect to any FX.

Now all the information is saved in the FX itself in runtime struct to keep memory safe when cache memory is released.
2019-01-24 11:33:35 +01:00
Antonioya
d2afdf3c20 GP: Use matrix location instead of loc 2019-01-24 11:33:35 +01:00
Campbell Barton
be32168eb4 DRW: support clipping for object outlines (unselected) 2019-01-24 19:13:38 +11:00
Campbell Barton
aa1b77dccb DRW: support clipping for object outlines 2019-01-24 18:28:21 +11:00
Brecht Van Lommel
cd8a342d7c Cleanup: fix compiler warnings. 2019-01-24 07:41:36 +01:00
Campbell Barton
11428e0b7f DRW: use clipping for depth buffer
Object selection now supports clipping.
2019-01-24 17:12:06 +11:00
Campbell Barton
d8a082f914 Correct doxy file 2019-01-24 16:19:45 +11:00
Campbell Barton
04d18b117c DRW: API for own versions of builtin GPU shaders
DRW_shader_get_builtin_shader can replace GPU_shader_get_builtin_shader
when we need to support clipping.

Use this for loose point & wire drawing in object mode,
clips edges in lattice edit mode.
2019-01-24 16:14:00 +11:00
Campbell Barton
7f77961f1c Fix theme color use for clipping region
Color needed to be converted to linear in the engine,
not the theme.
2019-01-24 10:36:46 +11:00
Campbell Barton
ddc278da24 Cleanup: comments above struct members, shader group assignments
Avoid using pointer to pointer when building shader groups.
2019-01-23 23:59:40 +11:00
Campbell Barton
48eed058b1 3D View: draw clipping region
Only for workbench solid/wire modes.
2019-01-23 23:37:25 +11:00
Campbell Barton
2e4f1b592f Cleanup: use eGPU prefix for GPU enum types 2019-01-23 14:16:03 +11:00