Commit Graph

5636 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
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
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
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
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
fc3db32f04 Cleanup: Update BSSRDF code comment. 2016-02-04 22:42:55 +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
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
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
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
Bastien Montagne
b80c07321b Fix T47300: SHIFT TAB, CTRL SHIFT TAB shortcuts does not toggle snap, snap mode on off anymore.
Regression from rB12c71508c2d7.

Now, we systematically first try keycode from `XLookupKeysym()`, and only fall back to
the one from `XLookupString()` if it failed to convert to a valid gkey.
2016-02-02 21:27:33 +01:00
Sergey Sharybin
e42852a339 Cycles: Cleanup and reference actual paper used for BSSRDF sampling 2016-02-02 18:06:29 +01:00
Sergey Sharybin
d55bd1bd87 Cycles: Fix wrong clamping used for camera border 2016-02-01 10:02:24 +01:00
Campbell Barton
d924998d3e Cleanup: pep8 2016-02-01 00:47:10 +11:00
6451c072ce Fix T47153: scroll wheel zoom fails with mouses that support smooth scroll on OS X. 2016-01-30 22:33:20 +01:00
Sergey Sharybin
74c7707e8c Cycles: Pass Blender's C++ RNA structures by reference
This way we avoid passing structures which could be up to
few hundred bytes by value to the utility functions.

Ideally we'll also have to add `const` qualifier in majority
of the calls, but C++ RNA does not allow us to do that because
it does not know if some function modifies contents or not.
2016-01-30 15:08:57 +01:00
Thomas Dinges
f688fb6127 Cleanup for last commit, these variables are no longer needed. 2016-01-30 02:12:59 +01:00
Sergey Sharybin
9815f8a623 Cycles: Cleanup of OpenCL split kernel routines
The idea is to switch from allocating separate buffers for shader data's
structure of arrays to allocating one huge memory block and do some index
trickery to make it accessed as SOA.

This saves quite reasonable amount of lines of code in device_opencl and
also makes it possible to get rid of special declaration of ShaderData
structure.

As a side effect it also makes it easier to experiment with SOA vs. AOS
for split kernel.

Works fine here on NVidia GTX580, Intel CPU amd AMD Fiji cards.

Reviewers: #cycles, brecht, juicyfruit, dingto

Differential Revision: https://developer.blender.org/D1593
2016-01-30 00:23:06 +01:00
Sergey Sharybin
fef53c74b5 CMake: Remove per-module Werror settings
Seems i was the only one who was really up to using it and
i do have gcc-5 finally backported and installed here so
such a fine-tune flags are no longer needed.
2016-01-30 00:04:52 +01:00
Sergey Sharybin
e7915ea6eb Cycles: Remove code which was commented out for ages now
It was mainly unfinished code for volume in a split kernel which
should be done differently anyway to avoid such a code copy-paste.

The code didn't really work, so likely nobody will cry.
2016-01-29 18:59:37 +01:00
Sergey Sharybin
25aea19323 Cycles: Remove some unused variables from split kernel function 2016-01-29 18:54:46 +01:00
Sergey Sharybin
e2161ca854 Cycles: Remove few function arguments needed only for the split kernel
Use KernelGlobals to access all the global arrays for the intermediate
storage instead of passing all this storage things explicitly.

Tested here with Intel OpenCL, NVIDIA GTX580 and AMD Fiji, didn't see
any artifacts, so guess it's all good.

Reviewers: juicyfruit, dingto, lukasstockner97

Differential Revision: https://developer.blender.org/D1736
2016-01-28 18:59:27 +01:00
Sergey Sharybin
5f31089957 Cycles: Make OpenCL's argument wrapper able to get int/float values directly 2016-01-28 15:03:42 +01:00
Bastien Montagne
12c71508c2 Fix T47228: Ghost not handling predictably keycodes when first keymap is non-latin.
Why this is not working in original code and works int this one remains mystery
(see comments for details).

Note that we still do not support at all non-latin keymaps for our shortcuts,
this would be nice to add someday, but that's a TODO, not a bug.

Reviewers: sergey, campbellbarton

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D1746
2016-01-28 14:57:33 +01:00
Sergey Sharybin
ff0dcc5d70 Cycles: Make kernel compilable for 3.7 compute capability
It is used by GK210 GPUs which could be found in, i.e. Tesla K80.
2016-01-28 11:56:09 +01:00
Sergey Sharybin
efefae62de Atomics: Use _InterlockedAnd8 direction for 342bit MSVC
That's what MSDN tells you to do and that's how to solve the compilation
error problem with it.
2016-01-27 14:16:02 +01:00
Sergey Sharybin
1f954649c4 OpenVDB: Get rid of hardcoded TBB variables and enabled for Linux buildbot 2016-01-27 12:27:35 +01:00
Bastien Montagne
7e9103b49c atomic_ops: add atomic_fetch_and_and_uint8 wrapper.
Needed by incomming changes in pbvh.c.

Note that we make it much simpler than for other primitives in this file - think
we could revise its content to make it simpler one day...
2016-01-27 12:26:00 +01:00
Sergey Sharybin
8126b0222d Fix T47214: Keyed Particles don't render correctly when used for point density input
The issue was caused by different AABB used by Cycles and texture sampler.

Instead of trying to keep this two functions in sync we now do have an
utility call in the point density node to query the AABB.
2016-01-26 12:50:55 +01:00
Sergey Sharybin
c8d2ebe13c Compositor: Speedup movie (un)distortion operation
Avoid per-pixel camera intrincs object construction and synchronization.

Here on a bit synthetic file it gives about 40% speedup with a single node.
2016-01-26 11:44:43 +01:00
Thomas Dinges
780e900a0d Cycles: Tweak Cycles samples again.
Now we use 128 for final, and 32 for preview. These values should be a bit
better (power of two, also faster with CMJ).
2016-01-24 13:32:20 +01:00
Sergey Sharybin
9163fc05a7 Cycles: Fix typo in flags check 2016-01-24 17:05:02 +05:00
Thomas Dinges
35c3e7b522 Cleanup: Remove outdated comment in volume code.
Thanks to jesterking for finding this one.
2016-01-24 12:31:36 +01:00
Campbell Barton
3174254142 Cleanup: style 2016-01-24 12:13:37 +11:00
Sergey Sharybin
b42878012c Cycles: Make Clang 3.6 happy with const debug flags reference
For some reason it did not like the explicit const qualifier for a
custom type.
2016-01-24 01:33:53 +05:00
Kévin Dietrich
e9452f909c Implementation of OpenVDB as a possible cache format for smoke
simulations.

This commits implements OpenVDB as an extra cache format in the Point
Cache system for smoke simulations. Compilation with the library is
turned off by default for now, and shall be enabled when the library is
present.

A documentation of its doings is available here: http://
wiki.blender.org/index.php/User:Kevindietrich/OpenVDBSmokeExport.

A guide to compile OpenVDB can be found here (Linux): http://
wiki.blender.org/index.php?title=Dev:Doc/Building_Blender/Linux/
Dependencies_From_Source#OpenVDB

Reviewers: sergey, lukastoenne, brecht, campbellbarton

Reviewed By: brecht, campbellbarton

Subscribers: galenb, Blendify, robocyte, Lapineige, bliblubli,
jtheninja, lukasstockner97, dingto, brecht

Differential Revision: https://developer.blender.org/D1721
2016-01-23 08:39:40 +01:00
Thomas Dinges
456e7be9d2 Cycles: Change several default values (first batch).
This changes the following defaults:

- Render settings:

  * Samples: 100
  * Preview Samples: 50
  * Filter: Blackmann-Harris
  * Tile Order: Hilbert Spiral

- Lamp settings:

  * Use MIS: On

- Material settings:

  * Volume Sampling: Multiple Importance

Old files are not affected, I tested the versioning code back and forth.
More changes are to come (World, BVH...) but that needs a bit more work.
2016-01-22 23:19:23 +01:00
Martijn Berger
7788681eda MS Visual Studio 2015 does not find std::inserter 2016-01-21 17:21:32 +01:00