blender-staging.git
2 years agoCycles: Fix handling of barriers
Mai Lavelle [Thu, 16 Mar 2017 06:16:02 +0000 (02:16 -0400)]
Cycles: Fix handling of barriers

2 years agoMesh Convert: remove meaningless modifier check
Campbell Barton [Thu, 16 Mar 2017 23:10:55 +0000 (10:10 +1100)]
Mesh Convert: remove meaningless modifier check

Meshes w/o modifiers wouldn't have their derived mesh applied.
Check was to avoid crash but its in fact meaningless,
since the modifier might be disabled, or there may be virtual modifiers.

2 years agoFix T50950: Converting meshes fails w/ boolean
Campbell Barton [Thu, 16 Mar 2017 22:58:05 +0000 (09:58 +1100)]
Fix T50950: Converting meshes fails w/ boolean

2 years agoAdd BKE_blendfile_userdef_read_from_memory
Campbell Barton [Thu, 16 Mar 2017 20:01:11 +0000 (07:01 +1100)]
Add BKE_blendfile_userdef_read_from_memory

Needed to read user-preferences from in-memory startup.blend

Also skip data-blocks when reading preferences.

2 years agoAdd support for loading preference struct
Campbell Barton [Thu, 16 Mar 2017 18:10:36 +0000 (05:10 +1100)]
Add support for loading preference struct

Previously it would always load into 'U' global.
Needed for loading & merging template preferences.

2 years agoPyAPI: Menu.path_menu: Add path filter callback
Campbell Barton [Thu, 16 Mar 2017 18:17:39 +0000 (05:17 +1100)]
PyAPI: Menu.path_menu: Add path filter callback

Needed if we want to filter based on filenames (not just extension).

2 years agoCorrect reading missing property
Campbell Barton [Thu, 16 Mar 2017 18:20:09 +0000 (05:20 +1100)]
Correct reading missing property

2 years agoFix missing undo pushes in outliner's new datablock management operations.
Bastien Montagne [Thu, 16 Mar 2017 16:02:11 +0000 (17:02 +0100)]
Fix missing undo pushes in outliner's new datablock management operations.

Not sure why I did not put those from start... Actually *not* having an
undo point here can be problematic, since undoing some previous action
was trying to restore from bad pointer (I think) in UI, generating
asserts.

Note however that it's not a 'pure' undo, in that you may not find your
linked data in exact same state as before deleting it, after an undo,
since it actually implies *reloading* the deleted libraries (and not
restoring from a previously stored memory dump).

Reported by @sergey, thanks.

2 years agoFix outliner contextual menu allowing to delete indirect libraries.
Bastien Montagne [Thu, 16 Mar 2017 15:47:56 +0000 (16:47 +0100)]
Fix outliner contextual menu allowing to delete indirect libraries.

There is no way currently to prevent the option from showing in menu, so
instead report a warning to user (and curse again current nightmarish
system of operation in outliner...).

Reported by @sergey, thanks.

2 years agoDepsgraph: Fixed crash with curve bevel indirect dupligroups
Sergey Sharybin [Thu, 16 Mar 2017 14:27:03 +0000 (15:27 +0100)]
Depsgraph: Fixed crash with curve bevel indirect dupligroups

Need to expand all object's dupli-groups, not only the dupli-groups
of objects directly linked to the scene.

2 years agoDepsgraph: Use string and vector in the DEG namespace only
Sergey Sharybin [Thu, 16 Mar 2017 11:31:19 +0000 (12:31 +0100)]
Depsgraph: Use string and vector in the DEG namespace only

2 years agoDepsgraph: Don't use explicit values in runtime only enum
Sergey Sharybin [Thu, 16 Mar 2017 11:29:43 +0000 (12:29 +0100)]
Depsgraph: Don't use explicit values in runtime only enum

Lower risk of forgetting to update some values here.

2 years agoCleanup: differentiate startup/prefs in home-file reading
Campbell Barton [Thu, 16 Mar 2017 13:37:28 +0000 (00:37 +1100)]
Cleanup: differentiate startup/prefs in home-file reading

2 years agoSupport passing in UserDef for free function
Campbell Barton [Thu, 16 Mar 2017 13:18:20 +0000 (00:18 +1100)]
Support passing in UserDef for free function

Needed so we can load and free non-global user preferences.

2 years agoCycles: Define ccl_local variables in kernel functions
Sergey Sharybin [Wed, 8 Mar 2017 12:34:29 +0000 (13:34 +0100)]
Cycles: Define ccl_local variables in kernel functions

Declaring ccl_local in a device function is not supported
by certain compilers.

2 years agoCycles: Workaround for compilation error caused by passing KernelGlobals
Sergey Sharybin [Wed, 8 Mar 2017 11:49:04 +0000 (12:49 +0100)]
Cycles: Workaround for compilation error caused by passing KernelGlobals

Pass globals as a bare pointer, same as it sued to be prior to split kernel rework.

AMD CPU platform and Intel OpenCL were complaining about this.

Perhaps we shouldn't pass globals as pointer at all, this isn't something what is
really portable and can cause issues on 32 bit perhaps.

2 years agoCycles: Avoid some ccl_local in various kernels
Sergey Sharybin [Tue, 14 Mar 2017 13:44:52 +0000 (14:44 +0100)]
Cycles: Avoid some ccl_local in various kernels

2 years agoCycles: Adjust global size for OpenCL CPU devices to make them faster
Mai Lavelle [Thu, 16 Mar 2017 06:57:45 +0000 (02:57 -0400)]
Cycles: Adjust global size for OpenCL CPU devices to make them faster

2 years agoFix BGE building.
Bastien Montagne [Thu, 16 Mar 2017 09:30:02 +0000 (10:30 +0100)]
Fix BGE building.

When you use typedef'ed enum, you need to define all supported values
explicitely in enum, else compiler goes grumpy...

2 years agoComments: wmOperator.cancel & modal
Campbell Barton [Wed, 15 Mar 2017 19:37:09 +0000 (06:37 +1100)]
Comments: wmOperator.cancel & modal

2 years agoMissed BGE in recent commit
Campbell Barton [Wed, 15 Mar 2017 19:28:03 +0000 (06:28 +1100)]
Missed BGE in recent commit

2 years agoLoad user-preferences before startup file
Campbell Barton [Wed, 15 Mar 2017 16:54:58 +0000 (03:54 +1100)]
Load user-preferences before startup file

Internal change needed for template support.
Loading the user preferences first so it's possible
for preferences to control startup behavior.

In general it's useful to load preferences before data-files,
so we know security settings for eg.

2 years agoCycles: Allow rendering a range of resumable chunks
Sergey Sharybin [Wed, 15 Mar 2017 14:52:27 +0000 (15:52 +0100)]
Cycles: Allow rendering a range of resumable chunks

The range is controlled using the following command line arguments:

  --cycles-resumable-start-chunk
  --cycles-resumable-end-chunk

Those are 1-based index of range for rendering.

2 years agoCycles: Use argument parser for resumable render feature
Sergey Sharybin [Wed, 15 Mar 2017 14:36:40 +0000 (15:36 +0100)]
Cycles: Use argument parser for resumable render feature

Currently there is no functional changes, but we will be adding
couple more of options here soon.

2 years agoFix bug on Blender version string
Dalai Felinto [Wed, 15 Mar 2017 14:42:01 +0000 (15:42 +0100)]
Fix bug on Blender version string

Reported by Pablo Vazquez (venomgfx) over irc.

2 years agoMove Blender version string handling to its own function
Dalai Felinto [Wed, 15 Mar 2017 13:10:20 +0000 (14:10 +0100)]
Move Blender version string handling to its own function

Planning to use this util function in 2.8 for doversioning (to communicate converted layers)

2 years agoFix strict compiler warning in the previous commit
Sergey Sharybin [Wed, 15 Mar 2017 11:48:07 +0000 (12:48 +0100)]
Fix strict compiler warning in the previous commit

2 years agoFix T50938: Cache not being reset when changing simulation settings with new depsgraph
Sergey Sharybin [Wed, 15 Mar 2017 10:10:42 +0000 (11:10 +0100)]
Fix T50938: Cache not being reset when changing simulation settings with new depsgraph

The thing i'm really starting to hate is the requirement to specify both
operation code and node type. Seems to be duplicated enums without real
need for that.

2 years agoBGE: Fix blenderplayer stub.
Porteries Tristan [Tue, 14 Mar 2017 21:15:50 +0000 (21:15 +0000)]
BGE: Fix blenderplayer stub.

Add dummy definition of WM_operator_is_repeat.

2 years agoWM: free operators when repeating
Campbell Barton [Tue, 14 Mar 2017 18:16:07 +0000 (05:16 +1100)]
WM: free operators when repeating

Needed since the active operator isn't ensured to be the last.

2 years agofix D2552: Collada - Follow up change to complete the fix in rBda6cd7762810 (use...
Gaia Clary [Tue, 14 Mar 2017 18:31:15 +0000 (19:31 +0100)]
fix D2552: Collada - Follow up change to complete the fix in rBda6cd7762810 (use unique id for bones with same name in different armatures)

2 years agoCollada simplify: avoid duplicate negation in boolean
Gaia Clary [Tue, 14 Mar 2017 14:07:31 +0000 (15:07 +0100)]
Collada simplify: avoid duplicate negation in boolean

2 years agoWM: add Operator.is_repeat() check for C & Py
Campbell Barton [Tue, 14 Mar 2017 16:43:44 +0000 (03:43 +1100)]
WM: add Operator.is_repeat() check for C & Py

This addresses an issue raised by D2453 -
that there was no way to check if operators are run
multiple times in a row.

Actions are still ignored that don't cause an UNDO event.

2 years agoWM: store operators with undo flag
Campbell Barton [Tue, 14 Mar 2017 15:37:33 +0000 (02:37 +1100)]
WM: store operators with undo flag

This is needed so we can tell if operators are executed repeatedly.

2 years agoUpdate path_menu for recent API change
Campbell Barton [Tue, 14 Mar 2017 15:59:32 +0000 (02:59 +1100)]
Update path_menu for recent API change

2 years agoCycles: Cleanup, indentation
Sergey Sharybin [Tue, 14 Mar 2017 15:54:16 +0000 (16:54 +0100)]
Cycles: Cleanup, indentation

2 years agoFix T50926: python crashes with path containing utf8 characters.
Bastien Montagne [Tue, 14 Mar 2017 15:04:03 +0000 (16:04 +0100)]
Fix T50926: python crashes with path containing utf8 characters.

Default text encoding is platform-dependent in python, and windows
usually do not use utf-8 as default...

2 years agofix D2552: Collada - use unique id for bones with same name but in different armature...
Jon Allee [Tue, 14 Mar 2017 13:17:04 +0000 (14:17 +0100)]
fix D2552: Collada - use unique id for bones with same name but in different armatures. Co-authored-by: Gaia <gaia.clary@machiniamtrix.org>

2 years agoCLNor: rework threaded computation.
Bastien Montagne [Tue, 14 Mar 2017 10:48:11 +0000 (11:48 +0100)]
CLNor: rework threaded computation.

Was using some threaded queue on top of task pool, tssk...

Now using properly task pool directly to crunch chunks of smooth fans.

No noticable changes in speed.

Tried to completely get rid of the 'no threading with few loops' code,
but even just creating/freeing the task pool, without actually pushing
any task, is enough to make code 50% slower in worst case scenario (i.e.
few thousands of simple cube objects).

2 years agoCLNor code: use averaged debug timing.
Bastien Montagne [Mon, 13 Mar 2017 15:44:58 +0000 (16:44 +0100)]
CLNor code: use averaged debug timing.

2 years agoFix T50876: Cycles Crash - Cycles crashes before sampling when certain meshes have...
Bastien Montagne [Mon, 13 Mar 2017 15:13:47 +0000 (16:13 +0100)]
Fix T50876: Cycles Crash - Cycles crashes before sampling when certain meshes have autosmooth enabled.

The root of the issue was in custom normal code, so far it assumed that
we could only have one cyclic smooth fan around each vertex, which is...
blatantly wrong (again, the two cones sharing same vertex tip e.g.).

This required a rather deep change in how smooth fans/clnor spaces are processed,
took me some time to find a 'good' solution.

Note that new code is slightly slower than previous one (maybe about 5%),
not much to be done here, am afraid.

Tested against all older report files I could find, seems OK.

2 years agoFix own mistake in recent 'edge split' refactor.
Bastien Montagne [Mon, 13 Mar 2017 15:11:48 +0000 (16:11 +0100)]
Fix own mistake in recent 'edge split' refactor.

We do can have some vertices to split, while not having any edge (think
about two cones sharing the same tip vertex e.g.).

2 years agoCycles: Try to avoid infinite loops by catching invalid ray states
Mai Lavelle [Sat, 11 Mar 2017 12:03:17 +0000 (07:03 -0500)]
Cycles: Try to avoid infinite loops by catching invalid ray states

2 years agoWM: Option to load startup w/o closing the splash
Campbell Barton [Tue, 14 Mar 2017 10:05:00 +0000 (21:05 +1100)]
WM: Option to load startup w/o closing the splash

Not user visible, needed for switching templates.

2 years agoPyAPI: extend Menu.path_menu
Campbell Barton [Tue, 14 Mar 2017 09:58:16 +0000 (20:58 +1100)]
PyAPI: extend Menu.path_menu

- Add optional 'display_name' callback
  so callers can construct own names.
- Add optional 'prop_filepath' argument
  (for operators that don't use "filepath").
- Add doc-string.
- Use keyword only arguments.

2 years agoFix T50932: depth picking w/ pose-bone constraints
Campbell Barton [Tue, 14 Mar 2017 07:01:04 +0000 (18:01 +1100)]
Fix T50932: depth picking w/ pose-bone constraints

2 years agoCycles: Cleanup, wipe obviously outdated parts of split kernel comments
Sergey Sharybin [Mon, 13 Mar 2017 16:15:40 +0000 (17:15 +0100)]
Cycles: Cleanup, wipe obviously outdated parts of split kernel comments

2 years agofix msvc warnings about unknown opencl pragmas
lazydodo [Mon, 13 Mar 2017 16:07:36 +0000 (10:07 -0600)]
fix msvc warnings about unknown opencl pragmas

2 years agoCycles: Add missing header in the file
Sergey Sharybin [Mon, 13 Mar 2017 15:59:09 +0000 (16:59 +0100)]
Cycles: Add missing header in the file

2 years agoFix T50920: Adds missing edges on return of bisect operator
Germano Cavalcante [Mon, 13 Mar 2017 12:22:11 +0000 (09:22 -0300)]
Fix T50920: Adds missing edges on return of bisect operator

2 years agoFix T50925: Add AO approximation to split kernel
Hristo Gueorguiev [Sun, 12 Mar 2017 21:41:11 +0000 (22:41 +0100)]
Fix T50925: Add AO approximation to split kernel

2 years agoCycles: Make MESA compiler more happy
Sergey Sharybin [Mon, 13 Mar 2017 08:55:18 +0000 (09:55 +0100)]
Cycles: Make MESA compiler more happy

While this compiler is not officially supported yet, getting it to work is
a nice thing because more and more AMD cards will fall under MESA driver.

It's also nice to use explicit comparison with NULL, which makes it more
clear whether variable is a boolean or pointer. Even Rust enforces this!

Patch by Ian Bruce with own modifications.

2 years agoUI: expose mesh conversion in apply menu
Campbell Barton [Sun, 12 Mar 2017 20:28:37 +0000 (07:28 +1100)]
UI: expose mesh conversion in apply menu

The mesh convert operator can 'freeze' a mesh
(WYSIWYG, modifiers, shape keys etc).
However its not very obvious that the way to perform this
operation is to convert a mesh to a mesh.

Expose this as 'Visual Geometry to Mesh' in the 'Apply' menu,
since this is where users might expect to see it.

2 years agoComments: minor clarification
Campbell Barton [Sun, 12 Mar 2017 20:12:28 +0000 (07:12 +1100)]
Comments: minor clarification

2 years agofix T50923: Inconsistent default values and wrong order of parameters in api call
Gaia Clary [Sun, 12 Mar 2017 19:31:34 +0000 (20:31 +0100)]
fix T50923: Inconsistent default values and wrong order of parameters in api call

2 years agoFix T50930 Typo in 'jpeg2k_codec' description
Aaron Carlisle [Sun, 12 Mar 2017 17:55:43 +0000 (13:55 -0400)]
Fix T50930 Typo in 'jpeg2k_codec' description

2 years agoBMesh: rename cryptic functions
Campbell Barton [Sun, 12 Mar 2017 16:45:15 +0000 (03:45 +1100)]
BMesh: rename cryptic functions

Use expanded names for bmesh primitive operations
(urmv jvke semv jfke).

Use 'bmesh_kernel_' prefix,
these functions aren't intended for wide use so favor readability.

Remove BM_face_vert_separate,
it wasn't used and only skipped step of finding correct loop of face.

2 years agoCleanup: style
Campbell Barton [Sun, 12 Mar 2017 17:25:21 +0000 (04:25 +1100)]
Cleanup: style

2 years agoUI: Always open enum-search popups with empty search string
Julian Eisel [Sun, 12 Mar 2017 17:14:43 +0000 (18:14 +0100)]
UI: Always open enum-search popups with empty search string

It might be useful to keep the search string stored in some cases, but
in most it's not useful but confusing. Especially if the string is taken
from a menu showing a different enum.

2 years agoFix T50788: blender startup crash on macOS with some types of volumes available.
Brecht Van Lommel [Sun, 12 Mar 2017 14:48:44 +0000 (15:48 +0100)]
Fix T50788: blender startup crash on macOS with some types of volumes available.

2 years agoFix T50628: gray out cycles device menu when no device configured only for GPU Compute.
Brecht Van Lommel [Sun, 12 Mar 2017 05:45:29 +0000 (06:45 +0100)]
Fix T50628: gray out cycles device menu when no device configured only for GPU Compute.

2 years agoFix icon alignment for pie buttons
raa [Sat, 11 Mar 2017 19:34:09 +0000 (22:34 +0300)]
Fix icon alignment for pie buttons

2 years agoCleanup: code style & cmake
Campbell Barton [Sat, 11 Mar 2017 15:40:04 +0000 (02:40 +1100)]
Cleanup: code style & cmake

2 years agoAdd support for Objects in Drive variable `Rotational Difference`
Germano Cavalcante [Sat, 11 Mar 2017 13:43:23 +0000 (10:43 -0300)]
Add support for Objects in Drive variable `Rotational Difference`

Thus it is according to the Manual
https://docs.blender.org/manual/en/dev/animation/drivers/drivers_panel.html#driver-variables

2 years agoBMesh: Fix BM_face_loop_separate_multi
Campbell Barton [Sat, 11 Mar 2017 12:21:37 +0000 (23:21 +1100)]
BMesh: Fix BM_face_loop_separate_multi

When the loop region passed in had no loops to edge-split from,
it was assumed nothing needed to be done.

This ignored the case where loops share a vertex
without any shared edges.

Now BM_face_loop_separate_multi behaves like BM_face_loop_separate.

Fixed error where faces remained connected by verts in BM_mesh_separate_faces.

2 years agoCorrect recent bmesh separate addition
Campbell Barton [Sat, 11 Mar 2017 12:19:49 +0000 (23:19 +1100)]
Correct recent bmesh separate addition

- Was setting flag incorrectly to avoid re-use.
- Check edge has loops before accessing.

2 years agoFix T50888: Numeric overflow in split kernel state buffer size calculation
Mai Lavelle [Sat, 11 Mar 2017 10:23:11 +0000 (05:23 -0500)]
Fix T50888: Numeric overflow in split kernel state buffer size calculation

Overflow led to the state buffer being too small and the split kernel to
get stuck doing nothing forever.

2 years agoBMesh: add BM_mesh_separate_faces
Campbell Barton [Sat, 11 Mar 2017 09:39:28 +0000 (20:39 +1100)]
BMesh: add BM_mesh_separate_faces

Fast-path for bmesh split operator which duplicates and deletes.
Use when only separating faces, currently used by the intersect tool.

2 years agoMakefile: set tab width=4
Campbell Barton [Sat, 11 Mar 2017 06:14:39 +0000 (17:14 +1100)]
Makefile: set tab width=4

2 years agoFix text and icon positioning issue on high DPI, after recent changes in 32c5f3d.
Brecht Van Lommel [Sat, 11 Mar 2017 03:46:27 +0000 (04:46 +0100)]
Fix text and icon positioning issue on high DPI, after recent changes in 32c5f3d.

2 years agoFix OpenCL warnings about doubles on some platforms.
Brecht Van Lommel [Fri, 10 Mar 2017 23:55:23 +0000 (00:55 +0100)]
Fix OpenCL warnings about doubles on some platforms.

2 years agoBreakdowner - Constrain Transform and Axis
Joshua Leung [Fri, 10 Mar 2017 22:52:58 +0000 (11:52 +1300)]
Breakdowner - Constrain Transform and Axis

This commit adds new features to the breakdowner, giving animators more
control over what gets interpolated by the breakdowner. Specifically:

   "Just as G R S let you move rotate scale, and then X Y Z let you do that
   in one desired axis, when using the Breakdower it would be great to be
   able to add GRS and XYZ to constrain what transform / axis is being
   breakdowned."

As requested here:
https://rightclickselect.com/p/animation/csbbbc/breakdowner-constrain-transform-and-axis

Notes:
* In addition to G/R/S, there's also B (Bendy Bone settings and C (custom properties)
* Pressing G/R/S/B/C or X/Y/Z again will turn these constraints off again

2 years agorBa81ea408367abe2f33b351ff6dcc6b09170fd088 "object" -> "target"
Germano Cavalcante [Fri, 10 Mar 2017 16:54:06 +0000 (13:54 -0300)]
rBa81ea408367abe2f33b351ff6dcc6b09170fd088 "object" -> "target"

2 years agofix T50899: Even though the Shrinkwrap options hide the possibility of using a non...
Germano Cavalcante [Fri, 10 Mar 2017 16:51:04 +0000 (13:51 -0300)]
fix T50899: Even though the Shrinkwrap options hide the possibility of using a non-mesh target, you can still circumvent this... Causing Crash

2 years agoCorrect glPixelTransfer function
Campbell Barton [Fri, 10 Mar 2017 16:02:03 +0000 (03:02 +1100)]
Correct glPixelTransfer function

2 years agoFix T50900: Text-Blocks created from "Edit Source" have zero users.
Bastien Montagne [Fri, 10 Mar 2017 14:41:14 +0000 (15:41 +0100)]
Fix T50900: Text-Blocks created from "Edit Source" have zero users.

2 years agoFix useless allocation of edge_vectors in threaded case of loop split generation.
Bastien Montagne [Tue, 7 Mar 2017 13:19:14 +0000 (14:19 +0100)]
Fix useless allocation of edge_vectors in threaded case of loop split generation.

2 years agoCycles: Cleanup, extra semicolon and space
Sergey Sharybin [Fri, 10 Mar 2017 14:34:54 +0000 (15:34 +0100)]
Cycles: Cleanup, extra semicolon and space

2 years agoAdjust kmi header
raa [Fri, 10 Mar 2017 12:10:40 +0000 (15:10 +0300)]
Adjust kmi header

2 years agoCleanup: struct flags for select picking
Campbell Barton [Fri, 10 Mar 2017 10:47:43 +0000 (21:47 +1100)]
Cleanup: struct flags for select picking

2 years agoCleanup: rename drawObjectSelect
Campbell Barton [Fri, 10 Mar 2017 10:27:33 +0000 (21:27 +1100)]
Cleanup: rename drawObjectSelect

After adding draw_object_select, noticed a similar name.
Rename drawObjectSelect to draw_object_selected_outline.

2 years agoFix T47690: Connected PET w/ individual origins
Campbell Barton [Fri, 10 Mar 2017 09:18:19 +0000 (20:18 +1100)]
Fix T47690: Connected PET w/ individual origins

- Connectivity length was overwritten by distance to closest selected.
- Vertices used the 'island' center of the closest vertex,
  even if it wasn't connected.

Now optionally keep track of the original index of used as the closest
connected distance.

To support this needed to add optional support for islands of 1 vertex.

2 years agoCycles: Enable SSS and volumes for CUDA and Nvidia OpenCL split kernel
Mai Lavelle [Fri, 10 Mar 2017 07:09:41 +0000 (02:09 -0500)]
Cycles: Enable SSS and volumes for CUDA and Nvidia OpenCL split kernel

2 years agoFix T50904: Imprecise timeline frame selection using mouse
Joshua Leung [Fri, 10 Mar 2017 00:38:02 +0000 (13:38 +1300)]
Fix T50904: Imprecise timeline frame selection using mouse

The changes introduced in rB3e628eefa9f55fac7b0faaec4fd4392c2de6b20e
made the non-subframe frame change behaviour less intuitive, by always
truncating downwards, instead of rounding to the nearest frame instead.
This made the UI a lot less forgiving of pointing precision errors
(for example, as a result of hand shake, or using a tablet on a highres scren)

This commit restores the old behaviour in this case only (subframe inspection
isn't affected by these changes)

2 years ago3D View: x-ray support for depth picking
Campbell Barton [Thu, 9 Mar 2017 16:15:58 +0000 (03:15 +1100)]
3D View: x-ray support for depth picking

Selection loop would draw the selection ignoring xray.
Now draw in a separate pass after clearing the depth buffer,
as with regular drawing.

Also disable depth sorting,
caller can sort the hit-list by depth if needed.

2 years agoCycles: add single program debug option for 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 agoRemove (ifdef) draw_documentation from text_draw.c
Dalai Felinto [Thu, 9 Mar 2017 16:02:32 +0000 (17:02 +0100)]
Remove (ifdef) draw_documentation from text_draw.c

This was no longer supported.

2 years ago3D View: wrap GPU_select cache calls
Campbell Barton [Thu, 9 Mar 2017 09:47:37 +0000 (20:47 +1100)]
3D View: wrap GPU_select cache calls

Avoids including GPU_select and makes it more clear that the cache is
needed for view3d_opengl_select calls.

Also use typed enum for select mode.

2 years ago3D View: use cache for armature select
Campbell Barton [Wed, 8 Mar 2017 22:22:56 +0000 (09:22 +1100)]
3D View: use cache for armature select

2 years agoCycles: Fix CUDA build error for some compilers
Mai Lavelle [Wed, 8 Mar 2017 21:44:43 +0000 (16:44 -0500)]
Cycles: Fix CUDA build error for some compilers

Needed to include `util_types.h` before using `uint`.

2 years ago3D View: new nethod of opengl selection
Campbell Barton [Wed, 8 Mar 2017 18:17:55 +0000 (05:17 +1100)]
3D View: new nethod of opengl selection

Intended to replace legacy GL_SELECT, without the limitations of
sample queries which can't access depth information.

This commit adds VIEW3D_SELECT_PICK_NEAREST and VIEW3D_SELECT_PICK_ALL
which access the depth buffers to detect whats under the pointer,
so initial selection is always the closest item.

The performance of this method depends a lot on the OpenGL
implementations glReadPixels.

Since reading depth can be slow, buffers are cached for object picking
so selecting re-uses depth data, performing 1 draw instead of 3
(for 24, 18, 10 px regions, picking with many items under the pointer).

Occlusion queries draw twice when picking nearest,
so worst case 6x draw calls per selection.

Even with these improvements occlusion queries is faster on AMD hardware.

Depth selection is disabled by default, toggle option under select method.
May enable by default if this works well on different hardware.

Reviewed as D2543

2 years agoFix T50849: Transparent background produces artifacts in this compositing setup
Sergey Sharybin [Wed, 8 Mar 2017 14:56:50 +0000 (15:56 +0100)]
Fix T50849: Transparent background produces artifacts in this compositing setup

The issue was caused by sometimes negative color returned by the filter node.

Seems to be caused by precision issues. Don't see any reason why we would want
negative colors in output. Those only causing issues later on.

2 years agoCycles: Make it more obvious message which initialization failed
Sergey Sharybin [Wed, 8 Mar 2017 12:57:21 +0000 (13:57 +0100)]
Cycles: Make it more obvious message which initialization failed

2 years agoFix T49603: Blender/Cycles 2.78 CUDA error on Jetson-TX1~
Sergey Sharybin [Wed, 8 Mar 2017 12:38:01 +0000 (13:38 +0100)]
Fix T49603: Blender/Cycles 2.78 CUDA error on Jetson-TX1~

Patch by Bruno d'Arcangeli (@arcangeli), thanks!

2 years agoOpenGL Select: integer rect for passing region
Campbell Barton [Wed, 8 Mar 2017 12:22:42 +0000 (23:22 +1100)]
OpenGL Select: integer rect for passing region

2 years agoCleanup: replace short -> int for selection hits
Campbell Barton [Wed, 8 Mar 2017 12:15:12 +0000 (23:15 +1100)]
Cleanup: replace short -> int for selection hits

2 years agoRename BLI_rct*_init_pt_size -> radius
Campbell Barton [Wed, 8 Mar 2017 12:10:31 +0000 (23:10 +1100)]
Rename BLI_rct*_init_pt_size -> radius