blender.git
2 years agoMerge branch 'master' into blender2.8
Bastien Montagne [Thu, 12 Oct 2017 14:40:35 +0000 (16:40 +0200)]
Merge branch 'master' into blender2.8

Conflicts:
source/blender/editors/screen/screen_edit.c

2 years agoFix T53052: ID decrement error when deleting a scene, either python or GUI.
Bastien Montagne [Thu, 12 Oct 2017 13:54:43 +0000 (15:54 +0200)]
Fix T53052: ID decrement error when deleting a scene, either python or GUI.

User count of scenes was inconsistant, screens only have 'user_one' kind
of owning over scenes, which means they shall never increment or
decrement their real user count. And usually, scenes have no real user
at all.

2 years agoFix T52999: floating (popup) panels/menus could jump around screen in some cases.
Bastien Montagne [Thu, 12 Oct 2017 12:43:45 +0000 (14:43 +0200)]
Fix T52999: floating (popup) panels/menus could jump around screen in some cases.

Would happen during panel's refresh drawing, if drawing code had to adjust
final panel position compared to the initial one computed based on the
mouse coordinates, and user had dragged the floating panel around.

Issue fixed by adjusting stored mouse coordinates once final panel
position is known, such that they would directly generate those
coordinates. that way, the basic offset applied to those stored mouse
coordinates during panel dragging is valid, and recreating panel based
on those won't make it jump in screen.

Note that panel will still jump in case user dragged it partially out of
view - we could prevent that, but imho it's better to keep that
behavior, since redraw can generate a popup of different size, which
could end up with a totally out-of-view one...

Hopefully this fix does not break anything else!

2 years agoDocs: add note for bmesh face_split_edgenet
Campbell Barton [Thu, 12 Oct 2017 11:46:04 +0000 (22:46 +1100)]
Docs: add note for bmesh face_split_edgenet

2 years agoObject Mode: Grid: Add a non-hard depth test.
Clément Foucault [Thu, 12 Oct 2017 02:03:42 +0000 (04:03 +0200)]
Object Mode: Grid: Add a non-hard depth test.

This adds a custom depth test that have the benefits to glitch less and be more visually pleasing.
Downside is that it let the grid pass trough the objects a little.

This effect is done in NDC space so that it counteract the logarithmic depth distribution imprecision (read as it's less visible near the camera but more present far away).

This patch also includes some cleanups.

2 years agoFix T53048: OSL Volume is broken in Blender 2.79
Sergey Sharybin [Wed, 11 Oct 2017 10:21:26 +0000 (15:21 +0500)]
Fix T53048: OSL Volume is broken in Blender 2.79

Was a mistake in optimization commit which was disconnecting closures and nodes
which does not make sense for volume output.

OSL script we can't ignore and can't currently know in advance if it's a proper
volume shader or not. So we never disconnect OSL nodes from volume output.

This is a good candidate for corrective release.

2 years agoCycles: Speedup up tangent space calculation
Sergey Sharybin [Fri, 25 Aug 2017 20:26:04 +0000 (22:26 +0200)]
Cycles: Speedup up tangent space calculation

This patch goes away form using C++ RNA during tangent space calculation which
avoids quite a bit of overhead. Now all calculation is done using data which
already exists in ccl::Mesh. This means, tangent space is now calculated from
triangles, which doesn't seem to be any different (at least as far as regression
tests are concerned).

One of the positive sides is that this change makes it possible to move tangent
space calculation from blender/ to render/ so we will have Cycles standalone
supporting tangent space.

Reviewers: brecht, lukasstockner97, campbellbarton

Differential Revision: https://developer.blender.org/D2810

2 years agoCycles: Add utility function to calculate triangle's normal
Sergey Sharybin [Tue, 10 Oct 2017 08:12:06 +0000 (13:12 +0500)]
Cycles: Add utility function to calculate triangle's normal

2 years agoCycles: Add utility function to remove given attribute
Sergey Sharybin [Fri, 25 Aug 2017 20:51:44 +0000 (22:51 +0200)]
Cycles: Add utility function to remove given attribute

2 years agoMerge branch 'master' into blender2.8
Sergey Sharybin [Wed, 11 Oct 2017 08:14:16 +0000 (13:14 +0500)]
Merge branch 'master' into blender2.8

2 years agoCycles: Fix possible race condition when initializing devices list
Sergey Sharybin [Wed, 11 Oct 2017 07:48:19 +0000 (12:48 +0500)]
Cycles: Fix possible race condition when initializing devices list

2 years agoCycles tests: Don't proint braces for empty status
Sergey Sharybin [Tue, 10 Oct 2017 14:58:37 +0000 (19:58 +0500)]
Cycles tests: Don't proint braces for empty status

2 years agoGawain: Fix instancing messing next draw.
Clément Foucault [Wed, 11 Oct 2017 00:14:15 +0000 (02:14 +0200)]
Gawain: Fix instancing messing next draw.

Everything was fine if one batch is always used with instancing. But problem arise if the next drawcall for this batch is not using instancing as the attrib divisor stays set to 1 in th VAO.

As instancing is less used than normal drawing I prefer to reset the divisor after drawing as it is reset before drawing instances.

2 years agoEevee: Probe: Add Cubemap Resolution option.
Clément Foucault [Tue, 10 Oct 2017 19:56:11 +0000 (21:56 +0200)]
Eevee: Probe: Add Cubemap Resolution option.

2 years agoEevee: Fix light grid being rendered after delete.
Clément Foucault [Tue, 10 Oct 2017 17:21:32 +0000 (19:21 +0200)]
Eevee: Fix light grid being rendered after delete.

2 years agoEevee: Fix TAA color drifting.
Clément Foucault [Tue, 10 Oct 2017 16:32:05 +0000 (18:32 +0200)]
Eevee: Fix TAA color drifting.

This was caused by small float precision being insuficient. The blue component of R11F_G11F_B10F has lower precision than the other 2 components. This resulted in colors drifting towards a yellowish tone.

Using RGBA16F for the concerned buffer. This double the memory usage of the framebuffers and add subsequent bandwidth usage.

2 years agoEevee : Add a workaround for bug with AMD RX VEGA Linux + Mesa Driver
Clément Foucault [Tue, 10 Oct 2017 15:18:29 +0000 (17:18 +0200)]
Eevee : Add a workaround for bug with AMD RX VEGA Linux + Mesa Driver

This bug (explained here https://github.com/dfelinto/opengl-sandbox/blob/downsample/README.md) is breaking eevee beyond the point it's workable.

This patch workaround the issue by making sure every fbo have mipmaps that are strictly greater than 16px. This break the bloom visuals a bit but only for this setup.

2 years agoEevee: Fix hashed and alpha clip transparency.
Clément Foucault [Tue, 10 Oct 2017 14:41:13 +0000 (16:41 +0200)]
Eevee: Fix hashed and alpha clip transparency.

2 years agoEevee : SSR : Fix incorrect framebuffer issue.
Clément Foucault [Tue, 10 Oct 2017 14:40:30 +0000 (16:40 +0200)]
Eevee : SSR : Fix incorrect framebuffer issue.

It was cause by a texture without mipmap levels.

2 years agoFix T53040: Vertex paint, texure & symmetry fail
Campbell Barton [Tue, 10 Oct 2017 12:23:53 +0000 (23:23 +1100)]
Fix T53040: Vertex paint, texure & symmetry fail

Removed old logic for brush texture which was being applied twice.

2 years agoVertex Paint: add back missing VertProjHandle free
Campbell Barton [Tue, 10 Oct 2017 11:32:30 +0000 (22:32 +1100)]
Vertex Paint: add back missing VertProjHandle free

Also avoid passing large struct as value.

2 years agoCorrect logic for vertex paint smear
Campbell Barton [Tue, 10 Oct 2017 09:25:11 +0000 (20:25 +1100)]
Correct logic for vertex paint smear

Swapping gave values from the state before the last.
Thanks to @angavrilov for spotting.

2 years agoFix Sculpt 2D falloff, missing brush caused crash
Campbell Barton [Tue, 10 Oct 2017 08:49:31 +0000 (19:49 +1100)]
Fix Sculpt 2D falloff, missing brush caused crash

2 years agoCycles: Fix compilation of sm_20 and sm_21 kernels
Sergey Sharybin [Tue, 10 Oct 2017 07:26:02 +0000 (12:26 +0500)]
Cycles: Fix compilation of sm_20 and sm_21 kernels

Was broken since the bicubic commit for GPU support.

2 years agoManipulator: add cage3d scale widget
Campbell Barton [Mon, 9 Oct 2017 16:08:53 +0000 (03:08 +1100)]
Manipulator: add cage3d scale widget

For now only show this when scale manipulator is active.

2 years agoRecent check for navigation missed NULL check
Campbell Barton [Mon, 9 Oct 2017 15:43:56 +0000 (02:43 +1100)]
Recent check for navigation missed NULL check

2 years agoFix T53014: Cycles material preview not working
Dalai Felinto [Mon, 9 Oct 2017 14:41:14 +0000 (11:41 -0300)]
Fix T53014: Cycles material preview not working

This was introduced on 9ad2c0b6154 and partly mended on 8a1d787b89.

2 years agoMerge branch 'master' into blender2.8
Campbell Barton [Mon, 9 Oct 2017 14:36:36 +0000 (01:36 +1100)]
Merge branch 'master' into blender2.8

2 years agoUI: VSE strip menu reorganization
Aaron Carlisle [Mon, 9 Oct 2017 02:47:05 +0000 (13:47 +1100)]
UI: VSE strip menu reorganization

Add Inputs and Transform submenus.

2 years agoCycles: schedule more work for non-display and compute preemption CUDA cards.
Brecht Van Lommel [Sun, 8 Oct 2017 17:08:44 +0000 (19:08 +0200)]
Cycles: schedule more work for non-display and compute preemption CUDA cards.

This change affects CUDA GPUs not connected to a display or connected to a
display but supporting compute preemption so that the display does not
freeze. I couldn't find an official list, but compute preemption seems to be
only supported with GTX 1070+ and Linux (not GTX 1060- or Windows).

This helps improve small tile rendering performance further if there are
sufficient samples x number of pixels in a single tile to keep the GPU busy.

2 years agoFix T53017: Cycles not detecting AMD GPU when there is an NVidia GPU too.
Mathieu Menuet [Sun, 8 Oct 2017 16:20:55 +0000 (18:20 +0200)]
Fix T53017: Cycles not detecting AMD GPU when there is an NVidia GPU too.

Best guess is that cuInit() somehow interferes with the AMD graphics driver
on Windows, and switching the initialization order to do OpenCL first seems
to solve the issue.

2 years agoEevee: Fix bad defines for volumetric shadowing
Clément Foucault [Sun, 8 Oct 2017 16:23:45 +0000 (18:23 +0200)]
Eevee: Fix bad defines for volumetric shadowing

2 years agoFix potential string buffer overruns.
Bastien Montagne [Sun, 8 Oct 2017 14:08:00 +0000 (16:08 +0200)]
Fix potential string buffer overruns.

Note that our library path handling is still rather dodgy on this
regards, shall take some time at some point to seriously sanitize it...

2 years agoGawain: Make common uniforms become builtins
Clément Foucault [Sun, 8 Oct 2017 13:49:25 +0000 (15:49 +0200)]
Gawain: Make common uniforms become builtins

This improves eevee's cache performance by 13% in my test.

2 years agoCode refactor: use DeviceInfo to enable QBVH and decoupled volume shading.
Brecht Van Lommel [Sun, 8 Oct 2017 02:32:25 +0000 (04:32 +0200)]
Code refactor: use DeviceInfo to enable QBVH and decoupled volume shading.

2 years agoCleanup: --help text
Campbell Barton [Sun, 8 Oct 2017 07:46:26 +0000 (18:46 +1100)]
Cleanup: --help text

Sync with manual

2 years agoCMake: Re-order PYTHON_VERSION check
Campbell Barton [Sun, 8 Oct 2017 03:00:42 +0000 (14:00 +1100)]
CMake: Re-order PYTHON_VERSION check

Missing paths would error first.

2 years agoCycles: OpenCL bicubic and tricubic texture interpolation support.
Brecht Van Lommel [Sun, 8 Oct 2017 00:36:05 +0000 (02:36 +0200)]
Cycles: OpenCL bicubic and tricubic texture interpolation support.

2 years agoFix incorrect MIS with principled BSDF and specular roughness 0.
Brecht Van Lommel [Sat, 7 Oct 2017 19:43:36 +0000 (21:43 +0200)]
Fix incorrect MIS with principled BSDF and specular roughness 0.

2 years ago[cmake] Add minimum python version check to cmake to prevent later build errors.
Ray Molenkamp [Sat, 7 Oct 2017 13:57:19 +0000 (07:57 -0600)]
[cmake] Add minimum python version check to cmake to prevent later build errors.

2 years agoCode cleanup: simplify cmake kernel install.
Brecht Van Lommel [Sat, 7 Oct 2017 12:08:02 +0000 (14:08 +0200)]
Code cleanup: simplify cmake kernel install.

2 years agoCycles: CUDA bicubic and tricubic texture interpolation support.
Brecht Van Lommel [Sat, 7 Oct 2017 00:15:12 +0000 (02:15 +0200)]
Cycles: CUDA bicubic and tricubic texture interpolation support.

While cubic interpolation is quite expensive on the CPU compared to linear
interpolation, the difference on the GPU is quite small.

2 years agoCode refactor: make texture code more consistent between devices.
Brecht Van Lommel [Fri, 6 Oct 2017 19:47:41 +0000 (21:47 +0200)]
Code refactor: make texture code more consistent between devices.

* Use common TextureInfo struct for all devices, except CUDA fermi.
* Move image sampling code to kernels/*/kernel_*_image.h files.
* Use arrays for data textures on Fermi too, so device_vector<Struct> works.

2 years agoActually force accumulate mode for the Smear brush in weight/vertex paint.
Alexander Gavrilov [Sat, 7 Oct 2017 10:53:54 +0000 (13:53 +0300)]
Actually force accumulate mode for the Smear brush in weight/vertex paint.

Just removing the checkbox from UI isn't enough for proper behavior.

2 years agoMake weight paint blur thread safe, and fix smear ignoring mirror.
Alexander Gavrilov [Sat, 7 Oct 2017 09:45:21 +0000 (12:45 +0300)]
Make weight paint blur thread safe, and fix smear ignoring mirror.

Instead of trying to be clever with swaps and lazy updating the weight
data, simply recalculate one single array. To improve performance, use
threading for that.

2 years agoCleanup: style, duplicate includes
Campbell Barton [Sat, 7 Oct 2017 04:57:14 +0000 (15:57 +1100)]
Cleanup: style, duplicate includes

2 years agoCleanup: remove Py3.5 compatible code
Campbell Barton [Sat, 7 Oct 2017 04:14:36 +0000 (15:14 +1100)]
Cleanup: remove Py3.5 compatible code

2 years agoInitial fix for T53014: Cycles material preview no light
Dalai Felinto [Fri, 6 Oct 2017 21:54:27 +0000 (18:54 -0300)]
Initial fix for T53014: Cycles material preview no light

This was introduced on 9ad2c0b6154.

Although this still doesn't fix the issue, it updates the preview
system to use COLLECTION_DISABLED as intended.

What is missing now is for the flushing to work effectively.

2 years agoEevee: Shadows: Add Contact Shadows
Clément Foucault [Fri, 6 Oct 2017 21:43:36 +0000 (23:43 +0200)]
Eevee: Shadows: Add Contact Shadows

This add the possibility to add screen space raytraced shadows to fix light leaking cause by shadows maps.

Theses inherit of the same artifacts as other screenspace methods.

2 years agoEevee: Modify the raycast function to be more flexible.
Clément Foucault [Fri, 6 Oct 2017 21:38:31 +0000 (23:38 +0200)]
Eevee: Modify the raycast function to be more flexible.

Make quality a parameter, and modify the ray end to be premultiplied so that the raytrace is done on a range.

This is in order to add contact shadows.

2 years agoMerge remote-tracking branch 'origin/master' into blender2.8
Dalai Felinto [Fri, 6 Oct 2017 16:09:24 +0000 (13:09 -0300)]
Merge remote-tracking branch 'origin/master' into blender2.8

2 years agoCycles: Fix possible race condition when generating Beckmann table
Sergey Sharybin [Fri, 6 Oct 2017 16:06:15 +0000 (21:06 +0500)]
Cycles: Fix possible race condition when generating Beckmann table

Two issues here:

- Checking table size to be non-zero is not a proper way to go here. This is
  because we first resize the table and then fill it in. So it was possible that
  non-initialized table was used.

  Trickery with using temporary memory and then doing table.swap() might work,
  but we can not guarantee that table size will be set after the data pointer.

- Mutex guard was useless, because every thread was using own mutex. Need to
  make mutex guard static so all threads are using same mutex.

2 years agoFix crash when deleting workspace active in multiple windows
Julian Eisel [Fri, 6 Oct 2017 16:01:40 +0000 (18:01 +0200)]
Fix crash when deleting workspace active in multiple windows

2 years agoMerge remote-tracking branch 'origin/master' into blender2.8
Dalai Felinto [Fri, 6 Oct 2017 15:21:57 +0000 (12:21 -0300)]
Merge remote-tracking branch 'origin/master' into blender2.8

2 years agoCycles: Cleanup, indendation
Sergey Sharybin [Fri, 6 Oct 2017 14:33:59 +0000 (19:33 +0500)]
Cycles: Cleanup, indendation

2 years agoGawain: Reduce shader interface bucket size
Clément Foucault [Fri, 6 Oct 2017 14:25:38 +0000 (16:25 +0200)]
Gawain: Reduce shader interface bucket size

Tried 101 but it gives colisions.
I think 257 is enough now that we dont have thousands of uniforms.
This gives some noticeable performance improvement.
Could be refined further.

2 years agoGawain: Add UBOs to shader interface.
Clément Foucault [Fri, 6 Oct 2017 12:57:21 +0000 (14:57 +0200)]
Gawain: Add UBOs to shader interface.

2 years agoFix T53012: Shadow catcher creates artifacts on contact area
Sergey Sharybin [Fri, 6 Oct 2017 12:27:34 +0000 (17:27 +0500)]
Fix T53012: Shadow catcher creates artifacts on contact area

The issue was caused by light sample being evaluated to nan at some point.
This is root of the cause which is to be fixed, but is very hard to trace down
especially via ssh (the issue only happens on AVX2 release build). Will give it
a closer look when back to my AVX2 machine.

For until then this is a good check to have anyway, it corresponds to what's
happening in regular radiance sum.

2 years agoCycles: Cleanup, indentation and wrapping
Sergey Sharybin [Fri, 6 Oct 2017 11:54:37 +0000 (16:54 +0500)]
Cycles: Cleanup, indentation and wrapping

2 years agoMerge branch 'master' into blender28
Campbell Barton [Fri, 6 Oct 2017 10:25:33 +0000 (21:25 +1100)]
Merge branch 'master' into blender28

2 years agoCleanup: Math lib naming (use v3 suffix)
Campbell Barton [Fri, 6 Oct 2017 10:05:34 +0000 (21:05 +1100)]
Cleanup: Math lib naming (use v3 suffix)

2 years agoSequencer: Cleanup, use more BLI utilities where possible
Sergey Sharybin [Fri, 6 Oct 2017 10:00:22 +0000 (15:00 +0500)]
Sequencer: Cleanup, use more BLI utilities where possible

2 years agoSequencer: Use BLI math functions where possible
Sergey Sharybin [Fri, 6 Oct 2017 09:36:26 +0000 (14:36 +0500)]
Sequencer: Use BLI math functions where possible

2 years agoSequencer: Avoid re-calculation index offset multiple times
Sergey Sharybin [Fri, 6 Oct 2017 09:32:17 +0000 (14:32 +0500)]
Sequencer: Avoid re-calculation index offset multiple times

2 years agoSequencer: Use funciton instead of macr oto avoid argument re-evaluation
Sergey Sharybin [Fri, 6 Oct 2017 09:25:37 +0000 (14:25 +0500)]
Sequencer: Use funciton instead of macr oto avoid argument re-evaluation

2 years agoFix T52940: VSE Glow Effect Strip on transparent images has no blur
Sergey Sharybin [Fri, 6 Oct 2017 09:20:03 +0000 (14:20 +0500)]
Fix T52940: VSE Glow Effect Strip on transparent images has no blur

2 years agoError in falloff_angle range in last commit
Campbell Barton [Fri, 6 Oct 2017 09:20:15 +0000 (20:20 +1100)]
Error in falloff_angle range in last commit

2 years agoVertex Paint: move normal falloff into the brush
Campbell Barton [Fri, 6 Oct 2017 09:11:17 +0000 (20:11 +1100)]
Vertex Paint: move normal falloff into the brush

All related settings are already in the brush,
so it's inconvenient to switch panels to change this one option.

2 years agoVertex Paint: use view normal w/ 2D falloff
Campbell Barton [Fri, 6 Oct 2017 08:10:33 +0000 (19:10 +1100)]
Vertex Paint: use view normal w/ 2D falloff

When projecting to the view, cull faces pointing
away from the view normal.

2 years agoVertex Paint: use brush front-face setting
Campbell Barton [Fri, 6 Oct 2017 07:57:37 +0000 (18:57 +1100)]
Vertex Paint: use brush front-face setting

Follow sculpt mode more closely by using the brush front-face option.

2 years agoSculpt: use tube falloff when calculating normals
Campbell Barton [Fri, 6 Oct 2017 07:29:54 +0000 (18:29 +1100)]
Sculpt: use tube falloff when calculating normals

Also apply 2D clamping for other tools when the option is set.

2 years agoSculpt: clamp normal to plane w/ projected falloff
Campbell Barton [Fri, 6 Oct 2017 06:38:56 +0000 (17:38 +1100)]
Sculpt: clamp normal to plane w/ projected falloff

Allows for editing outlines w/o pushing geometry towards/away from
the view.

2 years agoFix ruler access from search pop-up
Campbell Barton [Fri, 6 Oct 2017 06:12:25 +0000 (17:12 +1100)]
Fix ruler access from search pop-up

D2831 by @1xundoredo

2 years agoCleanup: style
Campbell Barton [Fri, 6 Oct 2017 05:56:41 +0000 (16:56 +1100)]
Cleanup: style

2 years agoGawain: Simplify / optimize the shader interface.
Clément Foucault [Thu, 5 Oct 2017 16:26:50 +0000 (18:26 +0200)]
Gawain: Simplify / optimize the shader interface.

This changes quite a few things:
- Drops the allocation of inputs as a chunk.
- Merge the linked list system into the Gwn_ShaderInput.
- Put name buffer into another memory block, easily resizable.
- Use offset instead of char* to direct to input name.
- Add only requested uniforms dynamicaly to the Shader Interface.

This drops some minor optimisation and use a bit more memory for small shaders (which are fixed count).
But this saves a lot of memory when using UBOs because the names and the Gwn_ShaderInput were alloc'ed for every UBO variable.
This also reduce the Shader Interface initial generation.
The lookup time is left unchanged.

2 years agoRevert "Gawain: Optimize out extra level on top of ShaderInput"
Clément Foucault [Thu, 5 Oct 2017 23:50:16 +0000 (01:50 +0200)]
Revert "Gawain: Optimize out extra level on top of ShaderInput"

This reverts commit 5514d2df1c6d9f2f108336e46b0db14316610d24.

2 years agoFix T52514: don't clear filename when dropping directory path in file browser.
Brecht Van Lommel [Thu, 5 Oct 2017 22:18:57 +0000 (00:18 +0200)]
Fix T52514: don't clear filename when dropping directory path in file browser.

2 years agoFix T52998: disabled menu entries responding to key shortcuts.
Brecht Van Lommel [Thu, 5 Oct 2017 15:46:22 +0000 (17:46 +0200)]
Fix T52998: disabled menu entries responding to key shortcuts.

2 years agoFix T53002: Batch-Generate Previews generate empty or none image for large objects.
Bastien Montagne [Thu, 5 Oct 2017 16:12:10 +0000 (18:12 +0200)]
Fix T53002: Batch-Generate Previews generate empty or none image for large objects.

Camera clipping was left to default values, which won't work well for
very large (or small) objects. Now recompute valid clipping start/end
based on boundingbox of rendered data, and final location of camera.

2 years agoFix T53001: more workarounds for crash in AMD compiler with recent drivers.
Brecht Van Lommel [Thu, 5 Oct 2017 14:41:41 +0000 (16:41 +0200)]
Fix T53001: more workarounds for crash in AMD compiler with recent drivers.

2 years agoCode refactor: split displace/background into separate kernels, remove luma.
Brecht Van Lommel [Thu, 5 Oct 2017 13:17:09 +0000 (15:17 +0200)]
Code refactor: split displace/background into separate kernels, remove luma.

2 years agoSculpt Mode: 2D falloff option
Campbell Barton [Thu, 5 Oct 2017 13:18:11 +0000 (00:18 +1100)]
Sculpt Mode: 2D falloff option

This makes brush influence into a tube instead of a sphere.
It can be used along the outline of a mesh to adjust it's silhouette.

Note that all this takes advantage of changes from vertex paint,
from testing this seems useful so exposing from the brush options.

2 years agoGawain: Optimize out extra level on top of ShaderInput
Sergey Sharybin [Thu, 5 Oct 2017 13:38:23 +0000 (18:38 +0500)]
Gawain: Optimize out extra level on top of ShaderInput

This is an internal structure, and we don't put it to a list for anything else
that hash collision resolution. No need to have dedicated entry here, saves us
from extra allocation and pointer dereference.

2 years agoDraw manager: Avoid unneeded memory malloc/free when attempting to create missing...
Sergey Sharybin [Thu, 5 Oct 2017 12:16:37 +0000 (17:16 +0500)]
Draw manager: Avoid unneeded memory malloc/free when attempting to create missing uniform

2 years agoGawain: Make builtin uniform lookup to be O(1)
Sergey Sharybin [Thu, 5 Oct 2017 11:19:14 +0000 (16:19 +0500)]
Gawain: Make builtin uniform lookup to be O(1)

2 years agoGawain: Lookup uniforms and attributes from buckets
Sergey Sharybin [Wed, 4 Oct 2017 12:36:52 +0000 (17:36 +0500)]
Gawain: Lookup uniforms and attributes from buckets

This way we reduce number of loops from look-over-all-inputs to
loop-over-collision, which is expected to be much less CPU ticks.

There is still possible optimization: use memory pool of some sort
to manage memory needed for hash entries, but that will only speedup
shader interface construction / deconstruction time.

There are also some trickery happening to speed up process even more
in the case there is no hash collisions detected when constructing
shader interface.

2 years agoGawain: Force hashing function to be inlined
Sergey Sharybin [Wed, 4 Oct 2017 11:53:02 +0000 (16:53 +0500)]
Gawain: Force hashing function to be inlined

Makes sure we don't waste CPU ticks on function call in such a time critical
area.

2 years agoVertex Paint: apply when cursor isn't over faces
Campbell Barton [Thu, 5 Oct 2017 10:16:25 +0000 (21:16 +1100)]
Vertex Paint: apply when cursor isn't over faces

This behavior makes more sense for sculpt, less so for painting.
Restores non PBVH behavior, adding `BKE_pbvh_find_nearest_to_ray` -
similar to ray-cast except it finds the closest point on the surface.

2 years agoCleanup: rename dist -> depth
Campbell Barton [Thu, 5 Oct 2017 10:06:04 +0000 (21:06 +1100)]
Cleanup: rename dist -> depth

Prepare to add code that stores distance to the ray, avoid confusion.

2 years agoCleanup: remove unused struct member
Campbell Barton [Thu, 5 Oct 2017 06:52:05 +0000 (17:52 +1100)]
Cleanup: remove unused struct member

Merged with soc-2016-pbvh-painting, no longer needed.

2 years agoDisable cursor drawing while navigating
Campbell Barton [Thu, 5 Oct 2017 06:35:46 +0000 (17:35 +1100)]
Disable cursor drawing while navigating

Was performing ray-casts in sculpt mode on every update.

2 years agoFix sculpt secondary color missing some brushes
Campbell Barton [Thu, 5 Oct 2017 01:57:24 +0000 (12:57 +1100)]
Fix sculpt secondary color missing some brushes

D2841 by @uvwxyz w/ edits

2 years agoCleanup: use bool for brush checks
Campbell Barton [Thu, 5 Oct 2017 01:51:36 +0000 (12:51 +1100)]
Cleanup: use bool for brush checks

2 years agoFix brush reset (missing notifier)
Campbell Barton [Thu, 5 Oct 2017 01:32:24 +0000 (12:32 +1100)]
Fix brush reset (missing notifier)

D2843 by @uvwxyz

2 years agoCMake: use restrict w/ gcc, not clang
Campbell Barton [Thu, 5 Oct 2017 01:08:17 +0000 (12:08 +1100)]
CMake: use restrict w/ gcc, not clang

2 years agoPyAPI: fast keyword parsing for bpy modules
Campbell Barton [Wed, 4 Oct 2017 23:52:18 +0000 (10:52 +1100)]
PyAPI: fast keyword parsing for bpy modules

No functional changes.

2 years agoCMake: add -Wrestrict for GCC
Campbell Barton [Wed, 4 Oct 2017 23:50:02 +0000 (10:50 +1100)]
CMake: add -Wrestrict for GCC

2 years agoFix passing the same argument twice to BLI_strncpy
Campbell Barton [Wed, 4 Oct 2017 23:47:08 +0000 (10:47 +1100)]
Fix passing the same argument twice to BLI_strncpy

2 years agoFix setting the operator name in Py operator API
Campbell Barton [Wed, 4 Oct 2017 23:46:26 +0000 (10:46 +1100)]
Fix setting the operator name in Py operator API

2 years agoFix incorrect CUDA remaining time estimate after previous commit.
Brecht Van Lommel [Wed, 4 Oct 2017 21:25:51 +0000 (23:25 +0200)]
Fix incorrect CUDA remaining time estimate after previous commit.