Commit Graph

7631 Commits

Author SHA1 Message Date
a0402074ed Fix wrong CUDA version warning in cmake.
Fix suggested by Dalai.
2018-09-19 16:24:45 +02:00
Campbell Barton
4c918efd44 Cleanup: trailing space 2018-09-19 12:04:34 +10:00
Ray Molenkamp
16b8d223b7 Cycles: Fix usage of AVX2 intrinsics in AVX kernel
While building the AVX kernel, util_avxf.h/avxb.h were using some AVX2 intrinsics,
these were never called, so it wasn't a run-time issue, but the intrinsics headers
on centos excluded the AVX2 prototypes when building the AVX kernel causing build errors.

This commit cleans up the improper usage of the AVX2 intrinsics and provides AVX
fallback implementations for future use.

Differential Revision: https://developer.blender.org/D3696
2018-09-17 16:27:13 -06:00
Sergey Sharybin
284cd1375b Cycles: Cleanup, remove dead code 2018-09-17 18:07:22 +02:00
Sergey Sharybin
81f1f9c85e Cycles: Remove unused malformed function
This isn't really possible to do the shuffle which was attempted to do.

While it's possible to achieve expected behavior, the function needs to
be rewritten. Since it's not used anyway, it's simpler to remove it for
now.
2018-09-17 18:05:32 +02:00
Sergey Sharybin
82e729d986 Cycles: Use proper mask for vectrorized boolean print 2018-09-17 18:02:01 +02:00
Sergey Sharybin
aa844ad676 Cycles: Don't allocate Extra if BSDF allocation failed
Failed as in did not allocate due to possibly weight cutoff.
Tryign to allocated Extra storage for closure in such situation
will consfuse Cycles and cause crashes later one due to obscure
values in ShaderData.
2018-09-12 12:28:55 +02:00
a1651ddc98 Build: require OpenJPEG 2.x minimum, remove bundled version.
* WITH_SYSTEM_OPENJPEG is removed and is now always on, this was already
  the case for macOS and Windows.
* This should not break existing Linx builds. If there is no new enough
  OpenJPEG installed, CMake will no find libopenjp2 and WITH_IMAGE_OPENJPEG
  will be disabled.
* install_deps.sh was updated with new package names, since distributions
  put this version in a new package.

Differential Revision: https://developer.blender.org/D3663
2018-09-11 12:45:05 +02:00
76a4042c23 Fix Cycles principled BSDF black with transmission and IOR 1.0. 2018-09-10 18:50:15 +02:00
a5bb401704 Cleanup: fix compiler warning. 2018-09-06 20:09:13 +02:00
0728c897d7 Fix T56704: black / NaN values in Cycles normal pass. 2018-09-06 20:06:23 +02:00
Mai Lavelle
feb3c74a05 Cycles: Allow cancel during displacement of meshes 2018-09-06 00:25:35 -04:00
Ray Molenkamp
19c7e499e1 cycles: Fix x86 build error.
WITH_CYCLES_CUDA_BINARIES was set as a regular variable causing it to be overwritten by the release.cmake settings.
2018-09-04 16:58:41 -06:00
Alex Fuller
107f1c0a2b Fix Cycles half float pragma for strict OpenCL compilers (like ROCm).
Differential Revision: https://developer.blender.org/D3669
2018-09-03 12:03:56 +02:00
Campbell Barton
0ddf3e110e Cleanup: comment blocks 2018-09-02 18:51:31 +10:00
9492522db5 Fix T56618: crash when typing certain characters on Linux. 2018-08-31 12:43:39 +02:00
Sergey Sharybin
e51f51d55d Cycles: Cleanup, use explicit comparison with NULL 2018-08-31 12:28:12 +02:00
Sergey Sharybin
8ee76535da Fix T56626: Cycles ambient occlusion only local : crash
Was caused by missing NULL pointer check in BVH8.
2018-08-31 12:14:36 +02:00
Sergey Sharybin
94ea566b5a Cycles: Cleanup, whitespace after keyword 2018-08-30 17:34:11 +02:00
Sergey Sharybin
8c3d2e549c Cycles: Fix detection of CPU brand string on 32 bit platforms
The assembler template was backing up and restoring ebx, which is
fair enough. However, this did not prevent compiler for putting
result variables to ebx. This was causing data corruption.

In order to prevent this easiest solution is to list ebx in clobbers
for the assembly.
2018-08-30 12:52:27 +02:00
49041e5611 Fix T56612: crash in Cycles viewport render update, after recent changes.
BVH8 refitting code had a bug.
2018-08-30 12:46:46 +02:00
a1b38a635e Cleanup: license header formatting. 2018-08-30 12:09:47 +02:00
Campbell Barton
76a9752be2 Cleanup: trailing space 2018-08-30 01:05:13 +10:00
ddf8c49736 Fix Cycles CUDA build after recent changes. 2018-08-29 16:35:21 +02:00
a7f5418caa Cleanup: consistent includes. 2018-08-29 16:32:07 +02:00
Sergey Sharybin
b2c707747d CMake: Comply with include path reported by FindOpenGL.cmake
The script clearly states:

  This makes the presumption that you are include al.h like
  #include "al.h"
  and not
  #include <AL/al.h>
  The reason for this is that the latter is not entirely portable.
  Windows/Creative Labs does not by default put their headers in AL/ and
  OS X uses the convention <OpenAL/al.h>.

This commit makes default precompiled OpenAL to be properly detected
and also removes hack on MacOS which was finding the OpenAL package but
then was overwriting include directory.

Note, that new audaspace in 2.8 is using expected #include <al.h>.
2018-08-29 15:08:28 +02:00
Sergey Sharybin
73f2056052 Cycles: Add BVH8 and packeted triangle intersection
This is an initial implementation of BVH8 optimization structure
and packated triangle intersection. The aim is to get faster ray
to scene intersection checks.

    Scene                BVH4      BVH8
barbershop_interior    10:24.94   10:10.74
bmw27                  02:41.25   02:38.83
classroom              08:16.49   07:56.15
fishy_cat              04:24.56   04:17.29
koro                   06:03.06   06:01.45
pavillon_barcelona     09:21.26   09:02.98
victor                 23:39.65   22:53.71

As memory goes, peak usage raises by about 4.7% in a complex
scenes.

Note that BVH8 is disabled when using OSL, this is because OSL
kernel does not get per-microarchitecture optimizations and
hence always considers BVH3 is used.

Original BVH8 patch from Anton Gavrikov.
Batched triangles intersection from Victoria Zhislina.
Extra work and tests and fixes from Maxym Dmytrychenko.
2018-08-29 15:03:09 +02:00
Ray Molenkamp
5e8a030a08 cmake: adjustments required for lib-upgrade on windows. 2018-08-27 19:38:31 -06:00
Colby Klein
31c99c0c4e Fix pen tablet stuck on Windows for some non-Wacom tablets.
Differential Revision: https://developer.blender.org/D3573
2018-08-26 23:19:31 +02:00
Campbell Barton
03fd1da3ee Cleanup: trailing space 2018-08-26 20:20:35 +10:00
Lukas Stockner
94efc651d4 Cycles Denoiser: Allocate a single temporary buffer for the entire denoising process
With small tiles, the repeated allocations on GPUs can actually slow down the denoising quite a lot.
Allocating the buffer just once reduces rendertime for the default cube with 16x16 tiles and denoising on a mobile 1050 from 22.7sec to 14.0sec.
2018-08-25 12:23:52 -07:00
Lukas Stockner
60a5ba265c Cycles: Add Denoising Clean to the debugging denoising passes 2018-08-25 09:32:29 -07:00
Sergey Sharybin
658a9c6cf5 Cycles: Cleanup, style
I wouldn't mind changing style to have space after keyword, but there was
no official code style change proposed.
2018-08-24 14:36:18 +02:00
Sergey Sharybin
e92e90c30e Cycles: Fix wrong looking voronoi of second 2nd closest
Was only happening for release builds made with GCC-8. Probably some
optimization strtegy was confused by uninitialized variable.
2018-08-24 12:29:13 +02:00
Lukas Stockner
b3ac3d13a2 Cycles: Add option for building CUDA kernels sequentially
Building the CUDA kernels takes quite a bit of memory, and when building all of
them the combined usage can be too much on some systems (especially VMs).

Therefore, this patch adds an option to force the build system to build them
sequentially by making each build step depend on the previous kernel.

Reviewers: brecht, sergey

Differential Revision: https://developer.blender.org/D3623
2018-08-22 19:54:59 -07:00
7ffcce8607 Fix Cycles AO pass not working for shadow catcher objects. 2018-08-20 16:09:17 +02:00
Stefan Werner
a9700e7ad2 Fix T56359: Unitialized variable in Cycles OpenCL could cause crashes. 2018-08-14 22:51:53 +02:00
fclem
e20a0798dc Cycles: Append compute units for RX Vega card names
Makes it more clear whether compute device is Vega 56 or Vega 64.
2018-08-09 15:51:23 +02:00
fclem
01feb5d6cc Cycles: Report more details about OpenCL devices 2018-08-09 15:51:23 +02:00
fclem
a241286859 Cycles: Util, add to_string() with some helper
Currently unused, but will allow to convert unknown
argument type to a string for reporting and such.
2018-08-09 15:51:23 +02:00
Campbell Barton
697d4b227e Ghost/X11: correct function signature 2018-08-08 17:54:41 +10:00
Campbell Barton
931a279f44 Cleanup: use static variables 2018-08-08 11:00:57 +10:00
5261cd233c Fix Cycles crash rendering mix of instanced and non-instanced volumes. 2018-08-05 12:05:10 +02:00
e50a3dd4c4 Fix T56197: Cycles OpenCL build error after recent changes. 2018-08-01 19:44:32 +02:00
Campbell Barton
a3085190f8 Fix building w/ FreeBSD
fileno could be a macro which can't take a void pointer.
2018-07-31 20:52:36 +10:00
885cc4cf9a Build: require C11/C++11 for all operating systems in master.
This is in preparation of upgrading our library dependencies, some of which
need C++11. We already use C++11 in blender2.8 and for Windows and macOS, so
this just affects Linux.

On many distributions this will not require any changes, on some
install_deps.sh will need to be run again to rebuild libraries.

Differential Revision: https://developer.blender.org/D3568
2018-07-30 17:12:24 +02:00
Stefan Werner
b59d85b5a5 Cycles: Fixed OpenCL build. sqr(float4) is available on CUDA and CPU, but not on OpenCL. 2018-07-30 15:42:00 +02:00
Stefan Werner
b747524144 Cycles: speed up mesh volume bounds construction.
Patch by Stefan, with minor tweaks by Brecht.
2018-07-28 19:23:35 +02:00
Lukas Stockner
bcefb202a2 Cycles: Save a few instructions in area light sampling
Just basic algebra - because all vectors have the same z coordinate, a lot of terms end up cancelling out.

Not exactly a massive improvement, but it's measurable with Branched PT and a high sample count on the lamp.

Reviewers: brecht, sergey

Reviewed By: brecht

Subscribers: swerner

Differential Revision: https://developer.blender.org/D3540
2018-07-27 23:42:50 +02:00
Sergey Sharybin
84d47e3685 Cycles: Initial implementation of detailed statistics
Gathers information about object geometry and textures. Very basic at
this moment, but need to start somewhere.

Things which needs to be included still:

- "Runtime" information, like BVH. While it is not directly controllable
  by artists, it's still important to know.

- Device array sizes. Again, not under artists control, but is added to
  the overall size.

- Memory peak at different synchronization stages.

At this point it simply prints info to the stdout after F12 is done,
need better control over that too.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D3566
2018-07-27 17:19:54 +02:00
Sergey Sharybin
709b36e43b Cycles: Add utility function to query graph node size in bytes 2018-07-27 17:19:54 +02:00
9a080d2ea6 Fix T56092: command line arguments after -- beginning with -h don't work. 2018-07-27 11:35:38 +02:00
Sergey Sharybin
67e690f5fc Cycles: Cleanup, indentation 2018-07-27 11:19:29 +02:00
Sergey Sharybin
75c47542d7 Cycles: Cleanup, indentation 2018-07-27 11:09:10 +02:00
Sergey Sharybin
b517b31085 Cycles: Cleanup, spelling 2018-07-27 10:30:10 +02:00
Sergey Sharybin
fcea94489c Cycles: Cleanup, indentation 2018-07-27 10:28:28 +02:00
Sergey Sharybin
46b85d195c Cycles: Cleanup, line length 2018-07-27 10:28:06 +02:00
Sergey Sharybin
ca359461a8 Cycles: Cleanup, move functions outside of class methods
There is no reason or justification to have helper functions as
class methods: they do not depend on anything in the class itself.

There are probably more cases like that.
2018-07-27 10:24:03 +02:00
Sergey Sharybin
de80b928a3 Cycles: Cleanup, remove unused function 2018-07-27 10:22:45 +02:00
Sergey Sharybin
e977fe985f Cycles: Cleanup in image manager, switch statement instead of if-else
Allows to catch enumerator values which are missing from being handled.

Also use `const char*`, no need to construct string just to throw it away.
2018-07-27 10:18:13 +02:00
Lukas Stockner
d6e769d32e Cycles: Add reflection fix to Bump and Normal Map nodes
While changing the shading normal is a great way to add additional detail to a model, there are some problems with it.
One of them is that at grazing angles and/or strong changes to the normal, the reflected ray can end up pointing into the actual geometry, which results in a black spot.

This patch helps avoid this by automatically reducing the strength of the bump/normal map if the reflected direction would end up too shallow or inside the geometry.

Differential Revision: https://developer.blender.org/D2574
2018-07-26 17:00:31 +02:00
Alexander Gavrilov
ec640510a8 Fix T55958: allow the user to select between spring and spring2.
The old springs with damping 1.0 operate in a special way that
is more similar to plastic deformation than a spring. Some users
rely on that, so let the user choose which implementation to use.
This also restores full backward compatibility with 2.79.

Reviewers: sergof

Differential Revision: https://developer.blender.org/D3544
2018-07-24 10:10:48 +03:00
a6f750dd41 Fix T54455, T56053, T55564: Cycles OpenCL build error after recent changes. 2018-07-20 19:10:45 +02:00
20191980f4 Cycles: increase volume stack to support 32 overlapping volumes.
This increases stack memory usage some, and ideally we'd support a dynamic
size. But this is quite difficult on the GPU and hopefully 32 is enough even
for very complex cases.
2018-07-18 22:58:52 +02:00
L. E. Segovia
5078b9d2d0 Cycles: add Principled Hair BSDF.
This is a physically-based, easy-to-use shader for rendering hair and fur,
with controls for melanin, roughness and randomization.

Based on the paper "A Practical and Controllable Hair and Fur Model for
Production Path Tracing".

Implemented by Leonardo E. Segovia and Lukas Stockner, part of Google
Summer of Code 2018.
2018-07-18 13:59:06 +02:00
Sergey Sharybin
e6af8758c8 Ghost: Fix memory leak happening with keyboard mapping access
So far only noticed system de-initialization doesn't perform full
object free. So rather harmless but yet stupid.
2018-07-16 17:32:57 +02:00
edbb2d2279 Fix Cycles incorrect resize and CMYK conversion of uint16/half images. 2018-07-15 18:38:09 +02:00
charlie
83a4e1aaf9 Cycles: add voronoi features and distance settings from Blender.
Features to get the 2nd, 3rd, 4th closest point instead of the closest, and
various distance metrics. No viewport/Eevee support yet.

Patch by Michel Anders, Charlie Jolly and Brecht Van Lommel.

Differential Revision: https://developer.blender.org/D3503
2018-07-15 00:45:42 +02:00
4697604331 Cleanup: use float3 SSE instead of ssef for voronoi texture. 2018-07-14 23:58:20 +02:00
Charlie Jolly
30bffb5a3a Nodes: add sqrt, ceil, floor and fract to math nodes.
This works for Cycles, Eevee, texture nodes and compositing. It helps to
reduce the number of math nodes required in various node setups.

Differential Revision: https://developer.blender.org/D3537
2018-07-13 11:00:10 +02:00
Campbell Barton
0108ce1fe5 Cleanup: pep8, cycles 2018-07-12 11:03:13 +02:00
Sergey Sharybin
d0920fba16 OpenSubdiv: Fix wrong topology refiner cast 2018-07-10 14:40:51 +02:00
Sergey Sharybin
c17cb50ae2 OpenSubdiv: Make more flexible C-API to specify FVar interpolation 2018-07-10 14:40:45 +02:00
Sergey Sharybin
719629f2aa GHOST: Fix memory leak in X11 DPI query
The X resource database is to be explicitly destroyed. This fixes 46 bytes
leak per every window DPI query (which happens a lot on window move/resize
and even on areas resize).

Unfortunately, this does not fully fix the leak since the known leak:

  https://bugs.freedesktop.org/show_bug.cgi?id=94604
2018-07-10 10:59:06 +02:00
Stefan Werner
df30b50f2f Cycles: Enabled half precision textures for OpenCL devices that support the cl_khr_fp16 extension. 2018-07-06 11:42:34 +02:00
Stefan Werner
d20d2bcb7f Cycles: Fixed OpenCL kernel build, it threw a compiler error. 2018-07-06 10:21:25 +02:00
Campbell Barton
1daa20ad9f Cleanup: strip trailing space for cycles 2018-07-06 10:17:58 +02:00
Stefan Werner
4d00e95ee3 Cycles: Adding native support for UINT16 textures.
Textures in 16 bit integer format are sometimes used for displacement, bump and normal maps and can be exported by tools like Substance Painter. Without this patch, Cycles would promote those textures to single precision floating point, causing them to take up twice as much memory as needed.

Reviewers: #cycles, brecht, sergey

Reviewed By: #cycles, brecht, sergey

Subscribers: sergey, dingto, #cycles

Tags: #cycles

Differential Revision: https://developer.blender.org/D3523
2018-07-05 13:53:34 +02:00
Lukas Stockner
c960804747 Cycles Denoising: Pass tile buffers to every OpenCL kernel to conform to standard and get rid of set_tile_info 2018-07-04 14:38:03 +02:00
Lukas Stockner
f1525cf534 Cycles Denoising: Correctly handle target buffer in tile unmapping and move device swap logic to the device_memory 2018-07-04 14:37:55 +02:00
Lukas Stockner
9db8bdbc65 Cycles Denoising: Cleanup: Rename tiles to tile_info 2018-07-04 14:37:24 +02:00
Lukas Stockner
97a0d6fcc7 Cycles Denoising: Refactor denoiser tile handling
This deduplicates the calls for tile (un)mapping and allows to have a target buffer that is different from the source buffer (needed for baking and animation denoising).
2018-07-04 14:36:01 +02:00
Lukas Stockner
b10c64bd2f Cycles Denoising: Split main function into logical steps 2018-07-04 14:35:05 +02:00
Sergey Sharybin
e5767eaad1 Cycles: Fix missing curve hair when building with GCC-8 in release mode
Reshuffle cast intrinsics to make XOR to operate on __m128i rather
than on __m128.

Hopefully this does not affect performance.
2018-07-02 15:16:14 +02:00
9c5203c98f Fix T55626, fix T55106: Cycles motion blur + persistent images bug. 2018-07-01 16:32:35 +02:00
Campbell Barton
ddee0931b8 RNA: use bool for boolean RNA types
We were using int's for bool arguments in BKE,
just to avoid having wrapper functions.
2018-07-01 15:57:59 +02:00
ccacf3ae3c Cycles: change AO node default to 16 samples and only local off. 2018-06-29 15:43:55 +02:00
Campbell Barton
b372766816 Cleanup: trailing newlines 2018-06-29 09:23:51 +02:00
Campbell Barton
af36dd4664 Cleanup: trailing newlines 2018-06-29 08:02:49 +02:00
9536f67e7e Fix Cycles tests build on macOS. 2018-06-28 00:11:01 +02:00
Stefan Werner
73eb1bfd55 Revert "Turned off clang warnings in third party includes."
This reverts commit d53093953f8f3b58600cb19020ecbe0b5f254b52.
2018-06-26 10:26:56 +02:00
Lukas Stockner
87f598fd3f Cycles: Fix wrong row count for World MIS CDF calculation 2018-06-26 05:35:30 +02:00
Stefan Werner
d53093953f Turned off clang warnings in third party includes.
The latest clang compiler (at least the one in Xcode 9.4.1) warns about the register keyword and macro expansions using defined().
Since these warnings come from third party code, we can't address them directly in Blender. Silencing them via #pramgas will
at least keep the warnings during a build down to the ones that are relevant to Blender code.
2018-06-25 23:02:01 +02:00
574c716f2d Cycles: change AO node color default to 1.0. 2018-06-24 12:24:30 +02:00
Sergey Sharybin
6cd0484de8 CMake: Make language explicit for per-file strict flags removal 2018-06-22 14:40:00 +02:00
cd6cb55ff3 Fix Cycles incorrect versioning for automatic sample world resolution. 2018-06-21 15:28:59 +02:00
a283333cd8 Fix Cycles CUDA render errors with CUDA 9.2.
Work around what might be a compiler bug.
2018-06-21 12:32:32 +02:00
d6313f47af Fix T55564: Cycles OpenCL build error on some scenes. 2018-06-21 11:46:52 +02:00
Stefan Werner
9ff135d85d Cycles: Fixed crash when the camera was inside 16 volumes or more. It still won't render those volumes correctly, but at least the crash is addressed. 2018-06-19 16:35:18 +02:00
668f39519c Fix T55528: Cycles AO node should default to 1 if radius is 0. 2018-06-19 11:45:05 +02:00
Campbell Barton
e7a68ef843 Cleanup: trailing space in CMake files 2018-06-17 20:15:24 +02:00
Lukas Stockner
b955747875 Cycles Cleanup: Remove unneccessary color management call 2018-06-16 13:47:49 +02:00
Lukas Stockner
799779d432 Cycles: change Ambient Occlusion shader to output colors.
This means the shader can now be used for procedural texturing. New
settings on the node are Samples, Inside, Local Only and Distance.

Original patch by Lukas with further changes by Brecht.

Differential Revision: https://developer.blender.org/D3479
2018-06-15 22:16:06 +02:00
2e25a48b05 Fix more Cycles CUDA errors after recent changes. 2018-06-15 16:28:09 +02:00
8148d549bb Fix Cycles CUDA error after recent changes. 2018-06-15 10:26:28 +02:00
Lukas Stockner
3ee606621c Cycles: Query XYZ to/from Scene Linear conversion from OCIO instead of assuming sRGB
I've limited it to just the RGB<->XYZ stuff for now, correct image handling is the next step.

Reviewers: brecht, sergey

Differential Revision: https://developer.blender.org/D3478
2018-06-14 22:21:37 +02:00
Lukas Stockner
064e701472 Cycles: Connect value inputs to Strength instead of Color when inserting an Emission node
Same result, but saves an additional ConvertNode.
2018-06-14 22:16:42 +02:00
Lukas Stockner
716e138a1b Cycles: Automatically detect HDRI resolution by default and use non-square sampling map
The automatic mode checks all Enviroment Texture nodes and picks the largest image's resolution.
If there are no Enviroment Textures, it just uses the old default.

Also, the sampling map now isn't limited to square shapes. The automatic detection uses the exact image size,
the manual UI option now halves the value to get the height.

A default aspect ratio of 2:1 makes sense since this is what most HDRIs use.

Reviewers: brecht, sergey

Differential Revision: https://developer.blender.org/D3477
2018-06-14 22:07:07 +02:00
90e6323ed8 Cycles: auto insert emission node when linking color to closure.
This is convenient for previewing the output of a node, and we agreed
to support this behavior in both Eevee and Cycles.
2018-06-13 18:39:30 +02:00
Lukas Stockner
7bf4023689 Fix T55448: Typo in Cycles CUDA debug output
Reviewers: sergey, lukasstockner97

Reviewed By: lukasstockner97

Tags: #cycles, #bf_blender

Differential Revision: https://developer.blender.org/D3472
2018-06-12 10:45:32 +02:00
Sergey Sharybin
b763c34e80 Cycles: Cleanup, silence strict compiler warning
There is one legit place in the code where memcpy was used as an
optimization trick. Was needed for older version of GCC, but now
it should be re-evaluated and checked if it still helps to have
that trick.

In other places it's somewhat lazy programming to zero out all
object members. That is absolutely unsafe, at the moment when
less trivial class is used as a member in that object things
will break.

Other cases were using memcpy into an object which comes from
an external library. We don't control that object, and we can
not guarantee it will always be safe for such memory tricks
and debugging bugs caused by such low level access is far fun.

Ideally we need to use more proper C++, but needs to be done with
big care, including benchmarks of each change, For now do
annoying but simple cast to void*.
2018-06-11 13:02:10 +02:00
Sergey Sharybin
a6e582164f Libmv: Cleanup, make strict compiler more happy
In C++ it is not really safe to memcpy objects, and newer GCC will warn
about this. However, we don't use our vector for unsafe-to-memcpy objects,
so just explicitly silence that warning.
2018-06-11 13:02:10 +02:00
Bastien Montagne
d0956e9cb3 Cleanup: Moar G.main removal of Hell.
This commit actually adds some G.main... but at much, much higher level
than the ones it removes, so should still be better ;)
2018-06-11 12:15:14 +02:00
Campbell Barton
9bcced83ee GHOST/X11: Print the keycode w/ debug enabled 2018-06-09 12:53:39 +02:00
Campbell Barton
6f4c7f1f01 GHOST/X11: Correct non-latin kb workaround case
Harmless since this is always enabled,
only do this for easier troubleshooting when disabling the define.
2018-06-09 12:04:07 +02:00
Campbell Barton
f3427cbc98 GHOST/X11: support accessing physical keycodes
This means we can check keys such as tilde in a generic way.
2018-06-09 11:23:41 +02:00
Campbell Barton
540e85d567 GHOST/X11: Map unknown es,dk keys to accentgrave 2018-06-08 15:21:20 +02:00
Campbell Barton
4127aeb7a5 GHOST/X11: Map unknown de,fr keys to accentgrave
This still uses the correct string when typing text,
it just allows the key to be used in keymaps.

We should eventually add scan-code support.
2018-06-08 14:53:03 +02:00
Campbell Barton
cfc1ddeff7 GHOST/X11: Xinput/XIM support caused double key-up
All keyboard events were sending double key events (including modifiers)
when xinput was enabled with gnome (causing much confusion!).

I cant test if XIM works,
but this isn't useful to send double events, so disabling for now.
2018-06-07 20:35:06 +02:00
Sergey Sharybin
16017178b2 Revert "Cycles: Cleanup: Don't use return on function returning void"
Not sure why exactly it is called a cleanup, the code was much more clear
and robust against possible missing return statements which are MANDATORY.

Missing return statement will:

- Cause two different BVH traversals to be run.

  Not is happening currently, but if more BVH layouts are added, it will
  become a problem.

- It is already causing assert() statements to fail, since functions are
  no longer returning when they are supposed to.

If there is any measurable reason to keep this change, let me know.
Otherwise just stick to reliable/tested/robust code.

This reverts commit ba65f7093b39a8e5f1fb869cbc347fb810a05ab9.
2018-06-07 11:57:57 +02:00
Campbell Barton
58e8c71cbd Cleanup: strip ghost trailing space 2018-06-04 18:47:57 +02:00
Lukas Stockner
ba65f7093b Cycles: Cleanup: Don't use return on function returning void 2018-06-04 00:07:17 +02:00
Bastien Montagne
051e186d5c Cleanup: some more G.main removal from editor code. 2018-06-01 17:08:38 +02:00
Bastien Montagne
b53d358261 Cleanup: remove G.main from BKE modifier. 2018-05-31 15:24:30 +02:00
Hristo Gueorguiev
6c0705009e Fix OpenCL compilation error - BPT without SSS. 2018-05-31 00:08:56 +02:00
Ray Molenkamp
81060ff6b2 Windows: Add support for building with clang.
This commit contains the minimum to make clang build/work with blender, asan and ninja build support is forthcoming

Things to note:

1) Builds and runs, and is able to pass all tests (except for the freestyle_stroke_material.blend test which was broken at that time for all platforms by the looks of it)

2) It's slightly faster than msvc when using cycles. (time in seconds, on an i7-3370)

victor_cpu
	msvc:3099.51
	clang:2796.43

pavillon_barcelona_cpu
	msvc:1872.05
	clang:1827.72

koro_cpu
	msvc:1097.58
	clang:1006.51

fishy_cat_cpu
	msvc:815.37
	clang:722.2

classroom_cpu
	msvc:1705.39
	clang:1575.43

bmw27_cpu
	msvc:552.38
	clang:561.53

barbershop_interior_cpu
	msvc:2134.93
	clang:1922.33

3) clang on windows uses a drop in replacement for the Microsoft cl.exe (takes some of the Microsoft parameters, but not all, and takes some of the clang parameters but not all) and uses ms headers + libraries + linker, so you still need visual studio installed and will use our existing vc14 svn libs.

4) X64 only currently, X86 builds but crashes on startup.

5) Tested with llvm/clang 6.0.0

6) Requires visual studio integration, available at https://github.com/LazyDodo/llvm-vs2017-integration

7) The Microsoft compiler spawns a few copies of cl in parallel to get faster build times, clang doesn't, so the build time is 3-4x slower than with msvc.

8) No openmp support yet. Have not looked at this much, the binary distribution of clang doesn't seem to include it on windows.

9) No ASAN support yet, some of the sanitizers can be made to work, but it was decided to leave support out of this commit.

Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D3304
2018-05-28 14:34:47 -06:00
dc0eed178a Fix Cycles + OSL build error, pass main to node editing functions. 2018-05-28 00:04:14 +02:00
Lukas Stockner
edce44d693 Cycles: Fix problems in the IES loader when rendering with no file selected 2018-05-27 17:16:15 +02:00
Lukas Stockner
48155c210a Cycles: Add Support for IES files as textures for light strength
This patch adds support for IES files, a file format that is commonly used to store the directional intensity distribution of light sources.
The new IES node is supposed to be plugged into the Strength input of the Emission node of the lamp.

Since people generating IES files do not really seem to care about the standard, the parser is flexible enough to accept all test files I have tried.
Some common weirdnesses are distributing values over multiple lines that should go into one line, using commas instead of spaces as delimiters and adding various useless stuff at the end of the file.

The user interface of the node is similar to the script node, the user can either select an internal Text or load a file.
Internally, IES files are handled similar to Image textures: They are stored in slots by the LightManager and each unique IES is assigned to one slot.

The local coordinate system of the lamp is used, so that the direction of the light can be changed. For UI reasons, it's usually best to add an area light,
rotate it and then change its type, since especially the point light does not immediately show its local coordinate system in the viewport.

Reviewers: #cycles, dingto, sergey, brecht

Reviewed By: #cycles, dingto, brecht

Subscribers: OgDEV, crazyrobinhood, secundar, cardboard, pisuke, intrah, swerner, micah_denn, harvester, gottfried, disnel, campbellbarton, duarteframos, Lapineige, brecht, juicyfruit, dingto, marek, rickyblender, bliblubli, lockal, sergey

Differential Revision: https://developer.blender.org/D1543
2018-05-27 01:24:57 +02:00
Lukas Stockner
5e2f9c5c67 Cycles: Cleanup: Remove duplicated atan2f definition for OpenCL
Turns out that atan2f was already defined for OpenCL.
2018-05-24 19:08:06 +02:00
Lukas Stockner
b4a8b81399 Cycles Denoising: Don't use atomics in the accumulation kernel on CPUs
The GPU kernel needs to use atomics for accumulation since all offsets are processed in
parallel, but on CPUs that's not the case, so we can disable them there for a considerable speedup.
2018-05-24 18:44:56 +02:00
Lukas Stockner
6862762685 Cycles/Compositor: Add arctan2 operation to the Math node
The Math node currently has the normal atan() function, but for
actual angles this is fairly useless without additional nodes to handle the signs.

Since the node has two inputs anyways, it only makes sense to add an arctan2 option.

Reviewers: sergey, brecht

Differential Revision: https://developer.blender.org/D3430
2018-05-24 16:46:02 +02:00
Campbell Barton
103a31f712 Fix incorrect size in aligned lockfree realloc
Thanks to @alikendarfen for finding.
2018-05-23 07:24:57 +02:00
Campbell Barton
28c20fc393 Memory allocator: use lockfree calls internally
Was already used in some areas.
2018-05-22 08:45:47 +02:00
6d8aa85051 Fix too much memory usage for Cycles attribute map.
Thanks to Thomas Krebs for identifying the problem and solution.
2018-05-21 11:14:59 +02:00
Campbell Barton
278e3f7d5f Logging: add --show-log-backtrace
Useful in debug builds to see a functions callers.
2018-05-18 11:00:47 +02:00
Bastien Montagne
4e4a93bc45 Fix building with latest versions of ffmpeg.
Some years-old deprecated stuff has now been removed.

Correct solution is probably to use valid defines etc. in own code, but
this is more FFMEPG maintainer task (since it also may change how old
FFMPEG we do support...).
2018-05-08 16:00:52 +02:00
Sergey Sharybin
1a3fb3e8b1 Fix wrong comparison of drop target URI on X11
Need to compare, NOT to override passed file name.
2018-05-07 14:11:33 +02:00
2dd0cb4964 Fix T54801: incorrect render with zero weight transparent BSDFs. 2018-05-06 02:00:39 +02:00
Campbell Barton
c7cfee04c4 Logging: setting log level wasn't working 2018-05-04 08:00:22 +02:00
Lukas Stockner
16c05161e7 Cycles: Cleanup: Remove double semicolons 2018-04-29 09:28:41 +02:00
Campbell Barton
b4e8d33f11 Logging: edits to build on macOS 2018-04-16 07:38:11 +02:00
Antonio Vazquez
87a9b6ac06 Fix compiler error in Windows 2018-04-15 09:55:42 +02:00
Campbell Barton
66d4e9300b Logging: replace 'fwrite' w/ 'write'
We're already buffing output, so use write directly.
2018-04-14 13:59:33 +02:00
Alexander Gavrilov
26a283deae Use the newer version of the bullet 6dof spring constraint for rigidbody.
The new constraint is slower and not backward compatible, but should
be better, especially in the damping side. The new constraint also
has a different valid range of the damping coefficient, and a limit
implementation that bounces instead of making the object stationary.

Reviewers: sergof

Differential Revision: https://developer.blender.org/D3125
2018-04-09 19:14:35 +03:00
Mai Lavelle
49f77b0d83 Proper fix for T54337
Accidentally checked the wrong variable in fa01a1738bd1e3a6750ff.
2018-04-04 06:36:16 -04:00
Mai Lavelle
fa01a1738b Fix T54337: Cycles crash with simple subd object in debug build 2018-04-03 23:37:12 -04:00
Mai Lavelle
8c4d28cdb9 Fix T54400: Some GCN 1 cards available to select for use with Cycles
Hainan was missing from the list of GCN 1 cards.
2018-04-03 23:15:07 -04:00
71d7d6cd8c Build: add WITH_OPENVDB_3_ABI_COMPATIBLE option.
Better fix for T54457. It seems Debian compiles OpenVDB without ABI 3
compatibility, while Arch does enable it as is the default in the OpeVDB
CMake build system.

So now there's an option that the distribution can set depending on how
they compile their OpenVDB package.
2018-04-02 19:13:04 +02:00
Milan Jaros
888a04c7e4 Build: fixes for the Intel compiler versions 2016, 2017, 2018.
Differential Revision: https://developer.blender.org/D3109
2018-04-02 16:39:04 +02:00
Campbell Barton
951d89b7b4 Cleanup: warning 2018-03-31 23:51:38 +02:00
Campbell Barton
ae3a1da1e6 Logging: fix own error with formatting 2018-03-31 15:43:47 +02:00
Campbell Barton
b237a1c2ea Use int instead of bool
Causes issues when including in some files.
2018-03-31 15:33:15 +02:00
Campbell Barton
db8e7f9780 Logging: add argument --log-show-basename
Optionally strips leading path from filenames when logging.
2018-03-31 15:29:46 +02:00
Campbell Barton
ac4513a5b8 Logging: add ability to exclude categories. 2018-03-31 12:52:47 +02:00
Campbell Barton
5f59c22bf1 Docs: doxygen docs for clog 2018-03-31 12:27:18 +02:00
Campbell Barton
b8a66973ac Fix clog: own error allocating from static buffer 2018-03-31 11:25:49 +02:00
Campbell Barton
af11eea3fd Fix logger build w/ MSVC 2018-03-31 09:18:30 +02:00
Campbell Barton
891c1cfc9a C Logging: use instead of printf for messages
- See `--log` help message for usage.
- Supports enabling categories.
- Color severity.
- Optionally logs to a file.
- Currently use to replace printf calls in wm module.

See D3120 for details.
2018-03-30 18:57:41 +02:00
ca5f3dd220 Fix T54457: build error with OpenVDB versions newer than 3.
Solution provided by Sven-Hendrik Haase.
2018-03-29 07:21:35 +02:00
52302757cd Fix T54455: OpenCL build error after recent changes. 2018-03-29 07:14:09 +02:00
Matt Heimlich
e3f1d98098 Cycles: take into account diffuse roughness for roughness baking.
Roughness baking previously defaulted to 1.0 for all diffuse materials,
now we also bake roughness values of Oren-Nayer and Principled Diffuse.

Differential Revision: https://developer.blender.org/D3115
2018-03-28 23:45:15 +02:00
Jeff Witthuhn
bc3a55c343 Cycles: don't require pthreads as dependency on Windows.
Use C++11 threads when available, and native critical section on Windows.
Later on we can remove pthread code when C+11 becomes required.

Differential Revision: https://developer.blender.org/D3116
2018-03-28 12:13:04 +02:00
4bd5b824b0 Fix missing confirm quit dialog on macOS, after recent changes. 2018-03-28 10:54:17 +02:00
Sergey Sharybin
be587d76ef Cycles: Fix bad register cast in sseb
This is currently unused code, but causes gcc-8 to fail.
2018-03-28 10:34:31 +02:00
a7aee250b8 Fix T54420: too much volume render noise with multiple volume objects.
Random numbers for step offset were correlated, now use stratified samples
which reduces noise as well for some types of volumes, mainly procedural
ones where the step size is bigger than the volume features.
2018-03-27 01:08:30 +02:00
Sergey Sharybin
3c45fdd171 GHOST: Solve compilation error of test programs 2018-03-26 14:51:56 +02:00
Sergey Sharybin
4f8e407086 Libmv: Fix compilation error on Windows 2018-03-23 15:05:08 +01:00
Sergey Sharybin
ab48e6355d Glog/gflags: Reduce amount of local modifications
With better directory layout and more proper include
statements we can avoid several local modifications,
such as changing config.h for Windows Glog and the
ones related on pass-through statements in logging
headers in Glog.

This commit also makes unused functions not-a-warning
for external code.
2018-03-23 14:38:02 +01:00
Aaron Carlisle
150ad2238c PyDocs: Fix link syntax 2018-03-22 16:38:53 -04:00
Campbell Barton
5ba5254ec1 UI: Optional prompt to quit for non win32 systems
D566 by @januz

Use Blender native dialog when OS dialog's aren't supported.
2018-03-21 16:04:01 +01:00
d03223850e Fix build error on Windows 32 bit. 2018-03-20 17:11:14 +01:00
Sergey Sharybin
a5bb918392 Memory allocator: Clarify consistency check function
Also make it to return truth when everything is good and
false otherwise.
2018-03-20 16:51:33 +01:00
148b0fef09 Fix T54317: overlapping volume render bug after recent changes.
Increasing the samplig dimensions like this is not optimal, I'm looking
into some deeper changes to reuse the random number and change the RR
probabilities, but this should fix the bug for now.
2018-03-19 21:22:15 +01:00
fddb4dee8a Fix T54356: volume rendering bug using just color attribute. 2018-03-19 21:22:15 +01:00
Guillaume Chereau
e56fd59f22 Code refactor: move OIIO image buffer writing outside session, into callback.
Original patch by Guillaume, modifications by Brecht.

Differential Revision: https://developer.blender.org/D3102
2018-03-15 23:05:16 +01:00
Lukas Stockner
41149ca134 GHOST: Support Unity taskbar progress API
Unity itself is deprecated, but the API is also supported by KDE and the GNOME Dock extension,
which means that it will be useful for a wide variety of distributions.

To get a progress bar, the system must have a blender.desktop file and libunity installed.

The need for libunity is annoying, but the only alternative would be to integrate a DBus library...

Reviewers: campbellbarton, brecht

Differential Revision: https://developer.blender.org/D3106
2018-03-15 22:49:56 +01:00
17793a66c6 Fix T54299: crash rendering objects with motion blur disabled, after recent changes. 2018-03-12 17:37:29 +01:00
e07dd9fd59 Cycles: add constant folding to displacement nodes. 2018-03-12 17:29:44 +01:00
23ccf5767f Cycles: add roughness baking support, using squared roughness convention. 2018-03-10 18:37:33 +01:00
7613ffc944 Cycles: switch to squared roughness convention for all nodes.
This was already done for the Principled BSDF to be compatible with typical
baked roughness maps in PBR workflows.
2018-03-10 18:05:01 +01:00
8a76f8dac3 Code cleanup: fix compiler warning. 2018-03-10 06:51:52 +01:00
1f5c5fa189 Fix T54279: viewport update bug with volume meshes.
Meshes without vertex normals were not handled correctly.
2018-03-10 06:27:19 +01:00
3f2b88d195 Code refactor: reduce number of loops over meshes. 2018-03-10 06:27:19 +01:00
07d0a87b5c Fix T54278: volume artifacts with small density and color after recent changes. 2018-03-10 06:27:19 +01:00
d526b35ce2 Code cleanup: use spaces for aligned indentation. 2018-03-10 06:27:19 +01:00
db333d9ea4 Cycles: support arbitrary number of motion blur steps for objects. 2018-03-10 06:27:19 +01:00
78c2063685 Cycles: support arbitrary number of motion blur steps for cameras. 2018-03-10 06:27:19 +01:00
267d892326 Code refactor: motion blur cleanups, preparing for next commit. 2018-03-10 04:54:05 +01:00
6c4ddfc5d9 Code refactor: don't expose UpdateObjectTransformState in header. 2018-03-10 04:54:05 +01:00
b66efbecf4 Code refactor: make Transform always affine, dropping last row.
This save a little memory and copying in the kernel by storing only a 4x3
matrix instead of a 4x4 matrix. We already did this in a few places, and
those don't need to be special exceptions anymore now.
2018-03-10 04:54:05 +01:00
623141f339 Code refactor: add DecomposedTransform.
This is in preparation of making Transform affine only, and also gives us
a little extra type safety so we don't accidentally treat it as a regular
4x4 matrix.
2018-03-10 04:54:05 +01:00
516e82a900 Code refactor: add ProjectionTransform separate from regular Transform.
This is in preparation of making Transform affine only.
2018-03-10 04:54:04 +01:00
cd15d87bfc Code refactor: avoid motion transform copy, remove unused curved code.
The purpose of the previous code refactoring is to make the code more readable,
but combined with this change benchmarks also render about 2-3% faster with an
NVIDIA Titan Xp.
2018-03-10 04:54:04 +01:00
Stefan Werner
f3010e98c3 Code refactor: use KernelShader and KernelParticle instead of float arrays.
Original patch by Stefan with modifications by Brecht.
2018-03-10 04:54:04 +01:00
Stefan Werner
fa9175ff02 Code refactor: use KernelLight instead of float4 arrays.
Original patch by Stefan with modifications by Brecht.
2018-03-10 04:54:04 +01:00
Stefan Werner
f66ff4ee86 Code refactor: use KernelOject struct instead of float4 array.
Original patch by Stefan with modifications by Brecht.
2018-03-10 04:54:04 +01:00
Sergey Sharybin
370a2d6917 Fix T53857: Incorrect framerate for videos imported from OBS
This is an issue with which value to trust: fps vs. tbr. They both cam be
somewhat broken. Currently the idea is:

- If file was saved with FFmpeg AND we are decoding with FFmpeg we trust tbr.
- If we are decoding with Libav we use fps (there does not seem to be tbr in
  Libav, unless i'm missing something).
- All other cases we use fps.

Seems to work all good for files from T53857, T54148 and T51153. Ideally we
would need to collect some amount of regression files to make further tweaks
more scientific.

Reviewers: mont29

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D3083
2018-03-09 10:32:17 +01:00
Sergey Sharybin
76122bc8f0 Cycles: Fix crash when building with no shading systems 2018-03-06 13:04:28 +01:00
Sergey Sharybin
ec904ed327 Cycles: Cleanup, indentation 2018-03-06 13:04:28 +01:00
94b99949eb Fix T54202: Cycles crash rendering empty mesh volume after recent optimization. 2018-03-02 23:10:27 +01:00
b6fe80ca19 Fix Cycle standalone build. 2018-03-02 19:56:22 +01:00
Mai Lavelle
f2a2d5492b Cycles: Fix building of OpenCL kernels after volume optimization commit
OpenCL is C based, so no support for operators.

Related commit: 7377d411b47d50cd943cd
2018-03-02 04:53:13 -05:00
Kévin Dietrich
7377d411b4 Cycles volume: fast empty space optimization by generating a tight mesh
around the volume.

We generate a tight mesh around the active voxels of the volume in order
to effectively skip empty space, and start volume ray marching as close
to interesting volume data as possible. See code comments for details on
how the mesh generation algorithm works.

This gives up to 2x speedups in some scenes.

Reviewed by: brecht, dingto

Reviewers: #cycles

Subscribers: lvxejay, jtheninja, brecht

Differential Revision: https://developer.blender.org/D3038
2018-03-01 11:54:01 +01:00
7f86afec9d Cycles: don't count volume boundaries as transparent bounces.
This is more important now that we will have tigther volume bounds that
we hit multiple times. It also avoids some noise due to RR previously
affecting these surfaces, which shouldn't have been the case and should
eventually be fixed for transparent BSDFs as well.

For non-volume scenes I found no performance impact on NVIDIA or AMD.
For volume scenes the noise decrease and fixed artifacts are worth the
little extra render time, when there is any.
2018-03-01 01:21:29 +01:00
8cc7f48581 Cycles: principled absorption color now has more effect at lower values. 2018-02-28 20:11:53 +01:00
2eb94be750 Code cleanup: refactor Cycles image metadata retrieval to use a struct. 2018-02-27 23:42:30 +01:00
Kévin Dietrich
4403ca80bd Smoke: expose empty space clipping property to the UI.
This is used to determine which voxels are to be considered empty space.

Previously it was hardcoded for converting dense grids to OpenVDB grids
to reduce disk space usage.

This value is also useful for rendering engines to know, i.e. to
optimize ray marching.
2018-02-24 13:37:58 +01:00
Kévin Dietrich
6d8a4c10b6 OpenVDB : use underscores instead of spaces in grid names.
Some other software cannot handle grid names with spaces in them. We still check for names with spaces so as to not break old
files.

This fixes T53802.
2018-02-24 13:37:08 +01:00
0aec2dcd3a Cycles: add Principled Volume shader.
Similar to the Principled BSDF, this should make it easier to set up volume
materials. Smoke and fire can be rendererd with just a single principled
volume node, the appropriate attributes will be used when available. The node
also works for simpler homogeneous volumes like water or mist.

Differential Revision: https://developer.blender.org/D3033
2018-02-23 18:57:58 +01:00
acd619d7c9 Cycles: change smoke color grid to not include density multiplied in.
This breaks backwards compatibility some, making smoke colors brighters
than before. But it is also more correct this way.
2018-02-23 18:57:58 +01:00
a963c7d48d Code refactor: improve attribute handling for optional volume attributes.
A volume shader should be able to request attributes, and still be rendered
as homogeneous if no volume attributes are available for the object.
2018-02-23 18:57:58 +01:00
04896d223d Smoke: add temperature grid, with values 0..1 corresponding to 0..1000K. 2018-02-23 18:57:58 +01:00
5d5c6bb5ef Cycles: add Russian roulette termination for volume multiple scattering.
This mainly helps with dense volumes, rendering can be 30% faster with
little noise increase in such scenes.
2018-02-22 00:55:32 +01:00
2d81758aa6 Cycles: better path termination for transparency.
We now continue transparent paths after diffuse/glossy/transmission/volume
bounces are exceeded. This avoids unexpected boundaries in volumes with
transparent boundaries. It is also required for MIS to work correctly with
transparent surfaces, as we also continue through these in shadow rays.

The main visible changes is that volumes will now be lit by the background
even at volume bounces 0, same as surfaces.

Fixes T53914 and T54103.
2018-02-22 00:55:32 +01:00
6a48a9dc6e Code cleanup: fix incorrect socket names in hair and particle info nodes. 2018-02-22 00:55:11 +01:00
9a5be1fba9 Fix incorrect OSL raytype bits and add some comments. 2018-02-21 17:56:26 +01:00
606bc5f301 Fix T54105: random walk SSS missing in branched indirect paths.
Unify the path and branched path indirect SSS code. No performance impact
found on CUDA, for AMD split kernel the extra code was already there.
2018-02-21 17:56:26 +01:00
5cc1d5fe17 Fix T54107: bevel shader + normal map gives wrong result. 2018-02-21 17:56:26 +01:00
fee4b646c4 Cycles: tweak CUDA messages and avoid build errors with existing sm_2x configs. 2018-02-18 00:53:25 +01:00
1dcd7db73d Code cleanup: remove some more unused code after recent CUDA changes. 2018-02-18 00:53:03 +01:00
Thomas Dinges
9e717c0495 Cycles: Remove Fermi texture code.
This should be the last Fermi removal commit, unless I missed something.
It's been a pleasure Fermi!
2018-02-17 22:56:58 +01:00
Thomas Dinges
e1ef902058 Cycles: Remove fermi related defines from the code.
Did not touch Texture related defines, that comes next.
2018-02-17 22:19:54 +01:00
Thomas Dinges
2eaf90b305 Cycles: Remove Fermi support from CMake and update runtime checks in device_cuda.cpp.
Fermi code in Cycles kernel and texture system are coming next.
2018-02-17 16:15:07 +01:00
e03f335b1d Code cleanup: simplify switch statement, ensure we catch missing enums. 2018-02-15 18:13:07 +01:00
b1ee10aa1b Fix T54073: crash and uninitialized memory in Cycles displacement hashing. 2018-02-15 18:00:55 +01:00
b5fe00d1ac Cycles: restore Particle Info Index for now, keep it next to Random.
It seems to be useful still in cases where the particle are distributed in
a particular order or pattern, to colorize them along with that. This isn't
really well defined, but might as well avoid breaking backwards compatibility
for now.
2018-02-14 21:45:57 +01:00
f6107af4cf Cycles: change Index output of Hair and Particle Info to Random, in 0..1 range.
These are used for randomization, so it's convenient if the index is already
hashed and consistent with the Object Info node.
2018-02-14 14:55:46 +01:00
Sergey Sharybin
a966852362 CMake: Expose Cycles devices support as CMake option
Handy to disable GPU based devices when it's needed to run Valgrind.
2018-02-14 10:32:32 +01:00
Sergey Sharybin
37f65e9dc4 Cycles: Implement index output for hair node
This is like the only way to add variety to hair which is created
using simple children. Used here for the hair.

Maybe not ideal, but the time will show.
2018-02-13 14:20:47 +01:00
fc99eed5be Fix random walk SSS issues with different base and subsurface color.
Burley SSS uses a bit of strange thing where the albedo and closure weight are
different, which makes the subsurface color act a bit like a subsurface radius
indirectly by the way the Burley SSS profile works.

This can't work for random walk SSS though, and it's not clear to me that this
is actually a good idea since it's really the subsurface radius that is supposed
to control this. For now I'll leave Burley SSS working the same to not break
backwards compatibility.
2018-02-12 21:08:59 +01:00
a6968e87f1 Cycles: add random walk subsurface scattering to Principled BSDF.
Differential Revision: https://developer.blender.org/D3054
2018-02-09 19:58:42 +01:00
0df9b2c715 Cycles: random walk subsurface scattering.
It is basically brute force volume scattering within the mesh, but part
of the SSS code for faster performance. The main difference with actual
volume scattering is that we assume the boundaries are diffuse and that
all lighting is coming through this boundary from outside the volume.

This gives much more accurate results for thin features and low density.
Some challenges remain however:

* Significantly more noisy than BSSRDF. Adding Dwivedi sampling may help
  here, but it's unclear still how much it helps in real world cases.
* Due to this being a volumetric method, geometry like eyes or mouth can
  darken the skin on the outside. We may be able to reduce this effect,
  or users can compensate for it by reducing the scattering radius in
  such areas.
* Sharp corners are quite bright. This matches actual volume rendering
  and results in some other renderers, but maybe not so much real world
  objects.

Differential Revision: https://developer.blender.org/D3054
2018-02-09 19:58:33 +01:00
Campbell Barton
8f9386596f CMake: include missing headers 2018-02-09 13:50:05 +11:00
Tamito Kajiyama
859379ac48 Fix for missing "Use Freestyle" toggle in the Cycles "Layer" options panel.
Reviewed By: Brecht Van Lommel (brecht), Dalai Felinto (dfelinto)

Differential Revision: https://developer.blender.org/D3048
2018-02-09 02:48:21 +09:00
29d2ff7b31 Cycles: unify OSL BSSRDF closure into a single bssrdf() closure with method.
This is similar to the upstream unified microfacet() closure, and makes it
easier to extend in the future.
2018-02-08 16:56:11 +01:00
aabafece03 Code refactor: tweaks in SSS code to prepare for coming changes.
This also fixes a subtle bug in the split kernel branched path SSS, the
volume stack update can't be shared between multiple hit points.
2018-02-08 16:56:11 +01:00
28e2bc90dd Code refactor: remove unnecessary RNG offset in branched path code.
This is only needed for SSS which bounces to a different shading point.
2018-02-08 16:56:11 +01:00
1dafe759ed Update CUEW to latest version
This brings separate initialization for libcuda and libnvrtc, which
fixes Cycles nvrtc compilation not working on build machines without
CUDA hardware available.

Differential Revision: https://developer.blender.org/D3045
2018-02-07 11:53:01 +01:00
Campbell Barton
1e4b612d6a Cleanup: add _types.h suffix to DNA headers 2018-02-07 11:14:08 +11:00
ce3e0afe59 Fix T54001: AMD OpenCL fails with certain resolutions, after recent changes.
We should actually be using CL_DEVICE_MEM_BASE_ADDR_ALIGN for sub buffers,
previous change in this code was incorrect. Renamed the function now to
make the specific purpose of this alignment clear, it's not required for
data types in general.
2018-02-05 22:19:49 +01:00
Nathan Letwory
f9fcda533b
Fix typo in struct name obejct to object.
Reviewers: sergey

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D3041
2018-02-05 11:31:33 +02:00
Ray Molenkamp
e84e8cb497 cycles: fix black render with cycles_cubin_cc.
I have honestly no idea how this got swapped..
2018-02-04 15:12:35 -07:00
Ray Molenkamp
f8236e4869 cycles: fix cxx11 usage for cycles_cubin_cc 2018-02-04 15:11:08 -07:00
Ray Molenkamp
36c1122b96 msvc: Use source folder structure for project file.
This patch changes the huge list of projects in visual studio into a nice tree matching the source folder structure. see D2823 for details.

Differential Revision: http://developer.blender.org/D2823
2018-02-03 16:38:27 -07:00
Ray Molenkamp
a5052770b8 cycles: Add an nvrtc based cubin cli compiler.
nvcc is very picky regarding compiler versions, severely limiting the compiler we can use, this commit adds a nvrtc based compiler that'll allow us to build the cubins even if the host compiler is unsupported. for details see D2913.

Differential Revision: http://developer.blender.org/D2913
2018-02-03 10:59:09 -07:00
db989e1f11 Fix more Cycles incorrect principled BSDF mixing due to missing initialization.
Spotted by Ha Hyung-jin, thanks!
2018-02-03 13:43:44 +01:00
7ea7ce970c Fix build error with CUDA 9.1 and compute capability 2.x. 2018-02-03 13:36:38 +01:00
bb6f1d159a Cycles: make displacement a supported feature.
Adaptive subdivision remains experimental, still needs more work.
2018-02-03 12:20:58 +01:00
f9ea097a87 Cycles: add Vector Displacement node and extend Displacement node.
This adds midlevel and object/world space for displacement, and a
vector displacement node with tangent/object/world space, midlevel
and scale.

Note that tangent space vector displacement still is not exactly
compatible with maps created by other software, this will require
changes to the tangent computation.

Differential Revision: https://developer.blender.org/D1734
2018-02-03 12:20:26 +01:00