Commit Graph

8918 Commits

Author SHA1 Message Date
OmarSquircleArt
c6f8ea7b45 Fix T69044: OpenCL fail due to bad fract function.
The fract function in OpenCL does more than just return the fraction.
It also writes the floor to the second argument. Which wasn't put
in consideration.

Instead, we use a simple `a - floor(a)` like the Math node.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D5553
2019-08-22 13:51:39 +02:00
OmarSquircleArt
e83f092201 Shading: Add Volume Info node.
The Volume Info node provides the Color, Desnity, Flame, and Temperature
of smoke domains.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D5551
2019-08-21 20:22:24 +02:00
OmarSquircleArt
133dfdd704 Shading: Add White Noise node.
The White Noise node hashes the input and returns a random number in the
range [0, 1]. The input can be a 1D, 2D, 3D, or a 4D vector.

Reviewers: brecht, JacquesLucke

Differential Revision: https://developer.blender.org/D5550
2019-08-21 20:04:09 +02:00
OmarSquircleArt
7f4a2fc437 Shading: Add more operators to Vector Math node.
Add Multiply, Divide, Project, Reflect, Distance, Length, Scale, Snap,
Floor, Ceil, Modulo, Fraction, Absolute, Minimum, and Maximum operators
to the Vector Math node. The Value output has been removed from operators
whose output is a vector, and the other way around. All of those removals
has been handled properly in versioning code.

The patch doesn't include tests for the new operators. Tests will be added
in a later patch.

Reviewers: brecht, JacquesLucke

Differential Revision: https://developer.blender.org/D5523
2019-08-21 19:36:33 +02:00
Lazydodo
6086a6d939 Cleanup: Fix build error with MSVC
Previously eigens internal include order somehow implicitly provided
M_PI and friends. The recent eigen version bump broke this implicit
behaviour, better to be explicit that we need the math defines for MSVC.
2019-08-21 10:38:33 -06:00
1876e18b1b Fix use of uninitialized variable in Cycles math node 2019-08-20 18:19:22 +02:00
OmarSquircleArt
be002bb57f Cycles Tests: Fix Math tests when use_clamp is true.
The clamp option is implemented using graph expansion, where a Clamp node
named "clamp" is added and connected to the output. So the final result
is actually from the node "clamp".

Reviewers: brecht

Differential Revision: https://developer.blender.org/D5540
2019-08-20 17:21:40 +02:00
Campbell Barton
8919c1cad5 Cleanup: clang-format, sorted lists 2019-08-20 22:47:25 +10:00
Jacques Lucke
f2cab8267f Memory: Fix guarded aligned malloc with small alignment
When calling `MEM_guarded_mallocN_aligned` with an alignment of 4,
a pointer that was returned that is 4 byte but not 8 byte aligned.
When freeing this pointer, `MEM_guarded_freeN` thinks that it is an
illegal pointer, because it asserts that `((intptr_t)memh) & 0x7 == 0`.

The fix is to always use at least 8 byte alignment.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D5529
2019-08-20 09:45:47 +02:00
OmarSquircleArt
e5618725fd Shading: Refactor Math node and use dynamic inputs.
- Implement dynamic inputs. The second input is now unavailable in single
operand math operators.
- Reimplemenet the clamp option using graph expansion for Cycles.
- Clean up code and unify naming between Blender and Cycles.
- Remove unused code.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D5481
2019-08-18 11:16:04 +02:00
Campbell Barton
b1959a96a2 Cleanup: spelling 2019-08-18 04:26:34 +10:00
Campbell Barton
2790740813 Cleanup: spelling 2019-08-17 00:57:05 +10:00
Lazydodo
ea8e0df672 Fix T55054: possible use of unsupported instructions in Cycles texture code
Differential Revision: https://developer.blender.org/D5326
2019-08-16 16:49:04 +02:00
Pablo Dobarro
9ac3964be1 OpenVDB: mesh/level set conversion, filters and CSG operations
This code is needed to implement the Voxel Remesher as well as other features like a better remesh modifier with filters and CSG operations.

Done by Martin Felke and Pablo Dobarro

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5364
2019-08-14 18:13:56 +02:00
Campbell Barton
4b9e05b428 Cleanup: clang-format, sort structs & cmake files 2019-08-15 01:34:58 +10:00
7ae3aa7b63 Cleanup: don't unnecessarily use ustring in IES file parsing 2019-08-14 14:16:11 +02:00
Philipp Oeser
b4051db4fc Fix cycles crash when voxel attributes changed
This could happen e.g. when changing smoke type from flow to domain or
connecting a volume shader with to a domain without an actual flow type
around.

Fixes T58569, T68359

Reviewers: brecht

Maniphest Tasks: T58569, T68359

Differential Revision: https://developer.blender.org/D5478
2019-08-14 10:54:28 +02:00
OmarSquircleArt
7a7eadaf7f Shading: Add a clamp option to the Map Range node.
If the option is enabled, the output is clamped to the target range.
The target range is [To Min, To Max]. The option is enabled by default.

The clamp option is implemented in EEVEE by linking to the `clamp_value`
GLSL function. And it is implemented in Cycles using a graph expand
function.

Reviewers: brecht, JacquesLucke

Differential Revision: https://developer.blender.org/D5477
2019-08-14 10:53:19 +02:00
OmarSquircleArt
313b789289 Shading: Add Clamp node to Cycles and EEVEE.
This patch adds a new node that clamps a value between a maximum and
a minimum values.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D5476
2019-08-13 22:22:15 +02:00
OmarSquircleArt
71641ab56d Shading: Add Map Range node to Cycles and EEVEE.
This patch adds a new Map Range node that linearly remaps an input
value from a range to another. This node is similar to the compositor's
Map Range node.

Reviewers: brecht, JacquesLucke

Differential Revision: https://developer.blender.org/D5471
2019-08-13 16:38:56 +02:00
b84db342a5 Fix build errors with older GCC versions like 4.9
We can add more fine grained checks for when these flags are supported so
that adding asan flags manually still has all the workarounds, but for now
compiling succesfully is more important.
2019-08-13 06:04:17 +02:00
Campbell Barton
0d719fcacb Cleanup: spelling 2019-08-12 01:10:43 +10:00
Sergey Sharybin
8f1a55831c Cycles: Fix wrong number of threads on multi-socket machines
The issue was caused by a limitation of GetNumaNodeProcessorMask():
on systems with more than 64 processors, this parameter is set to the
processor mask for the node only if the node is in the same processor
group as the calling thread. Otherwise, the parameter is set to zero.

Patch from Max Dmitrichenko, thanks!
2019-08-05 15:33:47 +02:00
47bf754de4 Build: disable address sanitizer for Cycles optimized kernels with GCC
It's extremely slow to compile and run, so just disable it unless
WITH_CYCLES_KERNEL_ASAN is manually enabled. For Clang it's always
enabled since that appears to work ok.

This also limits the -fno-sanitize=vptr flag to the Cycles kernel, as it
was added specifically to work around an issue there.

Differential Revision: https://developer.blender.org/D5404
2019-08-05 15:23:57 +02:00
Sergey Sharybin
9620b8f6bb Cycles: Fix compilation on 32bit Linux with GCC-9
We don't use explicit SIMD flags on 32bit, so trying to use
intrinsics was causing issues.
2019-08-05 11:47:47 +02:00
Lazydodo
418fdee5dc Cleanup: Mark large arrays of of constant data as const.
For background information see D5345

Reviewers: brecht, sergey

Differential Revision: https://developer.blender.org/D5345
2019-08-04 14:24:29 -06:00
Campbell Barton
2425401a59 Cleanup: spelling 2019-08-04 12:51:44 +10:00
15e224dca3 Build: disable RTTI for the entire Cycles module, not only the kernel
The partial disabling was causing issues with Clang and ASAN, and it seems we
don't need to restrict it to the kernel anymore now that we are no longer using
boost directly.
2019-08-02 19:03:57 +02:00
Sebastian Parborg
369ffbd911 Fix T68073: Wacom Intuos 5S no pen pressure on Wayland
The issue is that wayland seems to impose a generic device naming scheme
when using Xwayland For example any table stylus will show up with the
following naming convention: xwayland-stylus:33

For this to work in blender, I had to modify how the identifier string
is extracted. I also renamed the two char pointers in the search
algorithm to be more logical.

Reviewed By: Brecht

Differential Revision: http://developer.blender.org/D5401
2019-08-02 16:42:24 +02:00
Campbell Barton
58a2b2dd7e Cleanup: spelling 2019-08-02 12:05:13 +10:00
Campbell Barton
760dbd1cbf Cleanup: misc spelling fixes
T68035 by @luzpaz
2019-08-01 14:02:41 +10:00
Lukas Stockner
feed46c4ae Merge per-shader SVM nodes in the main update thread to avoid locking and resizing overhead
In a test file containing 1300 copies of the same shader, this reduces shader update time from 3.1 sec to 0.05 sec.

Thanks to @swerner for noticing this issue.

Reviewers: brecht, sergey, swerner

Subscribers: swerner

Differential Revision: https://developer.blender.org/D5376
2019-07-31 12:03:45 -07:00
Jeroen Bakker
0d3493d6d9 Fix: Cycles reporting incorrect number of samples in viewport render
During viewport rendering where the viewport samples are set to 0 the UI
showed 16777216 as number of samples. We should not show the number of
samples when the number of viewport samples are set to 0.

Differential Revision: https://developer.blender.org/D5301
2019-07-31 14:32:41 +02:00
604fdb6e85 Spelling fixes in comments and descriptions, patch by luzpaz
Differential Revision: https://developer.blender.org/D3744
2019-07-31 14:27:35 +02:00
Sergey Sharybin
7d65827980 Fix T67089: Solve camera motion generates "Solve error: nan"
The code was missing some checks for whether keyframe selection
went successfully and whether reconstruction has been successfully
initialized.

The interface still gives quite generic message, with the details
printed to the console. This can be addressed separately.
2019-07-23 15:12:35 +02:00
Philipp Oeser
65168825e0 cleanup: typo in cycles 'min_transparent_bounces' tooltip
Reviewers: brecht

Differential Revision: https://developer.blender.org/D5249
2019-07-14 23:02:51 +02:00
Sergey Sharybin
7ad21c3876 Fix T66604: Cycles bake crash on specific scene with volume
The issue was caused by un-initialized local storage for volume
intersection hits which are supposed to be stored in per-thread
KernelGlobals.

Fix is to make thread_shader() be the same as thread_render() in
respect of KernelGlobals.

Reviewers: brecht

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5230
2019-07-11 15:44:09 +02:00
Sergey Sharybin
d663048696 Fix T66691: Ceash trying to render the 2.80 splash image
Was caused by ray direction becoming NaN after some of the bounces.
2019-07-11 13:00:26 +02:00
Campbell Barton
167f5a61e5 C Logging: add macro to check if logging is enabled 2019-07-10 19:39:53 +10:00
Campbell Barton
28057d54de Cleanup: clang-format 2019-07-07 23:45:35 +10:00
Campbell Barton
cd6b49f995 Cleanup: spelling 2019-07-07 15:38:41 +10:00
Sergey Sharybin
9ffb87c629 Fix T66296: Black artefacts on materials with refraction on CPU
The issue was in the optimization code path for opaque shadow rays
which was wrongly considering all primitives in the node to have
same visibility flags.
2019-07-05 15:48:50 +02:00
Aaron Carlisle
fdcfc263e9 Use latest/version number for manual links
We want users to go to the current version for their current version 
when possible if not point to latest.

/dev should really only be for development related work. End users 
should not be browsing /dev unless they are reading about upcoming 
features ahead of time.
2019-07-04 18:24:36 -04:00
2740bdfff9 Fix T66362, T66004: Cycles holdout should override indirect only
Now it works again like 2.7, rather than objects disappearing from camera
rays when both options are on.
2019-07-04 18:16:36 +02:00
acf26dee5f Fix T66412: crash with displacement and AO node in viewport renders 2019-07-04 13:11:55 +02:00
Sergey Sharybin
dd6aff71a7 Fix compilation error without Cycles logging 2019-06-29 13:54:38 +02:00
c9238e638f Cycles: add back control to render first N bounces with path termination
It's found in the Sampling > Advanced panel and 0 by default. This helps to
reduce noise in some scenes, while making others slower.
2019-06-28 17:47:53 +02:00
4e8c5f4bc8 Fix Cycles OSL assert when running tests 2019-06-28 17:42:35 +02:00
Sergey Sharybin
0511de99bb Fix non-working verbosity when set prior to --debug
Before this change doing something like `--verbose 10 --debug-cycles`
did not properly set verbosity, only using those arguments in an other
way around was leading to a correct verbosity level.
2019-06-28 15:45:29 +02:00
5eb156e769 Fix T66171: Cycles OSL trace() crashing in displacement shaders
This is not supported, meshes do not exist in the BVH before displacement.
2019-06-27 12:46:04 +02:00