Commit Graph

7331 Commits

Author SHA1 Message Date
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
Brecht Van Lommel 2e25a48b05 Fix more Cycles CUDA errors after recent changes. 2018-06-15 16:28:09 +02:00
Brecht Van Lommel 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
Brecht Van Lommel 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 ba65f7093b.
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
Brecht Van Lommel 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
Brecht Van Lommel 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
Brecht Van Lommel 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 fa01a1738b.
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
Brecht Van Lommel 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