Commit Graph

4397 Commits

Author SHA1 Message Date
a7f5418caa Cleanup: consistent includes. 2018-08-29 16:32:07 +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
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
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
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
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
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
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