Commit Graph

297 Commits

Author SHA1 Message Date
dc3b5024be Cleanup: add BEGIN/END to GPL headers 2019-01-23 11:32:43 +11:00
7f40d553f9 Cleanp: use single global for draw manager
Add 'G_draw' for all draw manager globals,
avoids adding extern to each file.

Connection between `ts` and `globals_ubo` wasn't obvious,
now called `G_draw.block` & `G_draw.block_ubo`.
2019-01-22 12:09:27 +11:00
dbe960fdee Cleanup: replace 'ct' w/ 'len' 2019-01-21 11:22:27 +11:00
b5bc2158a0 View 3D Grid: Improve precision and reduce code complexity
Instead of doing manual ray-plane intersection we use normalized positions
of the grid mesh and apply scaling after interpolation so that we keep
good precision even at really far distances.

Precision is now two order of magnitude better and does not produce the
same kind of artifact at lower clip start values.

This commit also cleanup the implementation.

Fixes T58918 Grid not appearing correctly at low clip start in 2.8
2019-01-18 16:30:05 +01:00
2d98dce7ee Cleanup: rename BASE_FROMDUPLI -> BASE_FROM_DUPLI
Matches `BASE_FROM_SET`.
2019-01-15 23:30:31 +11:00
209afa28c6 Object Mode: Outlines: Add support for thicker outline
Base outline is 2px wide (because of how we detect them).
And since inflating this outline will only produce outlines that are 2*x
thick we map the UI scalling and the outline width setting to the closest
match.

Do note that thicker outlines have a performance cost since they need more
texture fetches and passes.

This fixes T60252 3D View Outline Width not working
2019-01-14 18:33:07 +01:00
Dalai Felinto
ce3475f747 Viewport: Stereoscopy drawing is back
The viewport stereoscopy support helpers are finally ported to 2.80.

We now can scale the camera and the "stereo cameras" will scale
in the viewport as well (unlike 2.7x).

At the moment I disabled the drawing of the camera frame when
stereo is selected and you are looking through the camera.

It is to be fixed later, but for now it draws the border wrong.
In 2.79 this was not a problem because the camera frame was drawn
afterwards as a hack.

Viewport > Stereoscopy:
* Cameras
* Convergence plane
* Convergence plane alpha
* Stereoscopy volume
* Stereoscopy volume alpha
2019-01-11 21:51:15 -02:00
Dalai Felinto
9f6e09bd8c Drawing API: shgroup_instance and shgroup_instance_alpha clarification
shgroup_instance_alpha was getting a color[4] but would only use the
alpha defined upon creation of the shading group.

This was very limiting since it wouldn't allow for different instances
to have different alpha values.

Patch made with Clément Foucault (he made the code of it, while I fixed
all the parts of the code that were relying on shgroup_instance_alpha.
2019-01-11 21:51:15 -02:00
9327013796 3D View: use faded wire for set-scene objects
Matches 2.7x behavior.
2019-01-11 15:02:52 +11:00
0f99845d2f 3D View: use faded color for dupli instance outlines
Similar to 2.7x, so instanced geometry can be differentiated.
2019-01-10 18:29:13 +11:00
5ce6b344d5 3D View: use faded color for dupli instance wire & points
Similar to 2.7x, so instanced geometry can be differentiated.
2019-01-10 18:28:53 +11:00
670b2944f4 Cleanup: indentation (right shift) 2019-01-04 19:08:09 +11:00
3788f58e74 3D View: use grid & all axes in axis-views
Matches 2.7x behavior.
2019-01-02 18:33:07 +11:00
a2a2fe1f22 Fix T59608: Curves invisible in object mode 2018-12-21 16:14:19 +01:00
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
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
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
c29cd41f49 Edit Mode: Show loose edges if in draw type is wire 2018-12-18 22:17:53 +01:00
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
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
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
9e82499d2d Fix T59347: Crash drawing empty image 2018-12-14 14:13:59 +11:00
c7ec1fa5e6 Cleanup: use BKE_object_* prefix for object API
Also minor style cleanup.
2018-12-11 15:09:09 +11:00
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
1dac00f7ad Fix T58551: Dragged in images do not display orange highlight border when selected 2018-12-05 03:45:12 +01:00
8fb3a222a1 Fix T58690: Disable overlay doesn't hide bones 2018-12-05 11:08:50 +11:00
756df74fca Fix T58101 : Image empties are only rendering their border when using MSAA 2018-12-02 20:11:40 +01:00
2b97a250f6 Cleanup: remove useless redundant NULL check. 2018-11-25 18:49:57 +01:00
7c74f5006a Cleanup: newlines in error prints 2018-11-23 07:29:21 +11:00
f30271e3d4 Image Empties: Potential Fix for T57696
So far this makes a new pass for image empties that does not write to the depth buffer.

Todo:
- Sort empties using `DRW_pass_sort_shgroup_z`.
- Calculate correct bounding boxes.
- fix bounding box memory leak.

Reviewers: fclem

Differential Revision: https://developer.blender.org/D3922
2018-11-22 18:31:03 +01:00
5f21030a81 Image Empties: Option to not display the backside of image empties
Reviewers: brecht

Differential Revision: https://developer.blender.org/D3964
2018-11-19 19:33:09 +01:00
c3d03b4434 Lamps: Remove HEMI light type
This type is not supported by either Eevee or Cycles. If other types of
lamps are needed by external engines, we should support adding custom types.
2018-11-14 11:50:37 +01:00
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
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
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
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
fd61b49d50 ObjectMode: Fix Outlines being drawn for BBox meshes 2018-10-17 18:09:37 +02:00
91e5e02aff ObjectMode: Fix instances with BoundBox drawtype not displaying 2018-10-17 18:09:37 +02:00
2ab6272233 DRW: Fix assert with BoundBox object display mode 2018-10-16 22:53:32 +02:00
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
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
04064fb186 Cleanup: use DRW_object_is_* for object checks
Also use const qualifier for object's.
2018-10-08 10:43:34 +11:00
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
971ab57c7d Cleanup: style 2018-10-04 09:33:49 +10:00
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
5a4ff142de GP: Hide the origin when enable origins 2018-10-03 20:30:13 +02:00
5f4d2be735 GP: Hide dummy and cursor in drawing mode 2018-10-03 20:25:14 +02:00
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
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