2 years agoCycles: add single program debug option for split kernel temp_cycles_split_kernel
Hristo Gueorguiev [Wed, 8 Mar 2017 16:56:06 +0000 (17:56 +0100)]
Cycles: add single program debug option for split kernel

Single program generally compiles kernels faster (2-3 times), loads faster,
takes less drive space (2-3 times), and reduces the number of cached kernels.

2 years agoCycles: split kernel_shadow_blocked to AO & DL parts
Hristo Gueorguiev [Wed, 8 Mar 2017 16:39:40 +0000 (17:39 +0100)]
Cycles: split kernel_shadow_blocked to AO & DL parts

Reduces memory allocation for split kernel.

This allows for faster rendering due to bigger global size,
specially when GPU memory is limited.

Perfromance results:

                         R9 290 total render time
                        Before    After   Change
BMW                      4:37      4:34   -1.1 %
Classroom               14:43     14:30   -1.5 %
Fishy Cat               11:20     11:04   -2.4 %
Koro                    12:11     12:04   -1.0 %
Pabellon Barcelona      22:01     20:44   -5.8 %
Pabellon Barcelona(*)   15:32     15:09   -2.5 %

(*) without glossy connected to volume

2 years agoCycles: Speedup transparent shadows in split kernel
Hristo Gueorguiev [Wed, 8 Mar 2017 15:26:39 +0000 (16:26 +0100)]
Cycles: Speedup transparent shadows in split kernel

This commit enables record-all transparent shadows rays.

Perfromance results:

               R9 290 render time (without synchronization), seconds
                        Before    After   Change
BMW                      261.5    262.5   +0.4 %
Classroom                869.6    867.3   -0.3 %
Fishy Cat                657.4    639.8   -2.7 %
Koro                    1909.8    692.8  -63.7 %
Pabellon Barcelona      1633.3   1238.0  -24.2 %
Pabellon Barcelona(*)   1158.1    903.8  -22.0 %

(*) without glossy connected to volume

2 years agoCycles: SSS and Volume rendering in split kernel
Hristo Gueorguiev [Wed, 8 Mar 2017 14:42:26 +0000 (15:42 +0100)]
Cycles: SSS and Volume rendering in split kernel

Decoupled ray marching is not supported yet.

Transparent shadows are always enabled for volume rendering.

Changes in kernel/bvh and kernel/geom are from Sergey.
This simiplifies code significantly, and prepares it for
record-all transparent shadow function in 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 agoCycles: Seperate kernel loading time from render time
Mai Lavelle [Fri, 30 Dec 2016 04:05:40 +0000 (23:05 -0500)]
Cycles: Seperate kernel loading time from render time

2 years agoCycles: Add names to buffer allocations
Mai Lavelle [Wed, 14 Dec 2016 01:45:09 +0000 (20:45 -0500)]
Cycles: Add names to buffer allocations

This is to help debug and track memory usage for generic buffers. We
have similar for textures already since those require a name, but for
buffers the name is only for debugging proposes.

2 years agoCycles: CUDA implementation of split kernel
Mai Lavelle [Tue, 14 Feb 2017 10:50:29 +0000 (05:50 -0500)]
Cycles: CUDA implementation of split kernel

2 years agoCycles: CPU implementation of split kernel
Mai Lavelle [Tue, 14 Feb 2017 11:20:48 +0000 (06:20 -0500)]
Cycles: CPU implementation of split kernel

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: 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 agoCycles: Workaround for driver hangs
Mai Lavelle [Tue, 31 Jan 2017 11:48:15 +0000 (06:48 -0500)]
Cycles: Workaround for driver hangs

Simple workaround for some issues we've been having with AMD drivers hanging
and rendering systems unresponsive. Unfortunately this makes things a bit
slower, but its better than having to do hard reboots. Will be removed when
drivers have been fixed.

Define CYCLES_DISABLE_DRIVER_WORKAROUNDS to disable for testing purposes.

2 years agoCycles: OpenCL split kernel refactor
Mai Lavelle [Wed, 22 Feb 2017 13:10:02 +0000 (08:10 -0500)]
Cycles: OpenCL split kernel refactor

This does a few things at once:

- Refactors host side split kernel logic into a new device
  agnostic class `DeviceSplitKernel`.
- Removes tile splitting, a new work pool implementation takes its place and
  allows as many threads as will fit in memory regardless of tile size, which
  can give performance gains.
- Refactors split state buffers into one buffer, as well as reduces the
  number of arguments passed to kernels. Means there's less code to deal
  with overall.
- Moves kernel logic out of OpenCL kernel files so they can later be used by
  other device types.
- Replaced OpenCL specific APIs with new generic versions
- Tiles can now be seen updating during rendering

2 years agoCycles: Add OpenCL kernel for zeroing memory buffers
Mai Lavelle [Thu, 26 Jan 2017 06:41:48 +0000 (01:41 -0500)]
Cycles: Add OpenCL kernel for zeroing memory buffers

Transferring memory to the device was very slow and there's really no
need when only zeroing a buffer.

2 years agoCycles: Add more atomic operations
Mai Lavelle [Wed, 22 Feb 2017 12:41:18 +0000 (07:41 -0500)]
Cycles: Add more atomic operations

2 years agoCycles: Expose passes size to device tasks
Mai Lavelle [Fri, 20 Jan 2017 08:05:32 +0000 (03:05 -0500)]
Cycles: Expose passes size to device tasks

This is needed so devices can know the size of a tile buffer before any
tiles are acquired.

2 years agoCycles: Allow device_memory to be used directly
Mai Lavelle [Wed, 22 Feb 2017 12:32:57 +0000 (07:32 -0500)]
Cycles: Allow device_memory to be used directly

This is useful for when theres no host side memory attched to the buffer

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: 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

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:

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 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 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 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:

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

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:

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

2 years agoCycles: Use fast math without finite optimization
Sergey Sharybin [Mon, 13 Feb 2017 15:25:35 +0000 (16:25 +0100)]
Cycles: Use fast math without finite optimization

This allows us to use faster math and still have reliable
isnan/isfinite tests.

Only do it for host side, kernels stays unchanged.

Thanks Lukas Stockner for the tip!

2 years agoFix T50655: Pointiness is too slow to calculate
Sergey Sharybin [Mon, 13 Feb 2017 11:00:10 +0000 (12:00 +0100)]
Fix T50655: Pointiness is too slow to calculate

Optimize vertex de-duplication the same way as we do doe Remove Doubles.

2 years agoCycles: Use Cycles-side mesh instead of C++ RNA
Sergey Sharybin [Mon, 13 Feb 2017 09:40:05 +0000 (10:40 +0100)]
Cycles: Use Cycles-side mesh instead of C++ RNA

Those are now matching and it's faster to skip C++ RNA to
calculate pointiness.

2 years agoF-Curve normalization: Do proper curve min/max instead of handle min/max
Sergey Sharybin [Mon, 13 Feb 2017 09:00:46 +0000 (10:00 +0100)]
F-Curve normalization: Do proper curve min/max instead of handle min/max

Would be cool to find some way to cache the results.

2 years agoCycles: Don't use built-in API for image sequences in preview mode
Sergey Sharybin [Sat, 11 Feb 2017 21:24:59 +0000 (22:24 +0100)]
Cycles: Don't use built-in API for image sequences in preview mode

Our Python API is not ready for such things at all. Better be slower
but more correct for until we improve our API.

2 years agoImage: Fix non-deterministic behavior of image sequence loading
Sergey Sharybin [Sat, 11 Feb 2017 21:15:30 +0000 (22:15 +0100)]
Image: Fix non-deterministic behavior of image sequence loading

The issue was caused by usage of non-initialized image user, which
could have different settings, causing some random image being loaded
or not loaded at all.

This caused non-deterministic behavior of Cycles image loading because
it was querying image information from several places.

This fixes crash reported in T50616, but it's not a complete fix
because preview rendering in material is wrong (same wrong as in
2.78a release).

2 years agoUI: Redesign the VSE multicam strip
Aaron Carlisle [Sat, 11 Feb 2017 16:35:02 +0000 (11:35 -0500)]
UI: Redesign the VSE multicam strip

Idea from by @pauloup

|Before |After|

Test file:

2 years agoUse dummy versionning numbers for missing libraries.
Bastien Montagne [Fri, 10 Feb 2017 21:49:22 +0000 (22:49 +0100)]
Use dummy versionning numbers for missing libraries.

We now assert that we now file version of libraries (needed for
do_version after linking step), so for missing libraries, set dummy
numbers (using version of main .blend file actually).

2 years agoDe-duplicate min/max calculation in F-Curve normalization
Sergey Sharybin [Fri, 10 Feb 2017 17:10:26 +0000 (18:10 +0100)]
De-duplicate min/max calculation in F-Curve normalization

2 years agoCTests: Initial work to cover Cycles nodes with OpenGL tests
Sergey Sharybin [Fri, 10 Feb 2017 13:52:54 +0000 (14:52 +0100)]
CTests: Initial work to cover Cycles nodes with OpenGL tests

Works similar to regular Cycles tests, just does OpenGL render to
get output image.

Seems to work fine with the only funny effect: Blender window will
pop up for each of the tests. This is current limitation of our
OpenGL context. Might be changed in the future.

2 years agoCleanup: Trailing whitespace
Sergey Sharybin [Fri, 10 Feb 2017 13:08:12 +0000 (14:08 +0100)]
Cleanup: Trailing whitespace

2 years agoCycles: Cleanup, move EdgeMap to blender_util
Sergey Sharybin [Fri, 10 Feb 2017 12:33:02 +0000 (13:33 +0100)]
Cycles: Cleanup, move EdgeMap to blender_util

it's better place for such an utility structure. Still not fully ideal tho.

2 years agoCycles: Make an utility class for edge map
Sergey Sharybin [Fri, 10 Feb 2017 12:31:59 +0000 (13:31 +0100)]
Cycles: Make an utility class for edge map

Simplifies some logic.

2 years agoCycles: Fix pointiness attribute giving wrong results with autosplit
Sergey Sharybin [Fri, 10 Feb 2017 12:23:40 +0000 (13:23 +0100)]
Cycles: Fix pointiness attribute giving wrong results with autosplit

Basically made the algorithm to handle vertices with the same coordinate
as a single vertex.

2 years agoCycles: Cleanup: Use less indentation by inverting condition
Sergey Sharybin [Fri, 10 Feb 2017 09:10:06 +0000 (10:10 +0100)]
Cycles: Cleanup: Use less indentation by inverting condition

2 years agoCycles: Calculate all vertex attribute after faces generation
Sergey Sharybin [Fri, 10 Feb 2017 09:06:58 +0000 (10:06 +0100)]
Cycles: Calculate all vertex attribute after faces generation

This way the calculation is not spread over multiple places.

2 years agoCycles: Cleanup: use vector instead of bare malloc
Sergey Sharybin [Fri, 10 Feb 2017 09:05:41 +0000 (10:05 +0100)]
Cycles: Cleanup: use vector instead of bare malloc

This way memory is more "manageable" and easier to follow.

2 years agoAlembic: fixed mistake in bounding box computation
Sybren A. Stüvel [Fri, 10 Feb 2017 10:52:14 +0000 (11:52 +0100)]
Alembic: fixed mistake in bounding box computation

By performing the Z-up to Y-up conversion, the change in sign of the
Z-coordinate swaps "minimum" and "maximum".

2 years agoDo not overide text
Aaron Carlisle [Thu, 9 Feb 2017 21:25:04 +0000 (16:25 -0500)]
Do not overide text

2 years agoFix T50629 -- Add remove doubles to the cleanup menu
Aaron Carlisle [Thu, 9 Feb 2017 21:18:33 +0000 (16:18 -0500)]
Fix T50629 -- Add remove doubles to the cleanup menu

Also move it up in the verticies menu

2 years agoCleanup: Remove commented code
Aaron Carlisle [Thu, 9 Feb 2017 14:26:12 +0000 (09:26 -0500)]
Cleanup: Remove commented code

Code has been commented from before 2010 and relates to old Background image code.

2 years agoUse a smaller cross icon for clearing search box contents
Joshua Leung [Thu, 9 Feb 2017 06:08:58 +0000 (19:08 +1300)]
Use a smaller cross icon for clearing search box contents