blender.git
2 years agoMerge branch 'master' into cycles_split_kernel cycles_split_kernel
Mai Lavelle [Tue, 7 Mar 2017 12:43:28 +0000 (07:43 -0500)]
Merge branch 'master' into cycles_split_kernel

2 years agoCycles: Fix building of CUDA split kernel
Mai Lavelle [Tue, 7 Mar 2017 10:22:44 +0000 (05:22 -0500)]
Cycles: Fix building of CUDA split kernel

2 years agoCycles: Fix indentation
Mai Lavelle [Tue, 7 Mar 2017 10:21:36 +0000 (05:21 -0500)]
Cycles: Fix indentation

2 years agoCycles: Fix strict warning about unused variable
Mai Lavelle [Tue, 7 Mar 2017 10:16:57 +0000 (05:16 -0500)]
Cycles: Fix strict warning about unused variable

2 years agoCycles: Calculate size of split state buffer kernel side
Mai Lavelle [Sat, 4 Mar 2017 11:29:01 +0000 (06:29 -0500)]
Cycles: Calculate size of split state buffer kernel side

By calculating the size of the state buffer in the kernel rather than the host
less code is needed and the size actually reflects the requested features.

Will also be a little faster in some cases because of larger global work size.

2 years agoCycles: Fix crash after failed kernel build
Mai Lavelle [Sat, 4 Mar 2017 08:29:03 +0000 (03:29 -0500)]
Cycles: Fix crash after failed kernel build

Pointers to kernels were uninitialized leading to freeing of random memory
addresses. Another reason it would be good to use smart pointers.

2 years agoCycles: Faster building of split kernel
Mai Lavelle [Fri, 3 Mar 2017 09:10:17 +0000 (04:10 -0500)]
Cycles: Faster building of split kernel

Simple change to make it so that only kernels that have been modified are
rebuilt. Might only be useful during development.

2 years agoCycles: Initialize rng_state for split kernel
Mai Lavelle [Fri, 3 Mar 2017 09:07:26 +0000 (04:07 -0500)]
Cycles: Initialize rng_state for split kernel

Because the split kernel can render multiple samples in parallel it is
necessary to have everything initialized before rendering of any samples
begins. The code that normally handles initialization of
`rng_state` (`kernel_path_trace_setup()`) only does so for the first sample,
which was causing artifacts in the split kernel due to uninitialized
`rng_state` for some samples.

Note that because the split kernel can render samples in parallel this
means that the split kernel is incompatible with the LCG.

2 years agoCycles: Remove sum_all_radiance kernel
Mai Lavelle [Wed, 1 Mar 2017 06:47:08 +0000 (01:47 -0500)]
Cycles: Remove sum_all_radiance kernel

This was only needed for the previous implementation of parallel samples. As
we don't have that any more it can be removed.

Real reason for removal tho is this: `per_sample_output_buffers` was being
calculated too small and artifacts resulted. The tile buffer is already
the correct size and calculating the size for `per_sample_output_buffers`
is a bit difficult with the current layout of the code. As
`per_sample_output_buffers` was only needed for `sum_all_radiance`,
removing that kernel and writing output to the tile buffer directly
fixes the artifacts.

2 years agoCycles: Split path initialization into own kernel
Mai Lavelle [Wed, 1 Mar 2017 06:05:55 +0000 (01:05 -0500)]
Cycles: Split path initialization into own kernel

This makes it easier to initialize things correctly in the data_init kernel
before they are needed by path tracing.

2 years agoFix T50698: Cycles baking artifacts with transparent surfaces.
Brecht Van Lommel [Sat, 25 Feb 2017 02:09:02 +0000 (03:09 +0100)]
Fix T50698: Cycles baking artifacts with transparent surfaces.

2 years agoFix build error with macOS / clang / c++11.
Brecht Van Lommel [Sat, 25 Feb 2017 01:35:53 +0000 (02:35 +0100)]
Fix build error with macOS / clang / c++11.

2 years agoFix T50757: Alembic, assign imported materials to the object data
Kévin Dietrich [Fri, 24 Feb 2017 20:19:52 +0000 (21:19 +0100)]
Fix T50757: Alembic, assign imported materials to the object data
instead of to the object itself.

2 years agoFix T50676: Crash on closing while frameserver rendering.
Bastien Montagne [Fri, 24 Feb 2017 13:56:50 +0000 (14:56 +0100)]
Fix T50676: Crash on closing while frameserver rendering.

Can't see any reason to call AUD exit early in WM_exit, that's a
low-level module that has no dependency on anything else in Blender, but
is dependency of some other parts of Blender, so it should rather be
exited late in the process!

2 years agoCycles: Fix compilation warning with CUDA on OSX
Sergey Sharybin [Fri, 24 Feb 2017 13:33:10 +0000 (14:33 +0100)]
Cycles: Fix compilation warning with CUDA on OSX

2 years agoCycles: Fix non-zero exit status when rendering animation from CLI and running out...
Sergey Sharybin [Fri, 24 Feb 2017 13:25:11 +0000 (14:25 +0100)]
Cycles: Fix non-zero exit status when rendering animation from CLI and running out of memory

2 years agoAdd "Gravitation" option to "Force" type force fields
Luca Rood [Thu, 23 Feb 2017 22:00:03 +0000 (19:00 -0300)]
Add "Gravitation" option to "Force" type force fields

This adds an option to force fields of type "Force", which enables the
simulation of gravitational behavior (dist^-2 falloff).

Patch by @AndreasE

Reviewers: #physics, LucaRood, mont29

Reviewed By: #physics, LucaRood, mont29

Tags: #physics

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

2 years agoFix some more minor issue with updated py doc generation.
Bastien Montagne [Thu, 23 Feb 2017 21:31:21 +0000 (22:31 +0100)]
Fix some more minor issue with updated py doc generation.

2 years agoFix stupid mistake in previous commit for release builds of API doc.
Bastien Montagne [Thu, 23 Feb 2017 21:08:01 +0000 (22:08 +0100)]
Fix stupid mistake in previous commit for release builds of API doc.

2 years agoUpdate py API doc generation tools to comply to new name scheme on server.
Bastien Montagne [Thu, 23 Feb 2017 20:24:47 +0000 (21:24 +0100)]
Update py API doc generation tools to comply to new name scheme on server.

 - for rc/release: /api/2.79c/, zip file named blender_python_reference_2.79c_release.zip
 - for dev: /api/master/, zip file named blender_python_reference_2_79_4.zip

2 years agoUsual UI messages fixes...
Bastien Montagne [Thu, 23 Feb 2017 20:10:43 +0000 (21:10 +0100)]
Usual UI messages fixes...

2 years agoCycles: Fix compilation error on 32bit Linux
Sergey Sharybin [Thu, 23 Feb 2017 16:30:26 +0000 (17:30 +0100)]
Cycles: Fix compilation error on 32bit Linux

2 years agoCycles: Fix wrong render results with texture limit and half-float textures
Sergey Sharybin [Thu, 23 Feb 2017 13:46:22 +0000 (14:46 +0100)]
Cycles: Fix wrong render results with texture limit and half-float textures

2 years agoCycles: Add utility function to convert float to half
Sergey Sharybin [Thu, 23 Feb 2017 13:42:06 +0000 (14:42 +0100)]
Cycles: Add utility function to convert float to half

handles overflow and underflow, but not NaN/inf.

2 years agoFix T50656: Compositing node editor is empty, no nodes can be added
Sergey Sharybin [Thu, 23 Feb 2017 10:23:49 +0000 (11:23 +0100)]
Fix T50656: Compositing node editor is empty, no nodes can be added

2 years agoFix T50748: Render Time incorrect when refreshing rendered preview in GPU mode
Sergey Sharybin [Thu, 23 Feb 2017 09:50:46 +0000 (10:50 +0100)]
Fix T50748: Render Time incorrect when refreshing rendered preview in GPU mode

2 years agoFix T50736: Zero streaks in Glare node.
Bastien Montagne [Thu, 23 Feb 2017 09:39:51 +0000 (10:39 +0100)]
Fix T50736: Zero streaks in Glare node.

Please never, ever use same DNA var for two different things. Even worse
if they do not have same type and ranges!

This is only ensuring issues (as described in report, but also if
animating both RNA props using same DNA var... yuck).

And we were not even saving any byte in DNA, could reuse some padding
there to store the two new needed vars (yes, two, since we cannot re-use
existing one if we want to keep backward *and* forward compatibility).

2 years agoFix possible crash in various 3D View operators
Julian Eisel [Thu, 23 Feb 2017 00:59:40 +0000 (01:59 +0100)]
Fix possible crash in various 3D View operators

Was actually harmeless and not crashing, but I'd say more or less only
by luck: the NULL-check for region data would only evaluate to true for
the correct 3D View region. However, if we were to add region data to a
different region type in future, this would lead to undefined behavior
if executed in the wrong region.

2 years agoColumns should be expandable by default
raa [Wed, 22 Feb 2017 21:03:31 +0000 (00:03 +0300)]
Columns should be expandable by default

2 years agoFix T50745: Shape key editing on bezier objects broken with Rendered Viewport Shading
Bastien Montagne [Wed, 22 Feb 2017 20:20:50 +0000 (21:20 +0100)]
Fix T50745: Shape key editing on bezier objects broken with Rendered Viewport Shading

So... Curve+shapekey was even more broken than it looked, this report was
actually a nice crasher (immediate crash in an ASAN build when trying to
edit a curve shapekey with some viewport rendering enabled).

There were actually two different issues here.

I) The less critical: rB6f1493f68fe was not fully fixing issues from
T50614. More specifically, if you updated obdata from editnurb
*without* freeing editnurb afterwards, you had a 'restored' (to
original curve) editnurb, without the edited shapekey modifications
anymore. This was fixed by tweaking again `calc_shapeKeys()` behavior in
`ED_curve_editnurb_load()`.

II) The crasher: in `ED_curve_editnurb_make()`, the call to
`init_editNurb_keyIndex()` was directly storing pointers of obdata
nurbs. Since those get freed every time `ED_curve_editnurb_load()` is
executed, it easily ended up being pointers to freed memory. This was
fixed by copying those data, which implied more complex handling code
for editnurbs->keyindex, and some reshuffling of a few functions to
avoid duplicating things between editor's editcurve.c and BKE's curve.c

Note that the separation of functions between editors and BKE area for
curve could use a serious update, it's currently messy to say the least.
Then again, that area is due to rework since a long time now... :/

Finally, aligned 'for_render' curve evaluation to mesh one - now
editing a shapekey will show in rendered viewports, if it does have some
weight (exactly as with shapekeys of meshes).

2 years agoCleanup: remove unused orig_nu from keyIndex ghash of editcurves.
Bastien Montagne [Wed, 22 Feb 2017 17:06:09 +0000 (18:06 +0100)]
Cleanup: remove unused orig_nu from keyIndex ghash of editcurves.

2 years agoUse new api doc links
Aaron Carlisle [Wed, 22 Feb 2017 16:17:09 +0000 (11:17 -0500)]
Use new api doc links

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

2 years agoMerge branch 'master' into cycles_split_kernel
Mai Lavelle [Wed, 22 Feb 2017 14:33:15 +0000 (09:33 -0500)]
Merge branch 'master' into cycles_split_kernel

2 years agoCycles: Round global size down rather than up to avoid setting too large
Mai Lavelle [Wed, 22 Feb 2017 12:17:04 +0000 (07:17 -0500)]
Cycles: Round global size down rather than up to avoid setting too large

2 years agoFix Cycles still saving render output when error happened
Sergey Sharybin [Wed, 22 Feb 2017 12:06:24 +0000 (13:06 +0100)]
Fix Cycles still saving render output when error happened

This was fixed ages ago for the interface case but not for the
command line. The thing here is that currently external engines
are relying on reports system to indicate that error happened
so suppressing reports storage in the background mode prevented
render pipeline from detecting errors happened.

This is all weak and i don't like it, but this is better than
delivering black frames from the farm.

2 years agoCycles: Get passes size in more robust way
Mai Lavelle [Wed, 22 Feb 2017 11:56:00 +0000 (06:56 -0500)]
Cycles: Get passes size in more robust way

2 years agoCycles: Use correct index for sd_dl_shadow after removing ccl_fetch
Mai Lavelle [Wed, 22 Feb 2017 11:10:28 +0000 (06:10 -0500)]
Cycles: Use correct index for sd_dl_shadow after removing ccl_fetch

2 years agoRevert "Cycles: Faster version of driver workaround for OpenCL"
Mai Lavelle [Wed, 22 Feb 2017 09:24:59 +0000 (04:24 -0500)]
Revert "Cycles: Faster version of driver workaround for OpenCL"

Was getting infrequent hangs, unfortunately we have to take the performance
hit of clFinish for now.

This reverts commit 122743e7f23f8df908bcd10322d39f951ebc83e2.

2 years agoCycles: Fix buffer offsets in split kernel
Mai Lavelle [Wed, 22 Feb 2017 00:48:14 +0000 (19:48 -0500)]
Cycles: Fix buffer offsets in split kernel

Was getting wrong renders with multiple devices.

2 years agoCycles: Remove ccl_fetch and SOA
Mai Lavelle [Thu, 16 Feb 2017 11:24:13 +0000 (06:24 -0500)]
Cycles: Remove ccl_fetch and SOA

2 years agoCycles: Remove all split kernel stuff from opencl.h
Mai Lavelle [Wed, 15 Feb 2017 09:51:38 +0000 (04:51 -0500)]
Cycles: Remove all split kernel stuff from opencl.h

2 years agoCycles: Fix shading with autosmooth and custom normals
Sergey Sharybin [Wed, 22 Feb 2017 09:53:28 +0000 (10:53 +0100)]
Cycles: Fix shading with autosmooth and custom normals

New logic of split_faces was leaving mesh in a proper state
from Blender's point of view, but Cycles wanted loop normals
to be "flushed" to vertex normals.

Now we do such a flush from Cycles side again, so we don't
leave bad meshes behind.

Thanks Bastien for assistance here!

2 years agoCycles: Additionally report all OpenCL cflags
Sergey Sharybin [Wed, 22 Feb 2017 09:04:13 +0000 (10:04 +0100)]
Cycles: Additionally report all OpenCL cflags

This way we can control exact spaces and such added to the cflags
which is crucial to troubleshoot certain drivers.

2 years agoRefactor Mesh split_faces() code to use loop normal spaces.
Bastien Montagne [Wed, 22 Feb 2017 08:40:46 +0000 (09:40 +0100)]
Refactor Mesh split_faces() code to use loop normal spaces.

Finding which loop should share its vertex with which others is not easy
with regular Mesh data (mostly due to lack of advanced topology info, as
opposed with BMesh case).

Custom loop normals computing already does that - and can return 'loop
normal spaces', which among other things contain definitions of 'smooth
fans' of loops around vertices.

Using those makes it easy to find vertices (and then edges) that needs
splitting.

This commit also adds support of non-autosmooth meshes, where we want to
split out flat faces from smooth ones.

2 years agoFix Drawing nested box layouts (D2508)
raa [Tue, 21 Feb 2017 18:02:56 +0000 (21:02 +0300)]
Fix Drawing nested box layouts (D2508)

2 years agoCycles: Speedup by avoiding extra calculations in noise texture when unneeded
Mai Lavelle [Tue, 21 Feb 2017 12:24:33 +0000 (07:24 -0500)]
Cycles: Speedup by avoiding extra calculations in noise texture when unneeded

Noise texture is now faster when the color socket is unused. Potential for
speedup spotted by @nutel.

Some performance results:

                     Render Time Before    After    Difference
Gooseberry benchmark         47:51.34    45:55.57       -4%
Koro                         12:24.92    12:18.46     -0.8%
Simple cube (Color socket)      48.53       48.72     +0.3%
Simple cube (Fac socket)        48.74       32.78    -32.7%
Goethe displacement           1:21.18     1:08.47    -15.6%
Cycles brick displacement     3:02.38     2:16.76    -25.0%
Large displacement scene     23:54.12    20:09.62    -15.6%

Reviewed By: sergey

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

2 years agoCycles: Reenable debug tile size for viewport rendering
Mai Lavelle [Tue, 21 Feb 2017 08:10:48 +0000 (03:10 -0500)]
Cycles: Reenable debug tile size for viewport rendering

Not a problem now that split kernel global size is decoupled from tile size.

2 years agoCleanup: use proper link to the api
Aaron Carlisle [Tue, 21 Feb 2017 01:19:07 +0000 (20:19 -0500)]
Cleanup: use proper link to the api

2 years agoCycles: Report device maximum allocation and detected global size
Sergey Sharybin [Mon, 20 Feb 2017 12:02:11 +0000 (13:02 +0100)]
Cycles: Report device maximum allocation and detected global size

2 years agoFix T50718: Regression: Split Normals Render Problem with Cycles
Sergey Sharybin [Mon, 20 Feb 2017 10:56:02 +0000 (11:56 +0100)]
Fix T50718: Regression: Split Normals Render Problem with Cycles

The issue seems to be caused by vertex normal being re-calculated
to something else than loop normal, which also caused wrong loop
normals after re-calculation.

For now issue is solved by preserving CD_NORMAL for loops after
split_faces() is finished, so render engine can access original
proper value.

2 years agoMesh faces split: Add missing vertex normal copy
Sergey Sharybin [Mon, 20 Feb 2017 10:47:43 +0000 (11:47 +0100)]
Mesh faces split: Add missing vertex normal copy

2 years agoFix T50719: Memory usage won't reset to zero while re-rendering on two video cards
Sergey Sharybin [Mon, 20 Feb 2017 10:02:19 +0000 (11:02 +0100)]
Fix T50719: Memory usage won't reset to zero while re-rendering on two video cards

Was only visible with Persistent Images option ON.

2 years agoFix a few compiler warnings with macOS / clang.
Brecht Van Lommel [Sat, 18 Feb 2017 22:52:31 +0000 (23:52 +0100)]
Fix a few compiler warnings with macOS / clang.

2 years agoFix T50564: 3D view panning with scroll wheel inconsistent with dragging.
Brecht Van Lommel [Sat, 18 Feb 2017 16:25:12 +0000 (17:25 +0100)]
Fix T50564: 3D view panning with scroll wheel inconsistent with dragging.

2 years agoCycles: Update tiles less frequently for split kernel
Mai Lavelle [Sat, 18 Feb 2017 12:07:01 +0000 (07:07 -0500)]
Cycles: Update tiles less frequently for split kernel

Increases the time between tile updates exponentially until theres 10 seconds
between updates. By having more time between updates we can push more samples
to the device at once and keep the number of threads doing actual work
higher. This gives a nice speed up.

2 years agoCycles: Add changes that somehow got left out of previous commit
Mai Lavelle [Sat, 18 Feb 2017 10:53:34 +0000 (05:53 -0500)]
Cycles: Add changes that somehow got left out of previous commit

2 years agoCycles: Remove remnants of tile splitting
Mai Lavelle [Thu, 16 Feb 2017 10:36:14 +0000 (05:36 -0500)]
Cycles: Remove remnants of tile splitting

2 years agoCycles: Faster version of driver workaround for OpenCL
Mai Lavelle [Sat, 18 Feb 2017 03:42:58 +0000 (22:42 -0500)]
Cycles: Faster version of driver workaround for OpenCL

2 years agoFix T50614: Curve doesn't restore initial form after deleting all its shapekeys
Bastien Montagne [Fri, 17 Feb 2017 17:55:52 +0000 (18:55 +0100)]
Fix T50614: Curve doesn't restore initial form after deleting all its shapekeys

Logic of handling shapekeys when entering and leaving edit mode for
curves was... utterly broken.

Was leaving actual curve data with edited shapekey applied to it.

2 years agoMerge branch 'master' into cycles_split_kernel
Sergey Sharybin [Fri, 17 Feb 2017 12:54:04 +0000 (13:54 +0100)]
Merge branch 'master' into cycles_split_kernel

2 years agoRemove unused functions related to distance between BoundBox and ray
Germano Cavalcante [Fri, 17 Feb 2017 12:49:20 +0000 (09:49 -0300)]
Remove unused functions related to distance between BoundBox and ray

2 years agoForgotten in last commit: Check the allocation
Germano Cavalcante [Fri, 17 Feb 2017 02:41:38 +0000 (23:41 -0300)]
Forgotten in last commit: Check the allocation

2 years agoDo not release the arrays used in the parameters of the expanded functions of bvhutils
Germano Cavalcante [Fri, 17 Feb 2017 01:55:01 +0000 (22:55 -0300)]
Do not release the arrays used in the parameters of the expanded functions of bvhutils

The release of these arrays should be the programmer's discretion since these arrays can continue to be used.

Only the expanded functions `bvhtree_from_mesh_edges_ex` and `bvhtree_from_mesh_looptri_ex` are currently being used in blender (in mesh_remap.c), and from what I could to analyze, these changes can prevent a crash.

2 years agoMake File: Print 'blender.exe' at the end of the path to run from
Aaron Carlisle [Thu, 16 Feb 2017 22:08:33 +0000 (17:08 -0500)]
Make File: Print 'blender.exe' at the end of the path to run from

2 years agoCleanup: Spelling, Spaces --> Tabs, Whitespace
Aaron Carlisle [Thu, 16 Feb 2017 22:06:03 +0000 (17:06 -0500)]
Cleanup: Spelling, Spaces --> Tabs, Whitespace

2 years agoUI: Move 'relations extras' right below 'relations'
Aaron Carlisle [Thu, 16 Feb 2017 17:01:07 +0000 (12:01 -0500)]
UI: Move 'relations extras' right below 'relations'

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

2 years agoFix T50687: Cycles baking time estimate and progress bar doesn't work / progress...
Sergey Sharybin [Thu, 16 Feb 2017 16:15:08 +0000 (17:15 +0100)]
Fix T50687: Cycles baking time estimate and progress bar doesn't work / progress when baking with high samples

2 years agoRegister test for mesh.split_faces()
Sergey Sharybin [Thu, 16 Feb 2017 14:36:00 +0000 (15:36 +0100)]
Register test for mesh.split_faces()

2 years agoFaces split: Don't leave CD_NORMAL after split
Sergey Sharybin [Thu, 16 Feb 2017 10:00:17 +0000 (11:00 +0100)]
Faces split: Don't leave CD_NORMAL after split

This is supposed to be a temporary layer.

If someone needs loop normals after split it should explicitly
ask for that.

2 years agoCyctes tests: Commit blender.git side changes
Sergey Sharybin [Thu, 16 Feb 2017 09:36:22 +0000 (10:36 +0100)]
Cyctes tests: Commit blender.git side changes

2 years agoCDDM Copy: Only tag data layers dirty if we ignored tessellation data
Sergey Sharybin [Thu, 16 Feb 2017 08:55:44 +0000 (09:55 +0100)]
CDDM Copy: Only tag data layers dirty if we ignored tessellation data

This solves assert failure in CustomData_from_bmeshpoly() happening with
broom.blend file from barber shop SVN.

2 years agoCleanup: Indentation
Sergey Sharybin [Thu, 16 Feb 2017 08:16:20 +0000 (09:16 +0100)]
Cleanup: Indentation

2 years agoFreestyle: Feature edge selection by nested object groups.
Tamito Kajiyama [Thu, 16 Feb 2017 01:51:40 +0000 (10:51 +0900)]
Freestyle: Feature edge selection by nested object groups.

A group of object groups can be formed by means of the dupli_group option in
the Object properties window.  The present revision extends the Selection by
Group option in the Freestyle Line Set so as to support not only flat object
groups but also nested groups.

2 years agoFix more corner cases failing in mesh faces split
Sergey Sharybin [Wed, 15 Feb 2017 22:09:31 +0000 (23:09 +0100)]
Fix more corner cases failing in mesh faces split

Now we handle properly case with edge-fan meshes, which should
fix bad topology calculated for cash register which was causing
crashes in the studio.

2 years agoFix wrong edges created by split faces
Sergey Sharybin [Wed, 15 Feb 2017 19:59:55 +0000 (20:59 +0100)]
Fix wrong edges created by split faces

We need to first split all vertices before we can reliably
check whether edge can be reused or not.

There is still known issue happening with a edge-fan mesh
with some faces being on the same plane.

2 years ago[Alembic] Fix msvc warning - C4138 '*/' found outside of comment
lazydodo [Wed, 15 Feb 2017 19:40:41 +0000 (12:40 -0700)]
[Alembic] Fix msvc warning - C4138  '*/' found outside of comment

2 years agoCycles: Cleanup, style
Sergey Sharybin [Wed, 15 Feb 2017 19:33:49 +0000 (20:33 +0100)]
Cycles: Cleanup, style

2 years agoFix T50542: Wrong metadata frame when using OpenGL render
Sergey Sharybin [Wed, 15 Feb 2017 16:09:49 +0000 (17:09 +0100)]
Fix T50542: Wrong metadata frame when using OpenGL render

2 years agoMotion blur investigation feature
Sergey Sharybin [Wed, 15 Feb 2017 15:19:05 +0000 (16:19 +0100)]
Motion blur investigation feature

This commit adds a way to debug Cycles motion blur issues which
are usually happening due to something crazy happening in between
of frames. Biggest trouble was that artists had no clue about
what's happening in subframes before they render. This is at
least inefficient workflow when dealing with motion blur shots
with complex animation.

Now there is an option in Time Line Editor which could be found
in View -> Show Subframe. This option will expose current frame
with it's subframe to the time line editor header and it'll allow
scrubbing with a subframe precision in time line editor.

Please note that none of the tools in Blender are aware of
subframe, so they'll likely be using current integer frame still.

This is something we don't consider a bug for now, the whole
purpose for now is to give a tool for investigation. Eventually
we'll likely tweak all tools to be aware of subframe.

Hopefully now we can finish the movie here in the studio..

2 years agoFix T50662: Auto-split affects on smooth mesh when it sohuldn't
Sergey Sharybin [Wed, 15 Feb 2017 14:21:15 +0000 (15:21 +0100)]
Fix T50662: Auto-split affects on smooth mesh when it sohuldn't

Seems to be a precision error comparing proper floating point
normal with the one coming from short.

2 years agoCycles: Fix CUDA compilation error after recent changes
Sergey Sharybin [Wed, 15 Feb 2017 14:01:08 +0000 (15:01 +0100)]
Cycles: Fix CUDA compilation error after recent changes

2 years agoFix wrong loop normals left after face splitting
Sergey Sharybin [Wed, 15 Feb 2017 13:58:49 +0000 (14:58 +0100)]
Fix wrong loop normals left after face splitting

Let's keep all data in a consistent state, so we don't have any
issues later on.

This solves rendering artifacts mentioned in the previous commit.

2 years agoMesh: Re-implement face split solving issue mentioned earlier
Sergey Sharybin [Wed, 15 Feb 2017 12:56:50 +0000 (13:56 +0100)]
Mesh: Re-implement face split solving issue mentioned earlier

Now new edges will be properly created between original and
new split vertices.

Now topology is correct, but shading is still not quite in
some special cases.

2 years agoCycles: Don't calculate primitive time if BVH motion steps are not used
Sergey Sharybin [Wed, 15 Feb 2017 11:59:31 +0000 (12:59 +0100)]
Cycles: Don't calculate primitive time if BVH motion steps are not used

Solves memory regression by the default configuration.

2 years agoCycles: Pass special flag whether BVH motion steps are used
Sergey Sharybin [Wed, 15 Feb 2017 09:48:02 +0000 (10:48 +0100)]
Cycles: Pass special flag whether BVH motion steps are used

Doesn't currently change anything, but would need for some future
work here.

It uses existing padding in kernel BVH structure, so there is
nothing changed memory-wise.

2 years agoCycles: Fix wrong hair render results when using BVH motion steps
Sergey Sharybin [Wed, 15 Feb 2017 09:56:54 +0000 (10:56 +0100)]
Cycles: Fix wrong hair render results when using BVH motion steps

The issue here was mainly coming from minimal pixel width feature
which is quite commonly enabled in production shots.

This feature will use some probabilistic heuristic in the curve
intersection function to check whether we need to return intersection
or not. This probability is calculated for every intersection check.
Now, when we use multiple BVH nodes for curve primitives we increase
probability of that primitive to be considered a good intersection
for us. This is similar to increasing minimal width of curve.

What is worst here is that change in the intersection probability
fully depends on exact layout of BVH, meaning probability might
change differently depending on a view angle, the way how builder
binned the primitives and such. This makes it impossible to do
simple check like dividing probability by number of BVH steps.

Other solution might have been to split BVH into fully independent
trees, but that will increase memory usage of all the static
objects in the scenes, which is also not something desirable.

For now used most simple but robust approach: store BVH primitives
time and test it in curve intersection functions. This solves the
regression, but has two downsides:

- Uses more memory.

  which isn't surprising, and ANY solution to this problem will
  use more memory.

  What we still have to do is to avoid this memory increase for
  cases when we don't use BVH motion steps.

- Reduces number of maximum available textures on pre-kepler cards.

  There is not much we can do here, hardware gets old but we need
  to move forward on more modern hardware..

2 years agoCycles: Fix missing initialization of triangle BVH steps
Sergey Sharybin [Wed, 15 Feb 2017 09:44:34 +0000 (10:44 +0100)]
Cycles: Fix missing initialization of triangle BVH steps

Likely was harmless for Blender, but better be safe here.

2 years agoCycles: Fix wrong pointiness caused by precision issues
Sergey Sharybin [Wed, 15 Feb 2017 11:39:06 +0000 (12:39 +0100)]
Cycles: Fix wrong pointiness caused by precision issues

2 years agoRevert "Mesh: Solve incorrect result of mesh.split_faces()"
Sergey Sharybin [Wed, 15 Feb 2017 11:33:04 +0000 (12:33 +0100)]
Revert "Mesh: Solve incorrect result of mesh.split_faces()"

The change was delivering broken topology for certain cases.
The assumption that new edge only connects new vertices was
wrong.

Reverting to a commit which was giving correct render results
but was using more memory.

This reverts commit af1e48e8ab7a25269ba5a44158bd16c564ed3535.

2 years agoUI: Wireframe modifier- make crease grayed out when disabled
Aaron Carlisle [Wed, 15 Feb 2017 04:44:21 +0000 (23:44 -0500)]
UI: Wireframe modifier- make crease grayed out when disabled

2 years agoComments: notes on polyfill2d, minor corrections
Campbell Barton [Wed, 15 Feb 2017 03:10:42 +0000 (14:10 +1100)]
Comments: notes on polyfill2d, minor corrections

2 years agoMesh: Solve incorrect result of mesh.split_faces()
Sergey Sharybin [Tue, 14 Feb 2017 16:02:22 +0000 (17:02 +0100)]
Mesh: Solve incorrect result of mesh.split_faces()

This function was keeping original edges and was creating some
extra vertices which is not something we are really looking
forward to,

2 years agoMesh: Cleanup, use shorter version of loop
Sergey Sharybin [Tue, 14 Feb 2017 14:30:49 +0000 (15:30 +0100)]
Mesh: Cleanup, use shorter version of loop

2 years agoMesh: Use faster calculation of previous loop
Sergey Sharybin [Tue, 14 Feb 2017 14:29:31 +0000 (15:29 +0100)]
Mesh: Use faster calculation of previous loop

2 years ago`BKE_boundbox_ensure_minimum_dimensions` is no longer necessary
Germano Cavalcante [Tue, 14 Feb 2017 13:25:00 +0000 (10:25 -0300)]
`BKE_boundbox_ensure_minimum_dimensions` is no longer necessary

The bug T46099 no longer applies since the addition of `dist_squared_to_projected_aabb_simple`
Has also been added comments that relates to an occlusion bug with the ruler. I'll investigate this.

2 years agotransform_snap_object: Remove `do_bb` parameter. It is always true
Germano Cavalcante [Tue, 14 Feb 2017 12:38:20 +0000 (09:38 -0300)]
transform_snap_object: Remove `do_bb` parameter. It is always true

2 years agoAlembic: fix naming of imported transforms.
Kévin Dietrich [Tue, 14 Feb 2017 06:59:27 +0000 (07:59 +0100)]
Alembic: fix naming of imported transforms.

When importing an Alembic file with grouped transforms, it would badly name the transforms, taking the name of the parent instead of its own.

Patch by @maxime.robinot

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

2 years agoCycles: Optimize sorting of transparent intersections on CUDA
Sergey Sharybin [Mon, 13 Feb 2017 17:24:45 +0000 (18:24 +0100)]
Cycles: Optimize sorting of transparent intersections on CUDA

2 years agoCycles: Fix wrong transparent shadows with CUDA
Sergey Sharybin [Mon, 13 Feb 2017 17:22:10 +0000 (18:22 +0100)]
Cycles: Fix wrong transparent shadows with CUDA

Was a bug in recent optimization commit.

2 years agoCycles: Fix wrong shading on GPU when background has NaN pixels and MIS enabled
Sergey Sharybin [Mon, 13 Feb 2017 15:30:16 +0000 (16:30 +0100)]
Cycles: Fix wrong shading on GPU when background has NaN pixels and MIS enabled

Quite simple fix for now which only deals with this case. Maybe we want to do
some "clipping" on image load time so regular textures wouldn't give NaN as
well.