Commit Graph

120 Commits

Author SHA1 Message Date
6fd0d810b4 DRW: support clipping for bone verts 2019-03-06 01:26:30 +11:00
1079742db9 Cleanup: rename lamp -> light 2019-02-27 12:26:49 +11:00
de13d0a80c doxygen: add newline after \file
While \file doesn't need an argument, it can't have another doxy
command after it.
2019-02-18 08:22:12 +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
813800f143 DRW: support clipping for stick & wire bones 2019-02-08 23:21:22 +11:00
7325035e60 DRW: support clipping for octahedral & box bones 2019-02-07 08:03:56 +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
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
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
77b66a9666 DRW: support clipping for empty object 2019-01-26 15:49:14 +11:00
6d8394d38b DRW: support clipping for camera objects 2019-01-25 07:13:02 +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
c7768bcf4b Cleanup: use const args 2019-01-22 12:09:12 +11:00
9bc47ed0f6 Fix clipping shaders with some AMD/Intel drivers
Caused:
    error: unsized array index must be constant

Use hard coded number of clipping planes, copying the 4th to 5 & 6
when only 4 are used.
2019-01-21 23:55:53 +11:00
78d2abd9c1 DRW: Support wire overlay clipping 2019-01-21 19:08:42 +11:00
2d98dce7ee Cleanup: rename BASE_FROMDUPLI -> BASE_FROM_DUPLI
Matches `BASE_FROM_SET`.
2019-01-15 23:30:31 +11:00
ee0c2e9b87 Edit Mesh: Improve selected double vertices visibility
The issue is that the edge fix geometry goes on top of the actual drawn
points.

This commit reduce the edge fix size to the strict minimum but does not
get rid of it.

Related to T60139
2019-01-14 23:43:17 +01: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
0434511a40 3D View: fade out dupli-wire color 70% 2019-01-11 15:02:58 +11:00
9327013796 3D View: use faded wire for set-scene objects
Matches 2.7x behavior.
2019-01-11 15:02:52 +11:00
40706b56db Cleanup: blend existing colors 2019-01-11 13:27:49 +11:00
5c6d5cb863 Fix background color use in 3D view
TH_BACK was being used when drawing the 3D view even though
there was no way to set the color in the preferences.

The color was zero'd when moving to the new 2.8x theme.

Having both gradient and background colors was confusing,
especially having to use 'TH_HIGH_GRAD' for the 3D view, 'TH_BACK' for
other views.

Move the background color back to 'TH_BACK', 'TH_BACK_GRAD' is used
when gradients are enabled.
RNA is unchanged so presets don't need updating.
2019-01-11 12:59:19 +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
f71ae30962 Fix edit-mode wire color being used for other objects 2018-12-18 21:21:48 +11:00
e4b3fe4b69 Wireframe: Fix wireframe color in edit mode for surfaces 2018-12-14 16:17:29 +01:00
c541f3abef DRW: Fix redundant texture creation 2018-12-11 21:25:17 +01:00
8c8e9b5586 DRW: Deprecate / Remove DRW_STATE_STIPPLE_*
This was unused and used the old drawing paradygm
2018-12-10 23:17:20 +01:00
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
d3ade45774 Armature: Fix stick bones not scaling with pixel size 2018-11-02 16:27:34 +01:00
89c30ff746 Pose Mode: Add back IK Degrees of freedom display 2018-10-03 15:44:12 +02:00
4c22807e69 Cleanup: style 2018-10-03 08:10:48 +10:00
8ee4fd0bdf Cleanup: style 2018-10-01 09:20:31 +10:00
3da46a8d8d Implement a new dedicated weight painting shader.
Move the weight paint drawing to the fragment shader. The shader
uses a texture that uses the U.coba_weight custom color band, or
an internal color band.

In addition to actual weights, the shader has to display two
alert colors: missing vertex group, and zero weight. The zero
weight alert has to be blended with regular weight colors,
so that a single alert vertex surrounded by weighted ones is
still visible.

Reviewers: campbellbarton, fclem

Differential Revision: https://developer.blender.org/D3675
2018-09-27 17:33:33 +03:00
f7a81abe19 Edit Surface: Use edit curve engine to display edit surface
It's so similar in practice that we don't need a separate engine for edit
surface overlays.
2018-09-26 16:42:57 +02:00
b62d140be9 Object Mode: Make Flat object outline visible in orthographic view 2018-09-14 18:32:04 +02:00
57f9e31bf4 DRW: Convert common theme color to linear for viewport render
This is not 100% correct (it should use a transfer function depending
on the display profile) but this is already much better than using srgb.
2018-09-11 17:05:16 +02:00
c05b9bbcc0 Fix T56692: The edges are not highlighted in Mark Freestyle Edge
This was not ported yet.
2018-09-05 19:00:12 +02:00
3140304940 Cleanup: overly polite/rude messages 2018-09-04 18:45:17 +10:00
84cc111e8b 3D View: scale edit-mesh drawing by pixel size 2018-08-30 14:28:50 +10:00
4b89bf88c7 Revert "DRW: Remove unecessary GL calls"
This reverts commit f8c857ad72.
2018-08-27 18:02:48 +02:00
f8c857ad72 DRW: Remove unecessary GL calls 2018-08-26 23:54:47 +02:00
890623f886 Object Mode: Add back spot cone display 2018-08-22 19:49:32 +02:00