Commit Graph

559 Commits

Author SHA1 Message Date
Clément Foucault
2ae88c4d78 UI: Make the grid alpha themable
Now that the 3d grid is infinite, antialiased, not occluded, and overlaid
on top of rendered view, being able to decrease its opacity to reduce
visual strain is a must.
2018-11-05 16:31:12 +01:00
Clément Foucault
050e91340d Edit Mesh: Fix wire opacity when not rotating the view in Xray mode 2018-11-05 16:31:11 +01:00
Clément Foucault
46d88c5850 Edit Mesh Mode: Improve edge drawing
Make edge decoration a bit thinner and try to reduce missing edge segment
due to triangle barycentrics.

This invert the "edge fix" strip offset direction, meanning there is now
the possibility that these triangles poke through nearby geometry depending
on the viewport near/far clips distances.
2018-11-02 15:45:13 +01:00
Jacques Lucke
a3802f66e2 Image Empties: More visibility settings
Support for showing images in background/foreground and only in perspective/orthographic view.

Internally the depth of the image is modified in the fragment shader by setting `gl_FragDepth` explicitly.

The UI still needs some work to improve usability, see D3863 for details.
Currently there is one duplicated function, not sure how to best deduplicate it yet. (`is_image_empty_visible`)

Reviewer: fclem, brecht, campbellbarton

Differential Revision: https://developer.blender.org/D3863
2018-10-31 13:42:33 +01:00
mano-wii
603774c1eb Fix T56865: Selection of bones not working properly if the option In Front (old X-ray) is enabled
Differential Revision: https://developer.blender.org/D3828
2018-10-30 15:31:32 -03:00
Clément Foucault
ffcf193653 UI: Make Wireframe size respect DPI settings 2018-10-30 19:07:49 +01:00
Clément Foucault
87f4c83018 Object Mode: Grid: Allow more subdivision in orthographic views
2.7x was displaying 2 additional subdivision for theses views. Bumping to 3
just to say we improved it!
Hypothetically it can be increased as much as we want but float precision
can quickly become an issue.
2018-10-30 16:44:23 +01:00
Clément Foucault
26223f8d9a Object Mode: Grid: Reduce line thickness a tiny bit and apply UI scaling 2018-10-30 16:44:23 +01:00
Dalai Felinto
a2dc4d2532 Fix T57368: Multi-Object-Mode: Edit Lattice draws only active
As it turned out the issue wasn't that we were drawing only the active,
but that the "object mode" lattice drawing was drawing on top of the
drawing for all the edit mode lattice objects.

We are doing the same original behaviour for curves and even meshes. To be
investigated if it is ok for those other cases.
2018-10-26 13:11:07 -03:00
Clément Foucault
28d5ebbc15 Wireframe: Fix wireframe object drawtype with "in front" draw option
First problem is that enabling the "in front" option made the wire object
test against an not updated stencil buffer.

Second problem is that the "in front" option was useless on wire objects.
To fix this we bypass the depth test and live with some sorting problem.
2018-10-23 18:04:45 +02:00
Clément Foucault
b31fc40fcd DRW: Fix missing uniform warning in debug mode
Fix T57318
2018-10-22 15:56:12 +02:00
Clément Foucault
a20c590966 DRW: Fix crash on startup for old Nvidia drivers
This should fix T57296 once and for all.
2018-10-22 15:56:12 +02:00
Campbell Barton
769b979abb Cleanup: trailing space 2018-10-21 16:23:15 +11:00
Clément Foucault
905921d2b5 Fix function using same local variable name as output variable
This may fix issues with certain compiler.
2018-10-19 18:13:22 +02:00
Clément Foucault
642b77e874 Edit Mesh: Decrease the depth bias on vertices 2018-10-18 20:42:32 +02:00
mano-wii
a2922f9840 Optimization: Edit Mesh Overlay
In tests with edit_cage: performance jumped from 9.37ms to 9.17ms.
2018-10-17 15:46:58 -03:00
Clément Foucault
f666be6edf EditMesh: Fix uninitialized value causing red outline on edges 2018-10-17 18:49:27 +02:00
Clément Foucault
fd61b49d50 ObjectMode: Fix Outlines being drawn for BBox meshes 2018-10-17 18:09:37 +02:00
Clément Foucault
91e5e02aff ObjectMode: Fix instances with BoundBox drawtype not displaying 2018-10-17 18:09:37 +02:00
mano-wii
41ad845531 Optimization: Edit Mesh Overlay: Avoid computing fixvec unnecessarily.
This brings a big difference to meshes with edit cage adjusted for modifiers.
In my tests, the suzanne with subdivision modifier level 3 went from 4.80ms to 3.05ms.
2018-10-16 20:42:50 -03:00
mano-wii
1f1da26840 Edit Mesh Overlay Geometry Shader: Ignore correction geometry for loops that are not part of an edge.
By the tests I could only observe a considerable difference in the peformanse when the vertex size is 30.
Vertice 3 showed no difference in a suzzane with subdivision modifier level 3 + show-on-cage.

Point Size 30: 7.29ms vs 2.55ms

Reviewers: fclem

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D3805
2018-10-16 23:04:57 +02:00
Clément Foucault
2ab6272233 DRW: Fix assert with BoundBox object display mode 2018-10-16 22:53:32 +02:00
Clément Foucault
478899dee7 Edit Mesh: Fix missing loop normal display 2018-10-15 16:04:50 +02:00
mano-wii
22814ca555 Fix related to T55961: Glitch in selecting loose edges on some AMD drives. 2018-10-15 09:54:24 -03:00
mano-wii
c2afa3ef46 Edit Mesh: Add comments explaining weirdness in the code. 2018-10-15 09:50:31 -03:00
Clément Foucault
0c39453071 Cleanup: Edit Mesh shader: Remove unecessary varying 2018-10-15 10:43:49 +02:00
mano-wii
9a38a91f41 Fix T55961: Anomalous edges cage on some AMD buggy drivers.
Reviwed on irc by @fclem.
2018-10-14 14:07:45 -03:00
Clément Foucault
55e3c17ccc Edit Mesh: Optimize the overlay triangle geometry shader
On my test it's 30% faster than before.

Test case : Suzanne, subsurf lvl3, 64K tris, Edge select mode for fair
comparison.

0.95ms before optimization
0.64ms after optimization

Note that this only optimize the "nicest" display of edit mesh overlays,
not the one when rotating the view where half of the border edges are
missing.
2018-10-13 23:55:30 +02:00
Clément Foucault
de76a809f9 Edit Mesh: Do not use barycentric coord in EDGE_FIX shader and ...
... display vertex even when occluded.

Add back the vertex display because occluded vertex are not visible when
the triangle is almost parallel to the view.

The problem with the barycentric coord is that they are hard to work with
and their derivatives not enough precise to compute the vertex positions.

So we need to pass the vertices scree positions down to the fragment shader.
2018-10-13 23:48:19 +02:00
Clément Foucault
4e168e0036 Edit Mesh: Fix and increase the depth bias on vertices 2018-10-13 23:48:19 +02:00
Clément Foucault
77653d97fb Edit Mesh: Fix issue with Edit cage on some buggy drivers 2018-10-12 17:21:04 +02:00
Clément Foucault
03d0219d7a Edit Mesh: Refactor edit mesh drawing
This decouple the vertex display from the face+edges.

This is to reduce the number of triangles required to fix the edges
artifacts (aliasing) and increase viewport reactivity when not actively
navigating (ie. mouse scroll).

Also it makes all vertices visible (not cut-off) even when navigating.

However it makes the navigation drawing a bit slower because it has to
render twice.

Also add a depth bias to the wires to avoid depth fighting when previewing
final mesh (modifiers applied).
2018-10-12 16:43:40 +02:00
Clément Foucault
fe4840ed4d Wireframe Overlay: Use Barycentric coord to optimize shader
This also fix a driver bug I was having on Linux + Mesa + AMD Vega.
2018-10-12 16:38:55 +02:00
Campbell Barton
5e9afe5018 Missed when bumping flags
Ideally these wouldn't be repeated in multiple places.
2018-10-11 17:02:42 +11:00
Campbell Barton
d74b89aed0 DRW: add ability to skip drawing vertices 2018-10-11 16:43:38 +11:00
Campbell Barton
66738d4aa0 Merge branch 'master' into blender2.8 2018-10-11 09:08:30 +11:00
Philipp Oeser
1fad887d9e Fix T57130: Crash when running 'set active object as camera' on an empty
Reviewed By: brecht

https://developer.blender.org/D3782
2018-10-10 14:30:44 +02:00
Clément Foucault
eea22dd5ef Workbench: Smoke: Fix display
Includes the following fixes
- Fix smoke texture creation: data was interpreted as Byte instead of Floats.
- Fix Velocity texture not being free after draw: also was causing crashes.
- Fix display_thickness not being copied during COW.
- Fix Blending and general volume rendering algorithm.
- Add Volume Shadowing support.
2018-10-08 17:20:09 +02:00
Alexander Gavrilov
ba3ef44a6b Implement display of weight isoline contours in the fragment shader.
Add an option to display contour lines tracing through points with the
same interpolated weight value in weight paint mode. This can be useful
for working on gentle gradients over a relatively high resolution mesh,
where the difference in color between adjacent vertices is very small.

The contour grid has 3 levels of detail going down to step 0.001,
which automatically fade in or out based on the weight gradient.

Fade out works by capping both screen space and weight space line
width, and reducing alpha when the screen space width becomes too
small for moire and noise-less rendering.

Reviewers: fclem

Differential Revision: https://developer.blender.org/D3749
2018-10-08 14:15:47 +03:00
Campbell Barton
04064fb186 Cleanup: use DRW_object_is_* for object checks
Also use const qualifier for object's.
2018-10-08 10:43:34 +11:00
Jacques Lucke
7c443ded1e Vertex Paint: multiply vertex paint overlay
Fixes the first part of T56999.

Reviewer: brecht

Differential Revision: https://developer.blender.org/D3768
2018-10-05 14:05:48 +02:00
Jacques Lucke
a2d633316b Cleanup: Remove some unneeded code
Reviewers: fclem

Differential Revision: https://developer.blender.org/D3767
2018-10-04 18:54:08 +02:00
Campbell Barton
55f62b94f8 DRW: minor tweaks to mode checking
Avoid accessing object mode via the view layer active object
when drawing since it's done everywhere we store the active object mode
in the draw-context.
2018-10-04 09:37:18 +10:00
Campbell Barton
971ab57c7d Cleanup: style 2018-10-04 09:33:49 +10:00
Antonioya
204ad852a6 GP: Hide different UI elements depending of mode
The 3D Cursor, origin and dummy are hidden depending of the mode to get a cleaner drawing space.
2018-10-03 22:56:23 +02:00
Antonioya
5a4ff142de GP: Hide the origin when enable origins 2018-10-03 20:30:13 +02:00
Antonioya
5f4d2be735 GP: Hide dummy and cursor in drawing mode 2018-10-03 20:25:14 +02:00
Clément Foucault
89c30ff746 Pose Mode: Add back IK Degrees of freedom display 2018-10-03 15:44:12 +02:00
Clément Foucault
36d457e887 DRW: Fix assert in texture paint 2018-10-03 15:44:12 +02:00
Jacques Lucke
2d21eb79ad Units: Support for fixed units
Users can select the main unit they want to use now.
Previously the displayed unit always depended on the magnitude of the value.
The old behavior can be restored by switching to the "Adaptive" mode for length, mass and time units.

Meters, kilograms and seconds are the default units for new and old scenes.

The selected unit is also the default unit for user input.
E.g. if cm is selected, whenever the user inputs a unitless number into a field of type length, it will be interpreted as cm.

Reviewer: brecht

Differential: https://developer.blender.org/D3740
2018-10-03 10:20:16 +02:00