4 years agoAdd upstream information to libraries
Sergey Sharybin [Tue, 24 May 2016 09:46:53 +0000 (11:46 +0200)]
Add upstream information to libraries

4 years agoSequencer's histogram view: OMP -> BLI_task.
Bastien Montagne [Mon, 23 May 2016 21:23:51 +0000 (23:23 +0200)]
Sequencer's histogram view: OMP -> BLI_task.

New code using loop/finalize model is about 45% faster (from 4.4ms tp 2.4ms per frame,
overall playback of single shot in sequencer in this preview mode goes from 40 to 45fps).

4 years agondof: build system cleanup
Mike Erwin [Tue, 24 May 2016 05:57:17 +0000 (01:57 -0400)]
ndof: build system cleanup

Only Linux needs a lib linked in (libspnav).

ghostndof3dconnexion refers to an obsolete Mac driver shim.

4 years agondof: enable Linux support by default, unless libs missing
Mike Erwin [Tue, 24 May 2016 04:35:17 +0000 (00:35 -0400)]
ndof: enable Linux support by default, unless libs missing

4 years agoCycles CUDA: reduce stack memory by reusing ShaderData.
Brecht Van Lommel [Sun, 22 May 2016 20:35:47 +0000 (22:35 +0200)]
Cycles CUDA: reduce stack memory by reusing ShaderData.

57% less for path and 48% less for branched path.

4 years agoFix T48487: Physics cache names allow (back)slashes, which breaks its handling.
Bastien Montagne [Mon, 23 May 2016 15:45:44 +0000 (17:45 +0200)]
Fix T48487: Physics cache names allow (back)slashes, which breaks its handling.

For now, just validate new pointcache names as if they were filnames.

Ideal solution would be rather to validate names in `ptcache_filename()`, but it would
likely break some existing caches - and we'd also have to ensure we still have
uniqueness of name after it has been cleaned up, wich would not be trivial at this stage.

So let's go for simple solution for now, especially since this part of code is to be
fully rewritten in 2.8...

4 years agoEnable correct GLSL output for cycles normalmap node
Ralf Hölzemer [Mon, 23 May 2016 13:12:52 +0000 (16:12 +0300)]
Enable correct GLSL output for cycles normalmap node

See T48453 for details and test scenes

Reviewers: a.romanov, sergey

Reviewed By: a.romanov, sergey

Projects: #opengl_gfx, #nodes

Differential Revision:

4 years agoAdd TODO about vertex color linearization to GLSL code
Sergey Sharybin [Mon, 23 May 2016 12:43:03 +0000 (14:43 +0200)]
Add TODO about vertex color linearization to GLSL code

It's not really clear at this moment how we can detect cases
when attribute needs linearization. For now added a comment
so we don't forget about this, hopefully.

4 years agoFix wrong scale of vertex color values when doing border render of Cycles viewport
Sergey Sharybin [Mon, 23 May 2016 12:40:04 +0000 (14:40 +0200)]
Fix wrong scale of vertex color values when doing border render of Cycles viewport

4 years agoFix wrong vertex color in BI GLSL mode
Sergey Sharybin [Mon, 23 May 2016 12:28:47 +0000 (14:28 +0200)]
Fix wrong vertex color in BI GLSL mode

The issue was caused by recent normalization added to the GLSL attributes.

4 years agoCycles: Fix wrong closure counter in feature adaptive kernel
Sergey Sharybin [Mon, 23 May 2016 12:09:27 +0000 (14:09 +0200)]
Cycles: Fix wrong closure counter in feature adaptive kernel

Some closures were missing from calculation, leading to an array
under-allocation, presumable causing memory corruption issues with
emission shaders on OpenCL and was causing issues with Volume 3D
textures with CUDA.

The issue was identified by Thomas Dinges, the patch is different
from the original D2006. See the brief discussion there. Current
approach is similar (or the same) as Brecht suggested.

4 years agoFix T48334: Cycles standalone xml import of uv coordinates
Sergey Sharybin [Mon, 23 May 2016 11:38:15 +0000 (13:38 +0200)]
Fix T48334: Cycles standalone xml import of uv coordinates

In Cycle standalone, the xml import of uv's is done in a way that
a vertex could only have one unique uv coordinate. In practice it
is most of the time not the case.

Patch by Laurent Boiron, thanks!

4 years agoFixed a rare case of NaN in Cycles
Stefan Werner [Mon, 23 May 2016 11:27:46 +0000 (13:27 +0200)]
Fixed a rare case of NaN in Cycles

This fixes a rare case where NaNs could exist inside Cycles.

When certain invalid meshes were passed in, Cycles would try too normalize
a zero length normal during its setup stage. While it does check against
division by zero, it still returns a zero length normal and passes it on to
the path tracing kernel. The kernel then operates under the assumption that
normals are valid, and in the case of such a zero length normal, would
eventually create NaNs that propagate through and result in black pixels.

Reviewers: #cycles

Subscribers: brecht, sergey

Projects: #cycles

Differential Revision:

4 years agoB-Bones improve handle calculation
Campbell Barton [Mon, 23 May 2016 11:32:12 +0000 (21:32 +1000)]
B-Bones improve handle calculation

This changes the bezier handles b-bones to fit to a circle more closely.

4 years agoBLI_math: Add function to calculate circular cubic curve tangents
Campbell Barton [Mon, 23 May 2016 11:31:22 +0000 (21:31 +1000)]
BLI_math: Add function to calculate circular cubic curve tangents

4 years agoCycles: Fix missing feature reported by the Volume node
Sergey Sharybin [Mon, 23 May 2016 10:58:25 +0000 (12:58 +0200)]
Cycles: Fix missing feature reported by the Volume node

4 years agoCycles: Fix missing volumes support for feature-adaptive viewport render
Sergey Sharybin [Mon, 23 May 2016 10:36:31 +0000 (12:36 +0200)]
Cycles: Fix missing volumes support for feature-adaptive viewport render

4 years agoFix for all OpenGL lights affecting Cycles viewport, regardless of their Enabled...
Sergey Sharybin [Mon, 23 May 2016 10:07:00 +0000 (12:07 +0200)]
Fix for all OpenGL lights affecting Cycles viewport, regardless of their Enabled state

Was a regression since e1b8a5d.

Probably not very optimal fix, but better than a regression anyway.

4 years agoCleanup: glsl indentation, line length
Campbell Barton [Mon, 23 May 2016 09:56:50 +0000 (19:56 +1000)]
Cleanup: glsl indentation, line length

4 years agoCode cleanup, stick closer to a blender code style in GLSL shader
Sergey Sharybin [Mon, 23 May 2016 08:31:36 +0000 (10:31 +0200)]
Code cleanup, stick closer to a blender code style in GLSL shader

4 years agoSupport Vertex Color in GLSL viewport for Cycles
Sergey Sharybin [Sun, 22 May 2016 16:24:53 +0000 (18:24 +0200)]
Support Vertex Color in GLSL viewport for Cycles

The title says it all actually.

Added special custom data type, because we don't know in advance
whether we're referencing UV or Color layer. Also made it so vertex
attributes are normalized.

TODO: Border render in viewport ignores the normalization of the
attribute array for some reason, will be looked into still.

Reviewers: mont29, brecht, campbellbarton

Reviewed By: brecht, campbellbarton

Differential Revision:

4 years agoCleanup: Deduplicate image loading functions using templates.
Thomas Dinges [Sun, 22 May 2016 21:24:26 +0000 (23:24 +0200)]
Cleanup: Deduplicate image loading functions using templates.

4 years agoCleanup: Use short condition style.
Thomas Dinges [Sun, 22 May 2016 20:47:37 +0000 (22:47 +0200)]
Cleanup: Use short condition style.

4 years agoFix Cycles warning in release builds.
Brecht Van Lommel [Sun, 22 May 2016 17:42:45 +0000 (19:42 +0200)]
Fix Cycles warning in release builds.

4 years agoFix Cycles compile errors with GCC due to double promotion as errors.
Brecht Van Lommel [Sun, 22 May 2016 17:11:26 +0000 (19:11 +0200)]
Fix Cycles compile errors with GCC due to double promotion as errors.

4 years agoSupport Musgrave texture for Cycles GLSL viewport
Sergey Sharybin [Sun, 22 May 2016 17:09:42 +0000 (19:09 +0200)]
Support Musgrave texture for Cycles GLSL viewport

Only for non-OSX viewport!

4 years agoFix T48497: Stupid typo in recent own BLI_task forloop work that broke non-paralleliz...
Bastien Montagne [Sun, 22 May 2016 16:33:04 +0000 (18:33 +0200)]
Fix T48497: Stupid typo in recent own BLI_task forloop work that broke non-parallelized case.

4 years agoCleanup: remove Cycles layer bits checking in the kernel.
Brecht Van Lommel [Sun, 22 May 2016 07:57:36 +0000 (09:57 +0200)]
Cleanup: remove Cycles layer bits checking in the kernel.

At some point the idea was that we could have an optimization where we could
render multiple render layers without re-exporting the scene, by just updating
the layer bits. We are not doing this now and in practice with the available
render layer control like exclude layers it's not always possible anyway.

This makes it easier to support an arbitrary number of layers in the future
(hopefully this summer), and frees up some useful bits in the kernel.

Reviewed By: sergey, dingto

Differential Revision:

4 years agoCode refactor: nodify Cycles shader and lights.
Brecht Van Lommel [Sat, 7 May 2016 22:18:32 +0000 (00:18 +0200)]
Code refactor: nodify Cycles shader and lights.

Differential Revision:

4 years agoCode refactor: nodify Cycles background and film.
Brecht Van Lommel [Sat, 7 May 2016 18:30:16 +0000 (20:30 +0200)]
Code refactor: nodify Cycles background and film.

Differential Revision:

4 years agoCode refactor: nodify Cycles integrator.
Brecht Van Lommel [Sat, 7 May 2016 18:05:21 +0000 (20:05 +0200)]
Code refactor: nodify Cycles integrator.

Differential Revision:

4 years agoCode refactor: add generic Cycles XML node read and write functions.
Brecht Van Lommel [Sat, 7 May 2016 18:43:22 +0000 (20:43 +0200)]
Code refactor: add generic Cycles XML node read and write functions.

Differential Revision:

4 years agoCode refactor: add generic Cycles node infrastructure.
Brecht Van Lommel [Sat, 7 May 2016 17:47:37 +0000 (19:47 +0200)]
Code refactor: add generic Cycles node infrastructure.

Differential Revision:

4 years agoFix missing Ignore option for GLSL bump
Sergey Sharybin [Sun, 22 May 2016 14:47:06 +0000 (16:47 +0200)]
Fix missing Ignore option for GLSL bump

4 years agoUse previous shading mode for border render in viewport
Sergey Sharybin [Sun, 22 May 2016 14:23:26 +0000 (16:23 +0200)]
Use previous shading mode for border render in viewport

This way we can have border rendered part in the viewport and have
everything else material/texture shaded.

4 years agoMake Shift-Z in viewprot a toggle between current shading mode and rendered one
Sergey Sharybin [Sun, 22 May 2016 13:44:18 +0000 (15:44 +0200)]
Make Shift-Z in viewprot a toggle between current shading mode and rendered one

This way it is now possible to toggle between material and rendered shading
while previously rendered viewport will always go back to solid shading.

4 years agoCycles: Support bump mapping in GLSL viewport
Sergey Sharybin [Fri, 20 May 2016 12:16:54 +0000 (14:16 +0200)]
Cycles: Support bump mapping in GLSL viewport

This commit implements Bump node in GLSL, making it possible to
see previews of bump mapping in viewport without need to render.
Nothing really fancy going on here, just uses internal dFdx/dFdy
functions to get derivatives of the surface and map itself.
Quite basic but seems to behave correct-ish.

This commit also makes Displacement material output to affect
viewport shading by re-linking unconnected Normal input to a
node which was used for displacement output (via Bump node).

Intention of all this is to make it really easy to do bump map
painting with Cycles as an active render engine.

Reviewers: campbellbarton, mont29, brecht, psy-fi

Reviewed By: brecht

Subscribers: Blendify, eyecandy

Differential Revision:

4 years agoCMake: Solve compilation error with pre-compiled libraries and new GCC-6
Sergey Sharybin [Sun, 22 May 2016 11:41:55 +0000 (13:41 +0200)]
CMake: Solve compilation error with pre-compiled libraries and new GCC-6

Since version 6 G++ switched to C++11 by default, which breaks some logic
around WITH_CXX11 checks in out CMake files, leading to compilation errors.
This is easy to solve by explicitly enabling older C++ standard when C++11
was not explicitly enabled by CMake options.

However, G++-6 will also use new ABI by default even if older standard was
specified in the compiler options. This is being addressed by a special
define flag.

This tricks made it possible to use new G++-6 without need to recompile
any of pre-compiled libraries.

However, this might break compilation with existing system libraries, which
might already be using new ABI. We can't address this automatically, so
now we simply default WITH_C11 and WITH_CXX11 options to whatever defaults
of the current compiler are. This means, for G++-6 we'll set WITH_CXX11 to
truth. This should make linking with system libraries working just fine,
but to make pre-compiled libraries we still might need to disable CXX11.

This should work fine work for a new environments with G++-6 and install_deps
script run from scratch there, because C++ standard will be the same for
both Blender dependencies and Blender itself.

4 years agoFix T48476: 'Recalculate Bone to Cursor' fails
Campbell Barton [Sun, 22 May 2016 07:47:39 +0000 (17:47 +1000)]
Fix T48476: 'Recalculate Bone to Cursor' fails

4 years agoCleanup: remove unused doxy config
Campbell Barton [Sun, 22 May 2016 07:14:08 +0000 (17:14 +1000)]
Cleanup: remove unused doxy config

4 years agondof: simplify Mac build
Mike Erwin [Sat, 21 May 2016 22:29:55 +0000 (18:29 -0400)]
ndof: simplify Mac build

We don’t require the 3Dconnexion driver framework at build time.

No special link flags or include paths needed.

4 years agoPython API: add material to uniforms from gpu.export_shader.
Sebastian Ullrich [Sat, 21 May 2016 14:13:09 +0000 (16:13 +0200)]
Python API: add material to uniforms from gpu.export_shader.

Reviewed By: brecht

Differential Revision:

4 years agoForgot to remove omp header include...
Bastien Montagne [Sat, 21 May 2016 14:12:30 +0000 (16:12 +0200)]
Forgot to remove omp header include...

4 years agoDynamicpaint: fix (unreported) missing progress bar in early baking stage.
Bastien Montagne [Sat, 21 May 2016 14:09:35 +0000 (16:09 +0200)]
Dynamicpaint: fix (unreported) missing progress bar in early baking stage.

Nothing was shown in UI during pre-bake step, while it can take several minutes
to complete with heavy geometry.

4 years agoDynamicPaint: massive refactor, replace all OpenMP usage by BLI_task and other optimi...
Bastien Montagne [Sat, 21 May 2016 13:22:04 +0000 (15:22 +0200)]
DynamicPaint: massive refactor, replace all OpenMP usage by BLI_task and other optimizations.

This commit makes Dynamicpaint modifier evaluation (during playback) a few percents quicker.
However, it makes dynapaint's 'image sequence' baking about 33% quicker (from 119 to 77 seconds
in own heavy test), partly due to switch to BLI_task itself (about 20%), and partly due to
optimizations (remaining ~13%).

As usual, did a lot of tests here to ensure nothing is broken, but a lot more users' testing would definitively
be welcome too! ;)

Note that some quite meaningless omp forloops have been removed (parallelizing thousands of vec copy does
make it two or three times quicker, but the few hundreds of microseconds gained do not make any difference
in a hundreds millisecond process).

Also, this code could still use a lot more cleanup (naming etc.), the way it (tries to) handle malloc faults
is also totally flacky and makes the code horribly verbose and convoluted in some places - without actually
catching all possible faults (memarena could make it more easy to handle here), etc.

4 years agoBKE Mesh mapping: add 'vert to looptri' mapping generator.
Bastien Montagne [Sat, 21 May 2016 10:38:02 +0000 (12:38 +0200)]
BKE Mesh mapping: add 'vert to looptri' mapping generator.

4 years agoGPencil: Add hotkeys for the "Delete Active Frame" operator
Joshua Leung [Sat, 21 May 2016 06:33:44 +0000 (18:33 +1200)]
GPencil: Add hotkeys for the "Delete Active Frame" operator

* D+X     - Works anytime, anywhere
* Shift-X - Works in EditMode only
* Via Delete Menu - EditMode only

Often doing video tutorials or perhaps during dailies/shot review you want to
quickly get rid of a quick scribble you made for making a point, without having
to undo (i.e. maybe you edited some objects in between) and/or without having
to use the eraser (i.e. it'd take too long to cover the entire area).

4 years agoGP Sculpt: Make the cursor more visible on light backgrounds
Joshua Leung [Sat, 21 May 2016 00:50:12 +0000 (12:50 +1200)]
GP Sculpt: Make the cursor more visible on light backgrounds

On light coloured backgrounds (especially on white), it was impossible to see
where the cursor was. This commit adds a second ring (black) to the cursor so
that on light backgrounds, even if the light ring isn't visible the black one
will be.

4 years agoHopefully fix OMP/MSVC crap...
Bastien Montagne [Fri, 20 May 2016 22:54:37 +0000 (00:54 +0200)]
Hopefully fix OMP/MSVC crap...

4 years agoDynapaint: Serious cleanup and optimization of dynamicPaint_createUVSurface (mostly).
Bastien Montagne [Fri, 20 May 2016 21:16:52 +0000 (23:16 +0200)]
Dynapaint: Serious cleanup and optimization of dynamicPaint_createUVSurface (mostly).

Gives 3-4% speedup in pre-bake step (from 112 to 108 seconds with own heavy test file).

Note that here we have a huge potential performance boost if we replace the flat
`Bounds2D *faceBB` array of UV tris bounding boxes by a real 2D AABB tree (right now,
we can loop over all UV triangles times the number of pixels of the surface times 5...).

4 years agoFix GLSL shader failing to compile on OSX
Sergey Sharybin [Fri, 20 May 2016 20:54:27 +0000 (22:54 +0200)]
Fix GLSL shader failing to compile on OSX

Bit operations are not supported on legacy profile of OSX.

4 years agoMakefile: Use hidden FORCE target
Campbell Barton [Fri, 20 May 2016 19:47:33 +0000 (05:47 +1000)]
Makefile: Use hidden FORCE target

4 years agoSupport Cycles wave texture in GLSL viewport.
Thomas Dinges [Fri, 20 May 2016 19:21:57 +0000 (21:21 +0200)]
Support Cycles wave texture in GLSL viewport.

4 years agoSupport Cycles noise texture in GLSL viewport
Sergey Sharybin [Fri, 20 May 2016 16:58:56 +0000 (18:58 +0200)]
Support Cycles noise texture in GLSL viewport

4 years agoCleanup: Don't use f suffix for values in GLSL
Sergey Sharybin [Fri, 20 May 2016 16:14:04 +0000 (18:14 +0200)]
Cleanup: Don't use f suffix for values in GLSL

Was giving an issues in the past, will avoid it for now.

4 years agoSupport voronoi texture in GLSL shading
Sergey Sharybin [Fri, 20 May 2016 16:05:29 +0000 (18:05 +0200)]
Support voronoi texture in GLSL shading

It gives some slight differences on the plane corners, but can't
really figure out source of the issue here yet.

It's still better than fully white texture for the previews anyway.

At this point we should perhaps ifdef chunks of the code in order
to have faster GLSL compilation and probably even faster compiled
code. Will look into this shortly.

4 years agoSupport Cycles magic texture in GLSL viewport
Sergey Sharybin [Fri, 20 May 2016 14:58:40 +0000 (16:58 +0200)]
Support Cycles magic texture in GLSL viewport

4 years agoCycles: Fix long compile time with MSVC.
Thomas Dinges [Fri, 20 May 2016 14:46:49 +0000 (16:46 +0200)]
Cycles: Fix long compile time with MSVC.

Compile time per kernel increased alot after recent image commits, re-shuffle some code to fix this.

Patch by "LazyDodo".

Differential Revision:

4 years agoSupport gradient Cycles texture in GLSL viewport
Sergey Sharybin [Fri, 20 May 2016 14:39:45 +0000 (16:39 +0200)]
Support gradient Cycles texture in GLSL viewport

4 years agoSupport Cycles brick texture in GLSL viewport
Sergey Sharybin [Fri, 20 May 2016 14:13:44 +0000 (16:13 +0200)]
Support Cycles brick texture in GLSL viewport

4 years agoSupport Cycles's checker texture in GLSL shading
Sergey Sharybin [Fri, 20 May 2016 13:18:40 +0000 (15:18 +0200)]
Support Cycles's checker texture in GLSL shading

4 years agoFix T48472: issue in array refactor, causing performance regression in BVH build.
Brecht Van Lommel [Fri, 20 May 2016 08:56:10 +0000 (10:56 +0200)]
Fix T48472: issue in array refactor, causing performance regression in BVH build.

4 years agoFix T48470: Bendy Bones: Custom Handle References not being cleared when bone deleted
Joshua Leung [Fri, 20 May 2016 07:08:48 +0000 (19:08 +1200)]
Fix T48470: Bendy Bones: Custom Handle References not being cleared when bone deleted

In addition to the original bug report, I've gone through cleaning up a range of
related bugs which only became clear when hunting around the code...

* Custom Handle References weren't getting cleared when the bones they used got
  deleted.  But, neither was the custom bone shape location/transform reference.

* Various places where posebone settings are copied around were also missing code
  to handle the new Bendy Bone properties.


* If duplicating a Bendy Bone with custom references, and the custom references
  are also selected/duplicated, the new Bendy Bones will use the corresponding
  duplicated bones

4 years agoAdd Peak Memory as render stamp option
Lukas Stockner [Thu, 19 May 2016 19:39:22 +0000 (21:39 +0200)]
Add Peak Memory as render stamp option

This commit adds Peak Memory to the stamp options, the value is the same one that is already shown in the image viewer.

Requested by @nutel.

Reviewers: campbellbarton

Subscribers: campbellbarton, nutel

Differential Revision:

4 years agoCycles: Add XML parsing of MappingNodes to Cycles Standalone
Lukas Stockner [Thu, 19 May 2016 09:35:50 +0000 (11:35 +0200)]
Cycles: Add XML parsing of MappingNodes to Cycles Standalone

Reviewers: dingto, sergey

Differential Revision:

4 years agoCleanup: warnings
Campbell Barton [Thu, 19 May 2016 19:01:51 +0000 (05:01 +1000)]
Cleanup: warnings

4 years agoFix T48204: Generic Tablet on Linux - Erratic strokes with pressure sensitivity enabled.
Bastien Montagne [Thu, 19 May 2016 18:30:48 +0000 (20:30 +0200)]
Fix T48204: Generic Tablet on Linux - Erratic strokes with pressure sensitivity enabled.

Once and for all - I hope!

So, for the records: Xinput1 events' valuators have a first_axis and axis_count defining the 'range'
of valid axes for that event - but valid data in the valuator's array **always** start at zero
(which means that, if event reports first axis as being axis 2, axis 2's value is in axis_data[0]).

4 years agoCycles / CUDA: Don't use bundled kernel if Adaptive is enforced by the user.
Thomas Dinges [Thu, 19 May 2016 14:32:57 +0000 (16:32 +0200)]
Cycles / CUDA: Don't use bundled kernel if Adaptive is enforced by the user.

4 years agoCleanup: misleading indentation
Campbell Barton [Thu, 19 May 2016 13:37:23 +0000 (23:37 +1000)]
Cleanup: misleading indentation

4 years agoDynapaint: parallelize drip effect.
Bastien Montagne [Wed, 18 May 2016 20:04:58 +0000 (22:04 +0200)]
Dynapaint: parallelize drip effect.

Was not so far, because this effect is not modifying its 'own' PaintPoint, which means
it's not threadsafe. Since a global lock (mutex or spinlock) would not be much efficient
(we need to lock a given point pretty much all the computaion cycle), and since locking
a same PaintPOint from different threads at the same time is *very* unlikely,
solution here is to use an 'array of locks', one for each PaintPoint (same thing as BLI_bitmap,
using atomic ops to set/clear bits).

Here in own test (complex dynapaint over a huge sphere combining all dynapaint types), it gives
20% speedup of the whole dynapaint simulation!

Note: maybe we'd want to move that kind of bitlock into BLI lib some day - not totally sure how,
so let's keep it local for now...

4 years agoDynapaint: fix use of normal normalization in dynamicPaint_generateBakeData().
Bastien Montagne [Thu, 19 May 2016 12:06:46 +0000 (14:06 +0200)]
Dynapaint: fix use of normal normalization in dynamicPaint_generateBakeData().

Vertex's normal is always normalized - and its conversion from short to float should not change that!
On the other hand, linear interpolation of three normals **does not give a normalized vector**
(unless all three inputs are exactly the same).

Also, minor optimization, avoid recomputing that interpolated normal twice for each PaintUVPoint.

4 years agoCycles: Add support for bindless textures.
Thomas Dinges [Thu, 19 May 2016 10:47:41 +0000 (12:47 +0200)]
Cycles: Add support for bindless textures.

This adds support for CUDA Texture objects (also known as Bindless textures) for Kepler GPUs (Geforce 6xx and above).
This is used for all 2D/3D textures, data still uses arrays as before.

User benefits:
* No more limits of image textures on Kepler.
 We had 5 float4 and 145 byte4 slots there before, now we have 1024 float4 and 1024 byte4.
 This can be extended further if we need to (just change the define).

* Single channel textures slots (byte and float) are now supported on Kepler as well (1024 slots for each type).

ToDo / Issues:
* 3D textures don't work yet, at least don't show up during render. I have no idea whats wrong yet.
* Dynamically allocate bindless_mapping array?

I hope Fermi still works fine, but that should be tested on a Fermi card before pushing to master.

Part of my GSoC 2016.

Reviewers: sergey, #cycles, brecht

Subscribers: swerner, jtheninja, brecht, sergey

Differential Revision:

4 years agoIgnore vertex color when doing texture paint
Sergey Sharybin [Thu, 19 May 2016 09:11:21 +0000 (11:11 +0200)]
Ignore vertex color when doing texture paint

It was totally useless to multiply diffuse color with the vertex color
when doing texture painting. It was masking actual texture and only was
forcing artists to create an empty vertex color layer to work this around.

4 years agoCMake: use signed char for recastnavigation
Campbell Barton [Wed, 18 May 2016 21:36:32 +0000 (07:36 +1000)]
CMake: use signed char for recastnavigation

External libraries may need char to be signed.

4 years agoCleanup: CMake indentation
Campbell Barton [Wed, 18 May 2016 16:04:58 +0000 (02:04 +1000)]
Cleanup: CMake indentation

Also remove outdated comment

4 years agoCuda wrangler: Fix very nasty bug with multiple scalar type qualifiers
Sergey Sharybin [Wed, 18 May 2016 16:01:37 +0000 (18:01 +0200)]
Cuda wrangler: Fix very nasty bug with multiple scalar type qualifiers

4 years agoFix missing modifiers for mesh objects
Sergey Sharybin [Wed, 18 May 2016 15:36:16 +0000 (17:36 +0200)]
Fix missing modifiers for mesh objects

All modifiers for all non-lattice objects were disabled after recent commit.

4 years agoTheme Color Sets - Dynamically generated icons
Joshua Leung [Wed, 18 May 2016 15:25:00 +0000 (03:25 +1200)]
Theme Color Sets - Dynamically generated icons

The theme color set selector (for Bone Groups) will now show previews of
what each color set looks like. It does so using a 3-color band icon.

4 years agoFix T47727: Weird bake results with non integer color values
Sergey Sharybin [Wed, 18 May 2016 13:08:48 +0000 (15:08 +0200)]
Fix T47727: Weird bake results with non integer color values

4 years agoFix T47737: Lattice crashes w/ smooth modifier
Philipp Oeser [Wed, 18 May 2016 12:21:46 +0000 (22:21 +1000)]
Fix T47737: Lattice crashes w/ smooth modifier

Add flag for modifiers that support lattice

4 years agoRevert string splitting
Campbell Barton [Wed, 18 May 2016 12:05:28 +0000 (22:05 +1000)]
Revert string splitting

Caused error on OSX

4 years agoRevert part of 4adffde02c98f3bb058ffba5ea010a6b1045a7b1 to get Windows (MSVC2013...
Joshua Leung [Wed, 18 May 2016 11:40:32 +0000 (23:40 +1200)]
Revert part of 4adffde02c98f3bb058ffba5ea010a6b1045a7b1 to get Windows (MSVC2013) compiling again

4 years agoDepsgraph: Fix rest pose still using bone constraints
Sergey Sharybin [Wed, 18 May 2016 09:38:52 +0000 (11:38 +0200)]
Depsgraph: Fix rest pose still using bone constraints

4 years agoCycles: Fix compilation error of CUDA kernels after recent volume commit
Sergey Sharybin [Wed, 18 May 2016 09:15:28 +0000 (11:15 +0200)]
Cycles: Fix compilation error of CUDA kernels after recent volume commit

Apparently the code path with malloc() was enabled for CUDA.

4 years agoCycles: Pole merging for spherical stereo
Sergey Sharybin [Tue, 17 May 2016 12:12:29 +0000 (14:12 +0200)]
Cycles: Pole merging for spherical stereo

The idea of pole merge is to fade interocular distance after a certain
altitude to zero when altitude goes closer to a pole. This should prevent
annoyances looking up in the sky or down to the bottom.

Works for both panorama and perspective cameras when Spherical Stereo
is enabled.

Reviewers: dfelinto, brecht

Reviewed By: brecht

Subscribers: sebastian_k

Differential Revision:

4 years agoCycles: Reduce amount of malloc() calls from the kernel
Sergey Sharybin [Tue, 17 May 2016 10:30:46 +0000 (12:30 +0200)]
Cycles: Reduce amount of malloc() calls from the kernel

This commit makes it so malloc() is only happening once per volume and
once per transparent shadow query (per thread), improving scalability of
the code to multiple CPU cores.

Hard to measure this with a low-bottom i7 here currently, but from quick
tests seems volume sampling gave about 3-5% speedup.

The idea is to store allocated memory in kernel globals, which are per
thread on CPU already.

Reviewers: dingto, juicyfruit, lukasstockner97, maiself, brecht

Reviewed By: brecht

Subscribers: Blendify, nutel

Differential Revision:

4 years agoCycles: Explicitly mark arguments as unused
Sergey Sharybin [Wed, 18 May 2016 07:12:47 +0000 (09:12 +0200)]
Cycles: Explicitly mark arguments as unused

4 years agoFix T48395: Grease Pencil, pressing Ekey to sculpt don't work for left click configur...
Joshua Leung [Wed, 18 May 2016 05:23:16 +0000 (17:23 +1200)]
Fix T48395: Grease Pencil, pressing Ekey to sculpt don't work for left click configurations

When using Left Click select, it wasn't possible to sculpt using E+LMB.

I've changed the order of things in the keymap so that the select operator won't
end up catching and blocking all these events.

4 years agoFix: "Whole Character" Keying Set should not include Location on bones with "connecte...
Joshua Leung [Tue, 17 May 2016 16:09:07 +0000 (04:09 +1200)]
Fix: "Whole Character" Keying Set should not include Location on bones with "connected" joint

4 years agoCleanup: cmake, indentation, line length
Campbell Barton [Wed, 18 May 2016 01:58:08 +0000 (11:58 +1000)]
Cleanup: cmake, indentation, line length

4 years agoFix issue in with multiple importance sampling in recent code refactor.
Brecht Van Lommel [Tue, 17 May 2016 23:50:35 +0000 (01:50 +0200)]
Fix issue in with multiple importance sampling in recent code refactor.

4 years agoCleanup code style inconsistency in last commits.
Brecht Van Lommel [Tue, 17 May 2016 20:08:34 +0000 (22:08 +0200)]
Cleanup code style inconsistency in last commits.

4 years agoFix GCC/Linux build error after finite/isfinite changes.
Brecht Van Lommel [Tue, 17 May 2016 21:16:54 +0000 (23:16 +0200)]
Fix GCC/Linux build error after finite/isfinite changes.

4 years agoC99/C++11: replace deprecated finite() by isfinite().
Brecht Van Lommel [Sun, 15 May 2016 22:48:02 +0000 (00:48 +0200)]
C99/C++11: replace deprecated finite() by isfinite().

4 years agoFix C++11 build issues on OS X, remove references to outdated libs.
Brecht Van Lommel [Mon, 16 May 2016 18:03:59 +0000 (20:03 +0200)]
Fix C++11 build issues on OS X, remove references to outdated libs.

4 years agoCode refactor: use shader pointers rather than shader indexes.
Brecht Van Lommel [Sat, 14 May 2016 12:50:03 +0000 (14:50 +0200)]
Code refactor: use shader pointers rather than shader indexes.

4 years agoCode refactor: use dynamic shader node array lengths now that OSL supports them.
Brecht Van Lommel [Sat, 7 May 2016 23:54:35 +0000 (01:54 +0200)]
Code refactor: use dynamic shader node array lengths now that OSL supports them.

4 years agoCode refactor: add some array utility methods, fix leak in assignment operator.
Brecht Van Lommel [Sat, 7 May 2016 17:47:08 +0000 (19:47 +0200)]
Code refactor: add some array utility methods, fix leak in assignment operator.

4 years agoBendy Bones: Small ui tweak
Thomas Beck [Tue, 17 May 2016 16:08:04 +0000 (18:08 +0200)]
Bendy Bones: Small ui tweak

Change the order of the bending controls ("Curve XY Offsets") so the user can activate both InX and OutX by holding down the left mouse button. This way, it's easy to bend symmetrically on X or Y.

4 years agoFix T48434: Missing meta support in new depsgraph
Sergey Sharybin [Tue, 17 May 2016 15:52:23 +0000 (17:52 +0200)]
Fix T48434: Missing meta support in new depsgraph