Commit Graph

321 Commits

Author SHA1 Message Date
826d9ac827 Cleanup: move runtime vars into Camera_Runtime 2019-02-11 16:58:52 +11:00
0b6dbbc306 Cleanup: move clipping shader lib & define into struct
Also compare clipping with the draw context instead of
accessing the RegionView3D, currently they're matching
but this might not always be the case.
2019-02-10 11:16:31 +11:00
16d7967c2b Cleanup: use shorter name for shader config
The struct name is descriptive,
this isn't going to be confused with other variables.
2019-02-10 11:02:06 +11:00
e8292466bc DRW: Support edit-metaball clipping 2019-02-07 00:07:30 +11:00
eef4077f18 Cleanup: remove redundant doxygen \file argument
Move \ingroup onto same line to be more compact and
make it clear the file is in the group.
2019-02-06 15:45:22 +11:00
dbd7f36da8 GPU: refactor clipped drawing from DRW into GPU
Needed to fix T61196, supporting clipped back-buffer in the 3D view
which is done outside the draw module.

It was also inconvenient having DRW_shader_* versions of GPU_shader_*
API calls.

- Clipping distances are now supported as a shader configuration
  for builtin shaders.
- Add shader config argument when accessing builtin shaders.
- Move GPU_shader_create_from_arrays() from DRW to GPU.
2019-02-06 09:15:16 +11:00
Dalai Felinto
d1ef6be4a7 Fix T61204: Can't select Camera in stereoscopy mode
This was deliberately disabled since I didn't get the drawing working
originally. It is fully working now.

Note: camera lens widget still needs to be fixed since it still draws it
wrongly.
2019-02-05 18:40:23 -02:00
744f633986 Cleanup: trailing commas
Needed for clan-format not to wrap onto one line.
2019-02-03 14:59:11 +11:00
65ec7ec524 Cleanup: remove redundant, invalid info from headers
BF-admins agree to remove header information that isn't useful,
to reduce noise.

- BEGIN/END license blocks

  Developers should add non license comments as separate comment blocks.
  No need for separator text.

- Contributors

  This is often invalid, outdated or misleading
  especially when splitting files.

  It's more useful to git-blame to find out who has developed the code.

See P901 for script to perform these edits.
2019-02-02 01:36:28 +11:00
da1da3053d Cleanup: add trailing commas
Improve clang-format output.
2019-01-31 08:30:45 +11:00
d88492d4ad Object Mode: Fix reading past buffer end when drawing camera 2019-01-29 15:05:51 +01:00
851d58b34f DRW: support clipping for all lamp types 2019-01-29 20:27:28 +11:00
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
9bc43223c1 DRW: support clipping for object & lamp centers 2019-01-29 00:27:43 +11:00
1e4aab36c2 Cleanup: remove redundant BKE/BLI/BIF headers 2019-01-26 21:20:25 +11:00
19b5f5493c Cleanup: draw manager headers 2019-01-26 20:08:52 +11:00
77b66a9666 DRW: support clipping for empty object 2019-01-26 15:49:14 +11:00
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
6d8394d38b DRW: support clipping for camera objects 2019-01-25 07:13:02 +11:00
a4fe338dd8 Cleanup: add missing braces to draw manager 2019-01-25 07:12:13 +11:00
aa1b77dccb DRW: support clipping for object outlines 2019-01-24 18:28:21 +11:00
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
14d947dcad DRW: generalize selecting between regular/clipped shaders
Each engine was doing this on its own.
Move to DRWContextState, use an enum.
2019-01-23 13:34:55 +11:00
c403508e41 DRW: changes to object mode engine needed to support clipping
Split out shader struct, no function changes.
2019-01-23 12:37:12 +11:00
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