Commit Graph

1506 Commits

Author SHA1 Message Date
Sergey Sharybin
37cec42e3d Clay: Cleanup, reduce indentation level 2018-05-09 16:45:04 +02:00
Sergey Sharybin
2d5fe40601 Eevee: Cleanup, use NULL instead of static matrix
Those are the same thing now. So no need to keep initializing matrix
over and over.
2018-05-09 16:42:15 +02:00
Sergey Sharybin
cb747302dc Correct previous commit 2018-05-09 16:38:38 +02:00
Sergey Sharybin
734a232b39 Eevee: Cleanup, reduce indentation level 2018-05-09 16:36:09 +02:00
Sergey Sharybin
51445f42ac Workbench: Make hair populating function shorter and nicer 2018-05-09 16:21:24 +02:00
Jeroen Bakker
d3b80c4734 T55014: Optionally: objects not cast shadows in workbench 2018-05-09 15:14:43 +02:00
Sergey Sharybin
6f891e2b87 Draw manager: Implement point selection modes for particle edit mode 2018-05-09 15:00:29 +02:00
Sergey Sharybin
5cea8bf435 Draw manager: Initial implementation of key points visualization
Does all points all the time, ignoring the setting in viewport header.
This is to be addressed by the next commit.
2018-05-09 14:59:48 +02:00
Sergey Sharybin
033c2c7131 Draw manager: Start using more explicit API for particle edit mode 2018-05-09 14:59:48 +02:00
Campbell Barton
5173861766 Cleanup: unused vars 2018-05-09 14:08:56 +02:00
Jeroen Bakker
c0667c2f35 T55008: Migrating RE-Collection data to Scene data
in Scene DNA is available in scene.display New DNA Struct DisplayData
Added RNA (scene.display).

We already have scene.display_settings which contains non viewpoert
specific color management settings. I did not merge those two.

Patch should be in line with the ideas that @brecht wrote in T55008.

As I am not in detail aware of the decisions that have been made for the override feature I want a short review if it is in line with the plans.

Reviewers: brecht, dfelinto

Reviewed By: brecht

Subscribers: brecht

Tags: #code_quest, #bf_blender_2.8

Differential Revision: https://developer.blender.org/D3290
2018-05-09 13:38:06 +02:00
Sergey Sharybin
49fc1d0f54 Draw manager: Initial implementation of particle edit mode
Gets edit more from the current object and displays it as a path.
this is how both hair and particle edit modes are supposed to work.

This only covers path itself, it doesn't do anything like keys
visualization or selection. However, it's already possible to
comb and such.

Only implements particle mode. There are also some settings to
do soft body and cloth. No idea yet what that all is about.

Copy-on-write is not supported either, this is due to some
edit mode ownership problems which are to be addressed from
dependency graph side.

Shading is dead-simple: uses tangent as a color. This is where
i hope to get some help from Clément.
2018-05-09 10:34:45 +02:00
Sergey Sharybin
afdc5c148b Draw manager: Use utility function to get particle edit mode
Makes it more local where we have to do all the tricky checks.
2018-05-09 10:34:45 +02:00
Sergey Sharybin
43c6ba9eed Draw manager: Add support for cached particle edit paths
Before it was only supporting hair strand paths editing.
2018-05-09 10:34:45 +02:00
Sergey Sharybin
25eb6d01f5 Draw manager: Correct edit mode check for particles 2018-05-09 10:34:45 +02:00
Sergey Sharybin
283158ecc1 Draw manager: Ignore particles when object is in particle edit mode 2018-05-09 10:34:45 +02:00
Sergey Sharybin
9c1c6d89a1 Draw manager: allow creation of hair batch cache from edit mode 2018-05-09 10:34:45 +02:00
Sergey Sharybin
b150c497dc Draw manager: De-duplicate segment counting 2018-05-09 10:34:45 +02:00
Sergey Sharybin
5e1445e374 Draw manager: Completely de-duplicate strands caching for parent and particles
Will make it simple to add strands from edit mode as well.
2018-05-09 10:34:45 +02:00
Sergey Sharybin
17d13e4107 Draw manager: Move parent particle cache fill into an own function
Should make it fairly simple to make it re-usable by children particles.
2018-05-09 10:34:45 +02:00
Sergey Sharybin
81e6aa1600 Draw manager: Use single function to calculate particles UVs
Will allow us to merge two code paths more easily.
2018-05-09 10:34:45 +02:00
Sergey Sharybin
ca5c3f767c Draw manager: Move emit_from checks to interpolation functions
Keeps main function shorter.
2018-05-09 10:34:45 +02:00
Sergey Sharybin
0868ccae13 Draw manager: Move UVs interpolation of child particles to a function 2018-05-09 10:34:45 +02:00
Sergey Sharybin
e3eaca976a Draw manager: De-duplicate calculation of parent UVs 2018-05-09 10:34:45 +02:00
Sergey Sharybin
cf043d51c2 Draw manager: Make parent and child particles code to be more equal
Make parent UVs calculation for simple children to match another block.
2018-05-09 10:34:45 +02:00
Sergey Sharybin
94553750c7 Draw manager: More meaningful variable name 2018-05-09 10:34:45 +02:00
Sergey Sharybin
ecc24242bb Draw manager: Reduce indentation level in particle batch populate 2018-05-09 10:34:45 +02:00
Brecht Van Lommel
e6d11c6ce6 Collections: remove per collection and view layer engine overrides.
This will be handled by the new view layer override system which will
store data elsewhere, removing the code already for easier refactoring.
2018-05-08 17:46:20 +02:00
Campbell Barton
fa69ce9e3a Cleanup: whitespace, duplicate includes 2018-05-08 16:57:07 +02:00
Campbell Barton
a48186c5d7 Orientation for 3D cursor
Currently set when setting the cursor location,
optionally used as an orientation type.

Intended for use by tools too.

See: D3208
2018-05-08 15:35:04 +02:00
Clément Foucault
d89f9d70c5 Eevee: Fix bug with transparent object + volume rendering.
This was because the main_fb was not bound back to be updated.
Following draw calls were drawn without depth buffer.
2018-05-08 14:31:17 +02:00
Jeroen Bakker
cc8672b95e Fix T54999: error when entering edit mode in texture shading
When entering edit mode the texture coordinates is not calculated by
drawcachemesh. For now fallback to solid mode. This gives wrong
artifacts when disabling overlays when in edit mode. We should make it
possible to calculate the UVLOOP from bmesh. This will be done in a next
patch
2018-05-08 14:02:45 +02:00
Clément Foucault
9a79178c2e Armature: Add back Stick bone draw type.
The actual code is a bit convoluted but allows good and "pseudo efficient"
drawing. (pseudo efficient because rendering instances with that amount of
vertices is really inneficient. We should go full procedural but need to
have bufferTexture implemented first) But drawing speed is not a bottleneck
here and it's already a million time less crappy than the old (2.79) immediate
mode method.

Instead of drawing actual wires with different width we render a triangle
fan batch (containing 3 fans: bone, head, tail) which is then oriented in
screen space to the bone direction. We then interpolate a float value
accross vertices giving us a nice blend factor to blend the colors and
gives us really smooth interpolation inside the bone.

The outside edge still being geometry will be antialiased by MSAA if enabled.
2018-05-08 12:18:35 +02:00
Sergey Sharybin
9401021f8b Clay: Simplify matcap manipulation
No need to hard-coded handling of every individual matcap.

They are in the continuous index range anyway.
2018-05-08 11:56:58 +02:00
Sergey Sharybin
1fd1d061ac Clay: Don't use hardcoded constant in the string
Stringify the actual constant instead.
2018-05-08 11:56:58 +02:00
Campbell Barton
86b9311926 Cleanup: quiet warning, whitespace 2018-05-08 10:58:04 +02:00
Clément Foucault
3c79043f1b DRW: Fix incorrect blending function reset. 2018-05-07 18:29:45 +02:00
Clément Foucault
b0b2a47853 Armature: Transparent Bone: Fix envelope not being alpha blended. 2018-05-07 17:12:04 +02:00
Clément Foucault
8ab3697e21 Armature: Add new Transparent Bone overlay option.
This is half the replacement of the old wireframe mode. It's not doing any
XRay drawing at the moment.
2018-05-07 17:00:10 +02:00
Clément Foucault
2f76e95b96 DRW: Do not multiply alpha or color by alpha if not in blend more. 2018-05-07 17:00:10 +02:00
Clément Foucault
29c650c3cc DRW: Add DRW_pass_state_add and DRW_pass_state_remove 2018-05-07 17:00:10 +02:00
Jeroen Bakker
9f4d92bb92 Workbench: Texture Shading mode
- draws the active texture of the material
- if the texture cannot be found it will fallback to solid/material
2018-05-07 15:00:16 +02:00
Jeroen Bakker
f09d3a7a40 Workbench: Texture Shading mode 2018-05-07 14:59:27 +02:00
Clément Foucault
b029cc5d74 Eevee: Hair: Fix wrong color when shader is compiling. 2018-05-07 13:08:21 +02:00
Clément Foucault
9215b41dd3 Armature: Fix BBones base face winding.
Was producing wrong outline and backface culling.
2018-05-07 13:08:21 +02:00
Clément Foucault
5c728358ec Armature: Remove big outlines for active bones & reduce axes color. 2018-05-07 13:08:21 +02:00
Clément Foucault
e3d30ffb92 Armature: Add back relationship lines. 2018-05-07 00:24:41 +02:00
Clément Foucault
17370a27a3 Object Mode: Use stipple shader for relationship lines. 2018-05-07 00:24:41 +02:00
Clément Foucault
c769b1a553 Armature: Add a special Pass for bone axes.
In object mode, the axes are drawn like any other wire objects with
depth test and depth write. Thus enabling MSAA to work but not their xray
behaviour.

In edit armature/pose mode, draw smooth line without depth testing. This
produces wrong draw ordering problem but still gives the desired xray
behaviour. We do it outside of the MSAA pass since the xray behaviour is not
compatible with it. But we are drawing smoothed lines so no need for MSAA.
The lines are 2px thick and improve readability.
2018-05-06 18:42:23 +02:00
Clément Foucault
48ddb2b98a Armature: Fix bone axes not using bone color. 2018-05-06 18:36:47 +02:00