Commit Graph

631 Commits

Author SHA1 Message Date
Brecht Van Lommel
097b9019ce Fix T59799: texture paint mode crash for object with no materials. 2018-12-27 12:18:37 +01:00
Brecht Van Lommel
28520e9652 Fix T59799: crash entering texture paint mode. 2018-12-24 09:28:45 +01:00
Clément Foucault
a2a2fe1f22 Fix T59608: Curves invisible in object mode 2018-12-21 16:14:19 +01:00
Brecht Van Lommel
0edd93effb Fix inconsistent/broken Cycles object visibility for instances.
Object visibility is now handled by the depsgraph iterator, but this API
was incomplete as it made no distinction for visibility of the object itself,
particles and generated instances.

The depsgraph iterator API now includes information about which part of the
object is visible, and this is used by Cycles to replace the old custom logic.
Cycles and EEVEE visibility should now be consistent, which unfortunately does
means some subtle compatibility breakage for both.

Fixes T58956, T58202, T59284.

Differential Revision: https://developer.blender.org/D4109
2018-12-21 16:05:48 +01:00
mano-wii
ad7dd7d8e2 Fix (unreported): Wireframe fails in the sculpt mode on some AMD GPUs. 2018-12-19 13:26:32 -02:00
Jacques Lucke
be98fcc6e2 Fix T59273: Text object disappears when Fill Mode is set to None
Reviewers: fclem

Differential Revision: https://developer.blender.org/D4103
2018-12-19 15:56:15 +01:00
Sergey Sharybin
908a274240 Fix T59237: Instancing on a path doesn't do anything
This commit makes it so curve path parent solving accepts an explicit
arguments for both time and curve speed flag, making it so we don't
have to mock around with scene's frame.

One unfortunate issue still is that if the instancing object is used
for something else, we might be running into a threading conflict.
Possible solution would be to create a temp copy of an object, but
then it will be an issue of preventing drivers from modifying other
datablocks.

At least the original issue is fixed now, and things behave same as
in older Blender version. Additionally, the global variable which
was defining curve speed flag behavior is gone now!
2018-12-19 11:59:47 +01:00
Clément Foucault
c29cd41f49 Edit Mode: Show loose edges if in draw type is wire 2018-12-18 22:17:53 +01:00
Clément Foucault
b655bf6363 Wireframe Overlay: Make use of colorTransform when transforming an object 2018-12-18 22:17:53 +01:00
Clément Foucault
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
Clément Foucault
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
Clément Foucault
a68edaf11d Mesh Batch Cache: Port vertex paint surface to batch request 2018-12-18 02:19:52 +01:00
Clément Foucault
bcf390a6c3 Mesh Batch Cache: Port weight paint surface to batch request 2018-12-18 02:19:52 +01:00
Clément Foucault
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
Clément Foucault
144178bacf DRW: Fix vertex paint using original object for batch cache 2018-12-17 17:11:45 +01:00
Clément Foucault
4cd558b711 Mesh Batch Cache: Port Texture paint wires to new batch request 2018-12-17 17:11:45 +01:00
Clément Foucault
7ac49a07c6 Mesh Batch Cache: Port Texture paint batches to new batch request 2018-12-17 17:05:57 +01:00
Clément Foucault
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
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
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
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
Campbell Barton
c7ec1fa5e6 Cleanup: use BKE_object_* prefix for object API
Also minor style cleanup.
2018-12-11 15:09:09 +11: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
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
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
64bca2e648 Fix T58950: wireframe/orthographic/front/side/topview crash 2.8 2018-12-08 11:32:58 +01:00
Clément Foucault
0c6d5232a3 DRW: Remove the use of GPUTexture buffers for edit wire rendering
See previous commit for detail as why.
2018-12-07 05:33:53 +01:00
Clément Foucault
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
Clément Foucault
9f5a27c5be GPU: Remove EXT and add assert
Some drivers accept shaders with only vertex stage, but some just silently
fails.
2018-12-07 05:33:46 +01:00
Campbell Barton
7e722afc62 3D View: hide pose bones w/o overlays
Part of T58690
2018-12-07 09:28:32 +11:00
Campbell Barton
5bc7b9c3c6 Cleanup: unused var, style 2018-12-06 08:45:41 +11:00
Clément Foucault
0424ee86f0 Fix T58407: Wire frames are not showing with subdivision surfaces 2018-12-05 21:57:49 +01:00
Clément Foucault
1dac00f7ad Fix T58551: Dragged in images do not display orange highlight border when selected 2018-12-05 03:45:12 +01:00
Campbell Barton
8fb3a222a1 Fix T58690: Disable overlay doesn't hide bones 2018-12-05 11:08:50 +11:00
Clément Foucault
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
Clément Foucault
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
Clément Foucault
89ef69d23c Wireframe: Optimization: Output degenerate triangles if no edges 2018-12-04 17:52:32 +01:00
Clément Foucault
a022811441 DRW: Make fullscreen quad in the background
This is to be able to only draw the background pixels by using a depth
test EQUAL.
2018-12-03 17:19:11 +01:00
Clément Foucault
82f01c666f View3D: Grid: Don't make the Zaxis produce any fragment is not needed
This was a bug that was making the grid drawing even more slower than it
is.
2018-12-03 17:19:11 +01:00
Clément Foucault
756df74fca Fix T58101 : Image empties are only rendering their border when using MSAA 2018-12-02 20:11:40 +01:00
Alexander Gavrilov
3bd057d472 Texture Paint: fix wireframe and hiding not working with subsurf.
The editflag field is only valid in the original mesh instance.
2018-12-01 13:20:18 +03:00
Alexander Gavrilov
e6605d5f37 Fix depth offset in paint mode wireframe.
The original offset was wrong because it applied a constant to
homogenous coordinates (the actual depth is z/w), which broke
totally if near clip distance was reduced.

A correct depth offset has to take slope into account like
glPolygonOffset in order to avoid dotted lines caused by
interpolation precision variations. When drawing wire lines
however only the slope of the line itself is accessible, so
also generally increase the offset when the object is close.
2018-11-29 17:51:43 +03:00