3 years agoMerge branch 'master' into blender2.8
Sergey Sharybin [Tue, 16 Jan 2018 15:40:05 +0000 (16:40 +0100)]
Merge branch 'master' into blender2.8

3 years agoCleanup: Naming of depsgraph
Sergey Sharybin [Tue, 16 Jan 2018 15:38:39 +0000 (16:38 +0100)]
Cleanup: Naming of depsgraph

3 years agoAlembic: don't explicitly pass NULL
Sybren A. Stüvel [Tue, 16 Jan 2018 15:28:10 +0000 (16:28 +0100)]
Alembic: don't explicitly pass NULL

3 years agoT53711: Alembic don´t import vertex colors correctly
Sybren A. Stüvel [Tue, 16 Jan 2018 14:05:31 +0000 (15:05 +0100)]
T53711: Alembic don´t import vertex colors correctly

An index stored in Alembic wasn't used. Often this index is a no-op
(i.e. index[n] = n), in which case the result was fine. However, when it
isn't, it caused issues.

3 years agoDraw manager: Cleanup, use full name for depsgraph variable
Sergey Sharybin [Tue, 16 Jan 2018 14:58:39 +0000 (15:58 +0100)]
Draw manager: Cleanup, use full name for depsgraph variable

3 years agoDraw manager: Make depsgraph a part of draw state
Sergey Sharybin [Tue, 16 Jan 2018 14:42:03 +0000 (15:42 +0100)]
Draw manager: Make depsgraph a part of draw state

Makes it more explicit and avoids hash loookup when depsgraph is needed.

3 years agoDraw manager: Make update context aware of what depsgraph causes update
Sergey Sharybin [Tue, 16 Jan 2018 14:38:44 +0000 (15:38 +0100)]
Draw manager: Make update context aware of what depsgraph causes update

3 years agoDepsgraph: pass depsgraph to editors update context struct
Sergey Sharybin [Tue, 16 Jan 2018 14:37:52 +0000 (15:37 +0100)]
Depsgraph: pass depsgraph to editors update context struct

This way callbacks will know which depsgraph is being changed, and where
evaluated data is coming from.

3 years agoAdd dedicated pointer to an original ID datablock
Sergey Sharybin [Tue, 16 Jan 2018 13:57:02 +0000 (14:57 +0100)]
Add dedicated pointer to an original ID datablock

Before we were re-using newid pointer inside of ID structure where we were
storing pointer to an original datablock.

It seems there is no way we can avoid requirement of having pointer to an
original datablock, so let's stop obusing system which was only designed to
be a runtime only thingie. Will be more safe this way, without need to worry
about using any API which modifies newid.

3 years agoMerge branch 'master' into blender2.8
Sergey Sharybin [Tue, 16 Jan 2018 13:52:43 +0000 (14:52 +0100)]
Merge branch 'master' into blender2.8

3 years agoSculpting: Fix uninitialized color being left for smooth meshes with hidden mask
Sergey Sharybin [Tue, 16 Jan 2018 13:46:48 +0000 (14:46 +0100)]
Sculpting: Fix uninitialized color being left for smooth meshes with hidden mask

3 years agoSculpting: Fix for "Hide Mask" does not work with multires
Sergey Sharybin [Tue, 16 Jan 2018 13:31:52 +0000 (14:31 +0100)]
Sculpting: Fix for "Hide Mask" does not work with multires

3 years agoManipulator: fix arrow offset in perspective view
Campbell Barton [Tue, 16 Jan 2018 12:37:11 +0000 (23:37 +1100)]
Manipulator: fix arrow offset in perspective view

Use 3D calculations instead of projecting into 2D space.

3 years agoFix compilation error
Sergey Sharybin [Tue, 16 Jan 2018 11:48:33 +0000 (12:48 +0100)]
Fix compilation error

3 years agoMerge branch 'master' into blender2.8
Sergey Sharybin [Tue, 16 Jan 2018 11:07:43 +0000 (12:07 +0100)]
Merge branch 'master' into blender2.8

3 years agoFix missing node tree updates when unconnected node affects output via driver
Sergey Sharybin [Tue, 16 Jan 2018 11:06:22 +0000 (12:06 +0100)]
Fix missing node tree updates when unconnected node affects output via driver

Fixes T53794: Can't control color ramp node color values with drivers

3 years agoDepsgraph: Fix fake cyclic dependencies for node tree drivers
Sergey Sharybin [Tue, 16 Jan 2018 10:53:34 +0000 (11:53 +0100)]
Depsgraph: Fix fake cyclic dependencies for node tree drivers

There was a fake cyclic dependency happening when node of node tree is driving
another node of the same tree.

This is related to T53794, but more fixes is needed here.

3 years agoDepsgraph: Better relations name
Sergey Sharybin [Tue, 16 Jan 2018 10:43:05 +0000 (11:43 +0100)]
Depsgraph: Better relations name

3 years agoDepsgraph: Check for ID match when checking if operations corresponds to the same...
Sergey Sharybin [Tue, 16 Jan 2018 10:41:50 +0000 (11:41 +0100)]
Depsgraph: Check for ID match when checking if operations corresponds to the same bone

3 years agoDepsgraph: Cleanup, indentation
Sergey Sharybin [Tue, 16 Jan 2018 10:40:02 +0000 (11:40 +0100)]
Depsgraph: Cleanup, indentation

3 years agoDepsgraph: Cleanup, brace placement\
Sergey Sharybin [Tue, 16 Jan 2018 10:38:44 +0000 (11:38 +0100)]
Depsgraph: Cleanup, brace placement\

3 years agoreadfile: ensure blend header follows the spec
Campbell Barton [Tue, 16 Jan 2018 09:00:13 +0000 (20:00 +1100)]
readfile: ensure blend header follows the spec

3 years agoRuler Manipulator: dragging out of the view removes
Campbell Barton [Tue, 16 Jan 2018 07:08:21 +0000 (18:08 +1100)]
Ruler Manipulator: dragging out of the view removes

Not ideal, but means we don't need to override Delete key.

3 years agoManipulator: Support tweak removing the manipulator
Campbell Barton [Tue, 16 Jan 2018 07:03:15 +0000 (18:03 +1100)]
Manipulator: Support tweak removing the manipulator

3 years agoMerge branch 'master' into blender2.8
Campbell Barton [Tue, 16 Jan 2018 03:56:03 +0000 (14:56 +1100)]
Merge branch 'master' into blender2.8

3 years agoCleanup: indentation
Campbell Barton [Tue, 16 Jan 2018 00:40:43 +0000 (11:40 +1100)]
Cleanup: indentation

3 years agoUI: support canceling color ramp drag
Campbell Barton [Tue, 16 Jan 2018 00:14:54 +0000 (11:14 +1100)]
UI: support canceling color ramp drag

D2997 by @oktomus

3 years agoFix collection visibility evaluation
Dalai Felinto [Mon, 15 Jan 2018 22:08:50 +0000 (20:08 -0200)]
Fix collection visibility evaluation

Collection       A [disabled]
 -> Collection   B
   -> Collection C
     -> object

Object should be invisible, but it is not. Reported by Antonio Vazquez.

Bug introduced on: 1f5106de610b

3 years agoFix crash in outliner when moving objects around
Dalai Felinto [Mon, 15 Jan 2018 21:06:30 +0000 (19:06 -0200)]
Fix crash in outliner when moving objects around

How to reproduce it:
* Change Outliner from Active View Layer to Collections
* Create a new collection under Master Collection (Collection 2)
* Move all three objects from Collection 1 to Collection 2
* Move all three objects from Collection 2 to Collection 1

3 years agoOutliner/Collections: Fix objects disappearing when moving to collections
Dalai Felinto [Mon, 15 Jan 2018 20:27:50 +0000 (18:27 -0200)]
Outliner/Collections: Fix objects disappearing when moving to collections

Bug introduced on fb4cd136a7c (multi-object drag-and-drop).

How to reproduce the bug:
* Create a new collection
* Move the Cube to the new collection
* Move the Camera to the new collection (Cube disappears)
* Move the Lamp to the new collection (Camera disappears)

Explanation of the bug:
The moved object was still selected, so we were trying to add the object to the
collection were the object was already inserted (which would fail silently) and
then remove it.

3 years agoFix: Mesh Edit Mode Shader: Correct artifacts that appeared on edges of edit mode...
Germano [Mon, 15 Jan 2018 18:29:41 +0000 (16:29 -0200)]
Fix: Mesh Edit Mode Shader: Correct artifacts that appeared on edges of edit mode with some AMD GPUs

In case the problem appeared with the `AMD Radeon HD 7570M`

3 years agoFix unreported: Eevee Principled Shader: Crash because Intel does not like dead code
Germano [Mon, 15 Jan 2018 15:49:50 +0000 (13:49 -0200)]
Fix unreported: Eevee Principled Shader: Crash because Intel does not like dead code

The reason for the crash is still a bit confusing, but on Windows with Intel HD Graphics 4000 it always happens when you enable `Use Nodes` or when you try to connect the Pricipled Shader node to the output without the `Subsurface Scattering` and `Subsurface Translucency` options enabled.

3 years agoGPU Texture: Add GL_RG16I format.
Clément Foucault [Sat, 13 Jan 2018 16:14:01 +0000 (17:14 +0100)]
GPU Texture: Add GL_RG16I format.

3 years agoGPU_batch_from_poly_2d_encoded: skip winding check
Campbell Barton [Mon, 15 Jan 2018 13:59:52 +0000 (00:59 +1100)]
GPU_batch_from_poly_2d_encoded: skip winding check

Ensure all polygons have the same winding instead.

3 years agoGPU_batch_from_poly_2d_encoded: optional rctf arg
Campbell Barton [Mon, 15 Jan 2018 13:06:39 +0000 (00:06 +1100)]
GPU_batch_from_poly_2d_encoded: optional rctf arg

Also use compiler attributes

3 years agoCleanup: update comments
Campbell Barton [Mon, 15 Jan 2018 12:44:19 +0000 (23:44 +1100)]
Cleanup: update comments

3 years agoMerge branch 'master' into blender2.8
Sergey Sharybin [Mon, 15 Jan 2018 12:55:52 +0000 (13:55 +0100)]
Merge branch 'master' into blender2.8

3 years agoAllow for multi-gigapixel renders
Karl Semich [Mon, 15 Jan 2018 11:53:17 +0000 (12:53 +0100)]
Allow for multi-gigapixel renders

This patch fixes a 32-bit overflow that occurs on 64-bit systems due to a numeric literal being treated as 32-bit.

This patch allows for the generation of images that occupy more than 4GB of RAM, which previously caused a crash.

Reviewers: sergey

Reviewed By: sergey

Differential Revision:

3 years agoCycles: CLeanup, remove unused function argument
Sergey Sharybin [Mon, 15 Jan 2018 10:45:16 +0000 (11:45 +0100)]
Cycles: CLeanup, remove unused function argument

3 years agoSculpting: Sdd an option to hide mask in viewport
Sergey Sharybin [Mon, 15 Jan 2018 10:38:56 +0000 (11:38 +0100)]
Sculpting: Sdd an option to hide mask in viewport

Brushes themselves are still affected by the mask, but the viewport is not
showing the mask. This way it's easier to see details while sculpting.

Studio request by Julien Kaspar

3 years agoGPU buffers: Use bitflag to whether we want to show diffuse color
Sergey Sharybin [Fri, 12 Jan 2018 16:35:26 +0000 (17:35 +0100)]
GPU buffers: Use bitflag to whether we want to show diffuse color

Those fine-tuning bits will be extended soon, so makes sense to start using
some more verbose flag names when calling functions.

3 years agoManipulator: vector icons for 3D view navigation
Campbell Barton [Mon, 15 Jan 2018 09:46:42 +0000 (20:46 +1100)]
Manipulator: vector icons for 3D view navigation

Use different icons for perspective/ortho state
(previous icon was place-holder).

3 years agoManipulator: support for buttons as vector shapes
Campbell Barton [Mon, 15 Jan 2018 09:40:57 +0000 (20:40 +1100)]
Manipulator: support for buttons as vector shapes

3 years agoGPU_batch: Add utility to create 2D shapes
Campbell Barton [Mon, 15 Jan 2018 09:38:06 +0000 (20:38 +1100)]
GPU_batch: Add utility to create 2D shapes

Shapes are represented by compact byte array,
encoded by '' in the tools repo.

3 years agoGPU_batch_presets: move static vars into struct
Campbell Barton [Mon, 15 Jan 2018 05:52:28 +0000 (16:52 +1100)]
GPU_batch_presets: move static vars into struct

Also use GWN raw stepping API to fill in data.

3 years agoCleanup: split GPU_batch_presets into own file
Campbell Barton [Mon, 15 Jan 2018 05:21:23 +0000 (16:21 +1100)]
Cleanup: split GPU_batch_presets into own file

Mixing other batch code in this file easily shadowed existing variables.
Keep presets separate (we may have more, 2D & 3D presets)

3 years agoManipulator: add free callback
Campbell Barton [Mon, 15 Jan 2018 05:06:56 +0000 (16:06 +1100)]
Manipulator: add free callback

3 years agoMerge branch 'master' into blender2.8
Campbell Barton [Mon, 15 Jan 2018 04:59:59 +0000 (15:59 +1100)]
Merge branch 'master' into blender2.8

3 years agoRNA: Add RNA_property_string_set_bytes
Campbell Barton [Mon, 15 Jan 2018 04:49:16 +0000 (15:49 +1100)]
RNA: Add RNA_property_string_set_bytes

This is needed to set values that contain zero bytes
(where the length isn't fixed).

3 years agoCleanup: correct names
Campbell Barton [Sun, 14 Jan 2018 06:54:27 +0000 (17:54 +1100)]
Cleanup: correct names

3 years agoMerge branch 'master' into blender2.8
Campbell Barton [Sun, 14 Jan 2018 06:29:38 +0000 (17:29 +1100)]
Merge branch 'master' into blender2.8

3 years agoCleanup: BLI_ghash
Campbell Barton [Sun, 14 Jan 2018 06:15:02 +0000 (17:15 +1100)]
Cleanup: BLI_ghash

Improve hashsizes comment too.

3 years agoFix T53772: Presets don't support colons
Campbell Barton [Sun, 14 Jan 2018 03:31:39 +0000 (14:31 +1100)]
Fix T53772: Presets don't support colons

3 years agoMerge branch 'blender2.8' of into blender2.8
Germano [Sat, 13 Jan 2018 03:13:37 +0000 (01:13 -0200)]
Merge branch 'blender2.8' of into blender2.8

3 years agoMerge branch 'master' into blender2.8
Brecht Van Lommel [Sat, 13 Jan 2018 01:05:49 +0000 (02:05 +0100)]
Merge branch 'master' into blender2.8

3 years agoFix T53771: missing view pixels when rendering multiview + FSAA.
Brecht Van Lommel [Fri, 12 Jan 2018 22:47:24 +0000 (23:47 +0100)]
Fix T53771: missing view pixels when rendering multiview + FSAA.

This never worked, it's not due to recent refactoring.

3 years agoCycles: adaptive subdivision support for panoramic cameras.
Mai Lavelle [Fri, 12 Jan 2018 01:14:27 +0000 (02:14 +0100)]
Cycles: adaptive subdivision support for panoramic cameras.

Adds the code to get screen size of a point in world space, which is
used for subdividing geometry to the correct level. The approximate
method of treating the point as if it were directly in front of the
camera is used, as panoramic projections can become very distorted
near the edges of an image. This should be fine for most uses.

There is also no support yet for offscreen dicing scale, though
panorama cameras are often used for rendering 360° renders anyway.

Fixes T49254.

Differential Revision:

3 years agoCode refactor: adjust camera update for easier code sharing with kernel.
Brecht Van Lommel [Fri, 12 Jan 2018 19:22:55 +0000 (20:22 +0100)]
Code refactor: adjust camera update for easier code sharing with kernel.

3 years agoCode cleanup: remove test code to disable motion blur, no longer useful.
Brecht Van Lommel [Fri, 12 Jan 2018 18:56:52 +0000 (19:56 +0100)]
Code cleanup: remove test code to disable motion blur, no longer useful.

3 years agoDraw Manager: Edit Mode Shader: Remove `#ifdef GPU_INTEL`
Germano [Fri, 12 Jan 2018 17:09:13 +0000 (15:09 -0200)]
Draw Manager: Edit Mode Shader: Remove `#ifdef GPU_INTEL`

The problem with memory alignment on Intel GPUs does not happen anymore after the last shader changes.

3 years agoEevee: Fix motion blur alpha being > 1.0
Clément Foucault [Fri, 12 Jan 2018 14:57:21 +0000 (15:57 +0100)]
Eevee: Fix motion blur alpha being > 1.0

3 years agoEevee: Fix Motion blur not working in OGL render.
Clément Foucault [Fri, 12 Jan 2018 14:56:29 +0000 (15:56 +0100)]
Eevee: Fix Motion blur not working in OGL render.

Thanks to @sergey for the patch.

Also include some sexy line breaks.

3 years agoFix T53759: Cycles / 2.8: Light position doesnt update in viewport render
Sergey Sharybin [Thu, 11 Jan 2018 15:04:29 +0000 (16:04 +0100)]
Fix T53759: Cycles / 2.8: Light position doesnt update in viewport render

3 years agoOutliner: Harmless cleanup
Dalai Felinto [Fri, 12 Jan 2018 11:04:37 +0000 (09:04 -0200)]
Outliner: Harmless cleanup

There is even a chance the compilers handles this itself, but we should try to
use the internal storage as much as possible (and save 0.000001s in the process)

3 years agoFix bmesh.utils.face_join arg parsing
Campbell Barton [Fri, 12 Jan 2018 03:51:15 +0000 (14:51 +1100)]
Fix bmesh.utils.face_join arg parsing

3 years agoUser Prefs: app-template option to hide the cursor
Campbell Barton [Fri, 12 Jan 2018 01:41:03 +0000 (12:41 +1100)]
User Prefs: app-template option to hide the cursor

3 years agoUser Prefs: add new flag for app-template options
Campbell Barton [Fri, 12 Jan 2018 01:30:58 +0000 (12:30 +1100)]
User Prefs: add new flag for app-template options

For experimental options, outside the scope of typical preferences.

While templates are developed we might want to make changes
to behavior which aren't fully compatible with typical work-flows.

Instead of mixing these options in with current preferences
expose separately (we could even force disable them when templates
aren't int use)

3 years agoCycles: option to make background visible through glass transparent.
Lukas Stockner [Thu, 11 Jan 2018 19:03:31 +0000 (20:03 +0100)]
Cycles: option to make background visible through glass transparent.

This can be enabled in the Film panel, with an option to control the
transmisison roughness below which glass becomes transparent.

Differential Revision:

3 years agoCycles: add offscreen dicing scale and dicing camera.
Mai Lavelle [Thu, 11 Jan 2018 23:50:34 +0000 (00:50 +0100)]
Cycles: add offscreen dicing scale and dicing camera.

The offscreen dicing scale helps to significantly reduce memory usage,
by reducing the dicing rate for objects the further they are outside of
the camera view.

The dicing camera can be specified now, to keep the geometry fixed and
avoid crawling artifacts in animation. It is also useful for debugging,
to see the tesselation from a different camera location.

Differential Revision:

3 years agoFix T53764: vertical line glitch for collections with objects and collections
Dalai Felinto [Thu, 11 Jan 2018 19:17:17 +0000 (17:17 -0200)]
Fix T53764: vertical line glitch for collections with objects and collections

The code for vertical line was assuming that we necessarily neeeded vertical
lines for all the elements. Which is not true since we are not drawing
vertical and horizontal lines for collections.

Patch made in contribution with Philippe Schmid (@Quetzal).

3 years agoFix Cycles bevel normal baking having some random incorrect pixels.
Brecht Van Lommel [Thu, 11 Jan 2018 21:25:40 +0000 (22:25 +0100)]
Fix Cycles bevel normal baking having some random incorrect pixels.

The bevel and SSS code could result in NaNs in some cases, tweak the
formulas so this can't happen.

3 years agoBuild: auto detection of libraries built by "make deps" on Linux.
Brecht Van Lommel [Mon, 31 Jul 2017 17:04:18 +0000 (19:04 +0200)]
Build: auto detection of libraries built by "make deps" on Linux.

Use the libraries if they exist in ../lib/linux_x86_64 or similar, so
that you can run "make deps && make full" to get a full static build.
Note that is still the only officially supported way to
build Blender dependencies on Linux, but this may be useful to some.

Differential Revision:

3 years agoEdit Mode Overlay Shaders: remove loose comment left by last commit
Germano [Thu, 11 Jan 2018 20:28:11 +0000 (18:28 -0200)]
Edit Mode Overlay Shaders: remove loose comment left by last commit

3 years agoFix error weird sliding vertices appearing in edit mode with some Intel GPUs
Germano [Thu, 11 Jan 2018 20:07:41 +0000 (18:07 -0200)]
Fix error weird sliding vertices appearing in edit mode with some Intel GPUs

Appear when zooming

3 years agoMerge branch 'master' into blender2.8
Bastien Montagne [Thu, 11 Jan 2018 19:19:18 +0000 (20:19 +0100)]
Merge branch 'master' into blender2.8


3 years agoCleanup commented out OMP command.
Bastien Montagne [Thu, 11 Jan 2018 19:17:29 +0000 (20:17 +0100)]
Cleanup commented out OMP command.

3 years agoNuke OMP from multires.c: forgot that one in previous commit.
Bastien Montagne [Thu, 11 Jan 2018 19:14:16 +0000 (20:14 +0100)]
Nuke OMP from multires.c: forgot that one in previous commit.

Gives same kind of speedup too, 8.7ms with old OMP code, 2.7ms with new
one, with same level-4 multires monkey head.

3 years agoNuke OMP usage in multires.c.
Bastien Montagne [Thu, 11 Jan 2018 18:39:24 +0000 (19:39 +0100)]
Nuke OMP usage in multires.c.

New code is over three times quicker than old one here (e.g. Suzanne
subdiv level 4, 250k tris, threaded part is now 1.4ms instead of 4.5ms
with OMP).

3 years agoDRW: Fix T53583 Armature instances not drawing.
Clément Foucault [Thu, 11 Jan 2018 18:35:56 +0000 (19:35 +0100)]
DRW: Fix T53583 Armature instances not drawing.

Was due to the fact that the instances don't have a "static" obmat that can be referenced to use as a uniform.
Solution : precompute the full matrix for each bone and pass it as instance data. (theses are copied into a buffer and can be discarded right away)

Note: this could be optimized further and make only one drawcall (shgroup) to draw all bone instance of one type (vs. one call per armature).

3 years agoFix T53340: Outliner collections collapsing when UNDO
Dalai Felinto [Thu, 11 Jan 2018 18:02:12 +0000 (16:02 -0200)]
Fix T53340: Outliner collections collapsing when UNDO

This is not the original reported issue, but it is a second issye mentioned
that, the only one reminding.

3 years agoFix T51576: Blender crash when change to edit mode with some Intel GPUs
Germano [Thu, 11 Jan 2018 17:58:20 +0000 (15:58 -0200)]
Fix T51576: Blender crash when change to edit mode with some Intel GPUs

Differential Revision: D2995

3 years agoPreparation step for nuking OMP from multires code.
Bastien Montagne [Thu, 11 Jan 2018 16:56:18 +0000 (17:56 +0100)]
Preparation step for nuking OMP from multires code.

Remove the critical OMP sections used to protect mem allocation.

First one can be done in a separate loop before main, parallelized one.

Second one only affect 'private' data, so we only need to ensure
guardedalloc thread safety is enabled.

This is committed as separated step to ease troubleshooting in case
bisecting becomes necesary.

3 years agoCleanup typo in comment.
Bastien Montagne [Thu, 11 Jan 2018 16:55:58 +0000 (17:55 +0100)]
Cleanup typo in comment.

3 years agoEevee: DoF: Fix most color artifacts in render.
Clément Foucault [Thu, 11 Jan 2018 14:14:26 +0000 (15:14 +0100)]
Eevee: DoF: Fix most color artifacts in render.

Use full 32bit floats buffers. This increase render time but also color fidelity.

3 years agoEevee: Fix Depth of Field.
Clément Foucault [Thu, 11 Jan 2018 14:11:59 +0000 (15:11 +0100)]
Eevee: Fix Depth of Field.

It was using a wrong blending function.

3 years agoEevee: Lamps: Optimize lamps CPU/Memory usage.
Clément Foucault [Thu, 11 Jan 2018 13:08:21 +0000 (14:08 +0100)]
Eevee: Lamps: Optimize lamps CPU/Memory usage.

Tests on my system with ~1200 objects with 128 shadow casting lamps (current max) show a significant perf improvment (cache timing : 22ms -> 9ms)
With a baseline with no shadow casting light at 6ms this give a reduction of the overhead from 16ms to 3ms.

This remove pretty much all allocations during the cache phase. Leading to a big improvement for scene with a large number of lights & shadowcasters.
The lamps storage has been replace by a union to remove the need to free/allocate everyframe (also reducing memory fragmentation).

We replaced the linked list system used to track shadow casters by a huge bitflag.
We gather the lights shadows bounds as well as the shadow casters AABB during the cache populate phase and put them in big arrays cache friendly.

Then in the cache finish phase, it's easier to iterate over the lamps shadow SphereBounds and test for intersection.

We use a double buffer system for the shadow casters arrays to detect deleted shadow casters.
Unfortunatly, it seems that deleting an object trigger an update for all other objects (thus tagging most shadow casting lamps to update), defeating the purpose of this tracking.
This needs further investigation.

3 years agoFix poll and name of collection link/unlink operators
Dalai Felinto [Thu, 11 Jan 2018 14:43:57 +0000 (12:43 -0200)]
Fix poll and name of collection link/unlink operators

Reported via IRC by Pablo Vazquez (venomgfx).

3 years agoMerge branch 'master' into blender2.8
Sergey Sharybin [Thu, 11 Jan 2018 14:14:30 +0000 (15:14 +0100)]
Merge branch 'master' into blender2.8

3 years agoSubsurf: Allow partial threading over geometry arrays
Sergey Sharybin [Thu, 11 Jan 2018 14:06:56 +0000 (15:06 +0100)]
Subsurf: Allow partial threading over geometry arrays

This helps avoiding threading overhead when having lots of system threads..

3 years agoMesh evaluate: Tweak threadability criteria
Sergey Sharybin [Thu, 11 Jan 2018 14:04:13 +0000 (15:04 +0100)]
Mesh evaluate: Tweak threadability criteria

Gives measurable speedup on layout scenes from Spring.

Actual value for chunk size is a subject for more scientific research.

3 years agoMesh deform: Tweak threadability criteria
Sergey Sharybin [Thu, 11 Jan 2018 13:51:30 +0000 (14:51 +0100)]
Mesh deform: Tweak threadability criteria

Allow threading using subset of all available threads. Makes it faster to
evaluate lower resolution mesh but with complex deform groups and such.

3 years agoSubsurf: Make copyFinalLoopArray() threaded
Sergey Sharybin [Thu, 11 Jan 2018 13:49:32 +0000 (14:49 +0100)]
Subsurf: Make copyFinalLoopArray() threaded

Gives about 40% speedup of object which has simple-ish deformation applied
on top of subdivided mesh.

This might easily happen with single character animation.

3 years agoDepsgraph: Make eval initialization more friendly for threading
Sergey Sharybin [Thu, 11 Jan 2018 13:47:12 +0000 (14:47 +0100)]
Depsgraph: Make eval initialization more friendly for threading

Helps in cases of not very complex scenes and lots of system threads available.

A bit hard to measure change on it's own, it works best with the upcoming
changes and gives measurable improvements.

3 years agoSubsurf: Use regular mutex instead of RW one
Sergey Sharybin [Thu, 11 Jan 2018 13:32:56 +0000 (14:32 +0100)]
Subsurf: Use regular mutex instead of RW one

Mutex is now local to particular CCGDM, and guarding edge hash which is only
used by a single function only. There is no need to acquire read lock after
edge hash was created.

3 years agoMerge branch 'master' into blender2.8
Bastien Montagne [Thu, 11 Jan 2018 13:35:36 +0000 (14:35 +0100)]
Merge branch 'master' into blender2.8


3 years agoFix critical issue with our DNA ID tags (two totally different tags having same value).
Bastien Montagne [Thu, 11 Jan 2018 13:26:44 +0000 (14:26 +0100)]
Fix critical issue with our DNA ID tags (two totally different tags having same value).

Nice typo from rBc4046e9082f6, tssk. ;)

3 years agoFix static override (very stupid mistakes in code!)
Bastien Montagne [Thu, 11 Jan 2018 11:29:09 +0000 (12:29 +0100)]
Fix static override (very stupid mistakes in code!)

3 years agoFurther fixes to new RNA props diff code.
Bastien Montagne [Thu, 11 Jan 2018 08:38:27 +0000 (09:38 +0100)]
Further fixes to new RNA props diff code.

Unfortunately, we cannot perform set/unset checks on 'resolved'
properties (i.e. from actual IDProperties pointers, and not virtual RNA
placeholders)... IDProps in RNA are rather challenging topic. :|

This should fully fix T53715: 2.8: Removing keymap items no longer works

3 years agoFix T53311: transform edge/normal orientation
Campbell Barton [Thu, 11 Jan 2018 08:09:45 +0000 (19:09 +1100)]
Fix T53311: transform edge/normal orientation

When the edge is aligned with it's own normals,
transform orientation wasn't aligned with the edge.

3 years agoFix T53755: Cycles OpenCL lamp shaders have incorrect normal.
Brecht Van Lommel [Thu, 11 Jan 2018 07:42:57 +0000 (08:42 +0100)]
Fix T53755: Cycles OpenCL lamp shaders have incorrect normal.