Commit Graph

63096 Commits

Author SHA1 Message Date
Sergey Sharybin
f25f7c8030 Cycles: Re-implement some utilities to avoid use of boost
The title says it all actually, the idea is to make Cycles
only requiring Boost via 3rd party dependencies like OIIO
and OSL.

So now there are only few places which still uses Boost:

- Foreach, function bindings and threading primitives.

  Those we can easily get rid with C++11 bump (which seems
  inevitable sooner or later if we'll want ot use newer
  LLVM for OSL),

- Networking devices

  There's no quick solution for those currently, but there
  are some patches around which improves serialization.

Reviewers: juicyfruit, mont29, campbellbarton, brecht, dingto

Reviewed By: brecht, dingto

Differential Revision: https://developer.blender.org/D1764
2016-02-06 19:19:20 +01:00
Sergey Sharybin
7623d3e071 Cycles: Add some utility tests using GTests
This is an initial move to have unittests to at least cover
utility functions, which then could be extended further to
test such areas as shader optimization and such.

Currently only based on initial "infrastructure" layout and
writing tests needed to test the no-boost patch.

Note: This patch starts to use "<dir>/<header>.h" notation
for the include statements which i just got used to do in
other projects. Something what would be cool to use globally
in the code eventually.

Reviewers: dingto, juicyfruit, lukasstockner97, brecht

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D1770
2016-02-06 19:19:20 +01:00
3867bef904 Fix T47320: Cycles baking in edit mode uses outdated mesh. 2016-02-06 19:14:04 +01:00
Sergey Sharybin
2dba2b3d71 Fix gtests on Windows/MSVC
There were some missing stubs and some tests were specifically
written for Linux. Also, apparently MSVC has a limit of 64K for
the insource strings..
2016-02-06 21:21:55 +05:00
Sergey Sharybin
5508cc2d63 Fix typo in 32bytes aligned malloc test 2016-02-06 16:42:19 +01:00
Sergey Sharybin
a90d5cd692 Cycles: Remove workaround for MSVC2010 and Boost
We've upgraded to Boost-1.60 and MSVC2013 since the workaround
was originally committed. After checks with current compiler and
libraries the original bug is no longer happening.

This will make string comparison much faster in Windows, solving
synchronization bottlenecks of fewzillion objects.

Thanks Martin Felke (aka scorpion81) for the tests!
2016-02-06 15:56:47 +01:00
Sergey Sharybin
e1f5b2b4c1 Fix GTests compilations on Windows
Unfortunately this doesn't make all tests compilable due
to all sort of weird and wonderful bad levels includes
on Windows (G referenced from bf_blenlib) but at least
allows to selectively build tests for now.
2016-02-06 15:12:28 +01:00
Sergey Sharybin
d978f23f71 CMake: Remove mention of extern_redcode, it was removed 2016-02-06 14:37:29 +01:00
6081f6c387 Fix T47204: selection failing directly after disabling multisample in user prefs.
Now store the multisample setting each window was created with.
2016-02-06 12:21:41 +01:00
e602fe60c0 Code cleanup: resolve minor Cycles todo's. 2016-02-06 11:56:37 +01:00
d5e929a9d3 Code cleanup: remove unused Cycles code from BVH cache. 2016-02-06 11:55:35 +01:00
4443bb8922 Fix Burley BSSRDF NaNs and fireflies.
Explicitly truncate to Rm same way as the Gaussian BSSRDF, and use safe_sqrtf()
to be sure in case of float precision issues.
2016-02-06 11:52:43 +01:00
Thomas Dinges
a6ca8a1b73 Cleanup: Remove support for OSL versions < 1.6.
We can get rid of more ifdefs once all platforms are on OSL 1.7 soon.
2016-02-06 00:07:20 +01:00
Thomas Dinges
66a9698978 Cycles: Change several default values (second batch).
This change the following values:
- World settings:
	- Use MIS: On
	- MIS Samples: 1
	- MIS Resolution: 1024

Enabling World MIS per default won't make simple backgrounds (flat background color) slower,
see previous commit. This gets disabled internally if World MIS is not actually needed.
2016-02-05 22:45:36 +01:00
Thomas Dinges
469447f707 Cycles: Auto disable World MIS, if we only use a simple color.
When World MIS is enabled by the user, we now check if we actually need it.
In case of a simple node setup (no procedurals, no HDRs..) we auto disable MIS internally to save render time.

This change is important for upcoming default changes.
2016-02-05 22:13:51 +01:00
Thomas Dinges
ca88bc5ac1 Cleanup: Rename has_heterogeneous_volume variable.
No functional changes, this change is done for consistency of upcoming changes.
2016-02-05 21:33:37 +01:00
Bastien Montagne
2685d45fa2 Fix error in last commit.
treedata could have a non-initialized tree in case of edge_snapping, leading to segfault.

Spotted by @mano-wii, thanks.
2016-02-05 18:48:15 +01:00
Bastien Montagne
3ad0344171 Fix T47326: Snap to vertices not working properly in orthogonal view mode.
Same causes as when snapping to faces, so same solution: in case of ortho view,
offset start of ray to be just slightly outside of the target's bbox, to avoid
too much far away start point that generate floating point computation instability
in BVH raycasting.

Note that this lead to some refactoring, to avoid duplicating too much of code.

For now, edge snapping seems to behave OK (uses different logic), so not touched.

Based on patch by Germano Cavalcante (@mano-wii), thanks!
2016-02-05 18:18:27 +01:00
Sergey Sharybin
d3889e2cad Fix T47329: Compositing fails to render unless each included scene was rendered since opening 2016-02-05 14:58:15 +01:00
Joshua Leung
c4dc14b079 Fix T45915: Cannot select keyframes in summary channels in Dope Sheet in TweakMode
When in TweakMode on NLA strips that had an offset, it was not possible to select
those keyframes in the Summary Channel in the Dope Sheet.

The main gist of it is that the current code is from before the summary track was
introduced, and so could assume that ANIM_nla_mapping_get() would work for all channels
present. Thus, simply converting the clicked frame to nla-mapped time once would be
enough. However, for summary channels, nla-mapping_get() doesn't do anything, since
we can potentially include keyframes from several different objects!
2016-02-06 02:40:43 +13:00
Joshua Leung
c105c59bb4 Fix T46037: Moving keys in NLA tweak mode on offset actions results in Bezier handles getting stretched unreasonably
Patch by Alexander Gavrilov (angavrilov)

Reviewed by Joshua Leung (aligorith)
2016-02-06 02:40:43 +13:00
Sergey Sharybin
c53c8df6d9 Cycles: ifdef some extra code when building split kernels 2016-02-05 14:11:16 +01:00
Sergey Sharybin
24ae7b9035 Cycles: Don't gray out integrator settings when userprefs are set to OpenCL but scene is set to CPU 2016-02-05 13:40:51 +01:00
Bastien Montagne
3758828d33 Install_deps: update magic build numbers of OIIO and OSL.
Please remember to change those each time you update building code and there is no version change.
Otherwise poeple re-running the script won't get the updated builds.
2016-02-05 12:03:58 +01:00
Sergey Sharybin
e688a62712 Cycles: Fix for initial guess of the radius for Burley BSSRDF
The value was too high, causing bad Newton iteration step.
Now the value is not so good, but it's still within 9 iterations
and those high number of iterations are only happening in
approx 1% of input values.
2016-02-05 10:06:08 +01:00
Thomas Dinges
da7ddb69e9 Cycles / OSL: Updare stdosl.h to 1.7.1.
This updates our file to OSL 1.7.1, which comes with some new inbuilt
features:

- linearstep()
- smooth_linearstep()

- hash()
- getchar()
2016-02-05 00:05:26 +01:00
Thomas Dinges
208a49b1c3 Install Deps: Use SSE2 optimizations for OIIO and OSL. 2016-02-04 23:42:39 +01:00
Thomas Dinges
fc3db32f04 Cleanup: Update BSSRDF code comment. 2016-02-04 22:42:55 +01:00
Campbell Barton
d80f8baba5 Support for cubemap reflections in the viewport
D1756 by @youle, uses existing texture mapping option.
2016-02-05 04:30:06 +11:00
Campbell Barton
45071fa0f5 Update themes
Label text editing uses colors from text buttons
2016-02-05 04:30:06 +11:00
Thomas Beck
1da4628c74 Install_deps: Disable building tests for OSL
Since we're now on 1.7 we can skip building the OSL testsuite. It was giving various compilation errors on different machines and we don't need them anyway...so just disabling them in the script.
2016-02-04 18:10:20 +01:00
Campbell Barton
55dcdb9bd7 Fix T47324: Edit-text in list view theme glitch
Use existing text select colors when text matches select color.
2016-02-05 03:28:22 +11:00
Bastien Montagne
e7e9613fe6 Install_deps: tweak OSL build options. 2016-02-04 16:52:13 +01:00
Bastien Montagne
2b1a08c213 Install_deps: updated OSL to 1.7.1. 2016-02-04 16:35:32 +01:00
Sergey Sharybin
3e7389eaf2 Cycles: Speedup of Christensen-Burley SSS falloff function
The idea is simply to pre-compute fitting and parameterization
in the bssrdf_setup() function and re-use the values in both
sample() and eval().

The only trick is where to store the pre-calculated values and
the answer is inside of ShaderClosure->custom{1,2,3}. There's
no memory bump here because we now simply re-use padding fields
for the pre-calculated values. Similar trick we can do for other
BSDFs.

Seems to give nice speedup up to 7% here on my desktop with
Core i7 CPU, SSE4.1 kernel.
2016-02-04 15:29:58 +01:00
Thomas Dinges
f250aa9d86 Fix T47323, no Fac output in Magic texture (OSL). 2016-02-04 14:08:36 +01:00
Sergey Sharybin
ac53999d1b Nodes: Remove code which was dead for 2 years now 2016-02-04 09:57:00 +01:00
Sergey Sharybin
f41a5c60a7 Cycles: Make Christensen-Burley a default falloff function 2016-02-04 09:52:56 +01:00
Sergey Sharybin
ad26407b52 Cycles: Implement approximate reflectance profiles
Using this paper:

  http://graphics.pixar.com/library/ApproxBSSRDF/paper.pdf

This model gives less blurry results than the Cubic and Gaussian
we had implemented:

- Cubic: https://developer.blender.org/F279670
- Burley: https://developer.blender.org/F279671

The model is called "Christensen-Burley" in the interface, which
actually should be read as "Physically based" or "Realistic".

Reviewers: juicyfruit, dingto, lukasstockner97, brecht

Reviewed By: brecht, dingto

Subscribers: robocyte

Differential Revision: https://developer.blender.org/D1759
2016-02-04 13:27:23 +05:00
Campbell Barton
d8a998ce71 Use contextlib for temporary py console overrides
Using context overrides means stdout/stderr overrides can't be left set by accident.
2016-02-04 17:40:02 +11:00
Campbell Barton
0034765208 Project Paint: add sample merged option
This picks the on-screen color instead of using the active layers texture color.
2016-02-04 15:26:07 +11:00
Campbell Barton
50a19cc852 Fix T47317: Dynamic paint crashes with no UV layer 2016-02-04 14:19:32 +11:00
Sergey Sharybin
24eecb00de Cycles: Correction to asserts, they will never trigger before 2016-02-03 15:01:26 +01:00
Sergey Sharybin
3aa74828ab Cycles: Cleanup, indentation and braces 2016-02-03 15:00:55 +01:00
Sergey Sharybin
87cbcd697b Fix T47266: Blender crashes from Scripted Expression in Driver
Issue was caused by update RNA callbacks freeing the dependency
graph, which is only needed to tag depsgraph for rebuild.

Solved by using a flag for the depsgraph which indicated that it
is to be rebuilt.
2016-02-03 14:40:02 +01:00
Sergey Sharybin
557074c30a Cycles: Cleanup, indentation
Not sure why it was mixed tabs and spaces, it's all just
confusing in different editors.
2016-02-03 12:17:39 +01:00
Sergey Sharybin
d6531a5662 Fix T47302: Crash when OSL active with a viewport on rendered
Only happened when rendering second time with OSL enabled.
Was caused by fix for T47201. Hopefully now all the issues
are solved (meaning, we don't keep files opened and don't
crash either).
2016-02-03 12:11:23 +01:00
Campbell Barton
2a65acc952 Cleanup: parenthesize macros 2016-02-03 21:17:07 +11:00
Campbell Barton
9ab7482657 Imbuf: remove libredcode
D1751, remove this library since its quite a specific - only supports an older version of this codec.

Also ffmpeg has added support for recent versions of the codec.
2016-02-03 18:39:37 +11:00
Campbell Barton
31776d8a67 Cleanup: refactor tooltip data-access out of layout function 2016-02-03 18:01:18 +11:00