Commit Graph

4148 Commits

Author SHA1 Message Date
Dalai Felinto
672cebf19a Cycles-Bake: displacement support (fix T40068)
Code with contribution from Brecht Van Lommel.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D510
2014-05-08 14:38:43 -03:00
19bddbfc54 Fix T40079: cycles crash with objects that have hair motion blur, but no triangle motion. 2014-05-08 15:27:49 +02:00
Campbell Barton
65d54f34b1 Code cleanup: spelling/indentation 2014-05-08 04:53:05 +10:00
edd78fb308 Fix cycles crash after recent use alpha commit. 2014-05-07 19:00:56 +02:00
Dalai Felinto
83cdd5887f Cycles-Bake: Subsurface Scattering support (fix T40060)
This fixes the SSS Direct/Indirect passes as well as the Combined pass.
Patch reviewed and with fixes and contributions from Brecht van Lommel.

Note: displacement/bump map (related to the report) will be handled separately

Reviewers: brecht

Differential Revision: https://developer.blender.org/D503
2014-05-07 11:59:25 -03:00
Matt Heimlich
3fbc984b06 Nodes: add absolute value operation to all math nodes
Reviewed By: dingto, brecht

Differential Revision: https://developer.blender.org/D507
2014-05-07 16:43:59 +02:00
Carlo Andreacchio
8b8d5a441f Cycles: add support for "Use Alpha" option on image datablocks.
Reviewed By: brecht

Differential Revision: https://developer.blender.org/D486
2014-05-07 16:43:50 +02:00
Dalai Felinto
08bf531956 Cycles-Bake: Ambient Occlusion needs to be computed for COMBINED
Now the COMBINED pass includes the Ambient Occlusion.

This was not reported anywhere, but while working in the Subsurface Scattering I realize we needed this fix for combined.
2014-05-07 10:18:00 -03:00
Campbell Barton
f300c158b9 Fix possible NULL pointer dereference in Cycles 2014-05-07 04:19:53 +10:00
6dbe732a2f Fix T40049: cycles baking glossy shader looks faceted.
Use smooth normal instead of flat normal as view direction.
2014-05-06 18:17:54 +02:00
80e137e826 Fix T39946: OSL + tangent space normal maps not working in Cycles. 2014-05-06 16:39:50 +02:00
Campbell Barton
fd7f5c4230 Cycles: revert part of the optimization from ff34c2d
This was faster for my AMD system but slower for Intel.

However with gcc4.9,-O3 I was able to get roughly the same speed before/after.

Revert since this isnt giving such clear benefits on most systems.
2014-05-06 14:07:04 +10:00
8641e30787 Fix T40032: hair BSDF not working correct after primitive type code refactoring. 2014-05-05 17:15:48 +02:00
7a2ece3c19 Fix T40031: cycles deformation motion blur wrong render on last frame of animation. 2014-05-05 17:15:48 +02:00
Campbell Barton
620901426c Code cleanup 2014-05-05 12:29:28 +10:00
Campbell Barton
d27eea6dc6 Add check for LIKELY/UNLIKELY is CPU only 2014-05-05 07:26:49 +10:00
Campbell Barton
ff34c2de64 Cycles: avoid int->float conversions for pixel lookups
Gives ~3% speedup for image.blend test, and 6% for image heavy file.

Overall speedup in real-world use is likely much less.
2014-05-05 06:58:39 +10:00
Campbell Barton
d828d44d7a Cycles: use LIKELY/UNLIKELY macros
Gives overall ~3% speedup in own tests for BMW scene.
2014-05-05 03:49:22 +10:00
Campbell Barton
dc13969e48 Style cleanup: indentation, braces 2014-05-05 02:19:08 +10:00
Campbell Barton
e86dbf6877 Code cleanup: avoid int/uint mixup in cycles 2014-05-05 01:30:02 +10:00
Campbell Barton
1618329b00 Code cleanup: style, require ; for cuda_assert, opencl_assert 2014-05-04 03:57:50 +10:00
Campbell Barton
95d885b3f4 Quiet float conversion warnings when building cycles standalone 2014-05-04 03:15:20 +10:00
Bastien Montagne
c7612d68b2 Comment out scons '-Werror=float-conversion' for Cycles for now.
This option is only available in gcc >= 4.9, and we do not have a fancy helper in scons
to check availability of a flag...
2014-05-03 11:08:27 +02:00
Bastien Montagne
392d5de0aa Fix '-Werror=float-conversion' error with gcc < 4.9, for CMake
Scons is still TODO.
2014-05-03 10:54:02 +02:00
198f5e506a Cycles: CUDA changes for kernel evaluation cancel 2014-05-02 21:19:10 -03:00
Dalai Felinto
eec3eaba08 Cycles Bake
Expand Cycles to use the new baking API in Blender.

It works on the selected object, and the panel can be accessed in the Render panel (similar to where it is for the Blender Internal).

It bakes for the active texture of each material of the object. The active texture is currently defined as the active Image Texture node present in the material nodetree. If you don't want the baking to override an existent material, make sure the active Image Texture node is not connected to the nodetree. The active texture is also the texture shown in the viewport in the rendered mode.

Remember to save your images after the baking is complete.

Note: Bake currently only works in the CPU
Note: This is not supported by Cycles standalone because a lot of the work is done in Blender as part of the operator only, not the engine (Cycles).

Documentation:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Bake

Supported Passes:
-----------------
Data Passes
 * Normal
 * UV
 * Diffuse/Glossy/Transmission/Subsurface/Emit Color

Light Passes
 * AO
 * Combined
 * Shadow
 * Diffuse/Glossy/Transmission/Subsurface/Emit Direct/Indirect
 * Environment

Review: D421
Reviewed by: Campbell Barton, Brecht van Lommel, Sergey Sharybin, Thomas Dinge

Original design by Brecht van Lommel.

The entire commit history can be found on the branch: bake-cycles
2014-05-02 21:19:09 -03:00
Campbell Barton
8d16869d83 Code cleanup: Add -Werror=float-conversion to Cycles 2014-05-03 07:31:46 +10:00
Thomas Dinges
9270aa9278 Cleanup: Remove unused variables. 2014-05-02 01:27:10 +02:00
Pablo Vazquez
4e7780a34a Cycles UI:
Show the Ray Visibility panel for objects with dupli_group on, no reason to hide it.
2014-05-01 19:14:10 -03:00
c806a8ce96 Cycles: MIS for lamps now loops over all lamps instead of picking one.
Probably will not be noticed in most scenes. This helps reduce noise when you
have multiple lamps with MIS enabled, at the cost of some performance, but from
testing some scenes this seems better.
2014-05-01 19:25:13 +02:00
Thomas Dinges
8d42e7b20d Cleanup / Cycles: Adjust comment for faster testing in the future.
Unfortunately the function call is still a bit slower, even with CUDA 6.0. :/
2014-05-01 01:21:21 +02:00
Sergey Sharybin
19cd6922a5 Fix T39965: Sequencer do not sync cycles strips
The was actually caused by the way how Cycles uses objects
layers. It's not possible to rely on the fact that layers
are flushed from Base to Object. It's only valid when rendering
active scene.

Now made it so layers are used from the base.
2014-04-30 21:08:07 +06:00
741f17f05b Cycles CUDA: make CUDA toolkit 6.0 the official supported version.
This also updates the configurations to build kernels for compute capability
5.0 cards, when using and older CUDA toolkit version this will be skipped.

Also includes tweaks to improve performance with this version:
* Increase max registers on sm_30, sm_35 and sm_50
* No longer use texture storage on sm_30
2014-04-30 16:07:27 +02:00
Kevin Dietrich
1dcf956849 Fix for wrong behavior of 'darken' blend mode with factor.
The formula was not consistent across Blender and behaved strangely, now it is
a simple linear blend between color1 and min(color1, color2).

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D489
2014-04-29 14:03:09 +02:00
Lawrence D'Oliveiro
ef3eb7adc6 Code cleanup: don't use unnecessary .exe extension in scons, simplify code.
Reviewed By: brecht

Differential Revision: https://developer.blender.org/D236
2014-04-29 14:03:08 +02:00
6dec2b1a2b Cycles CUDA: add support for sm_50 cards in kernel.cu, for testing. 2014-04-28 14:46:53 +02:00
Campbell Barton
a2489e29f6 Code cleanup: style, unused import 2014-04-28 00:19:15 +10:00
11310b554a Cycles: avoid some CUDA performance on scenes without deformation motion blur. 2014-04-26 14:29:52 +02:00
61eba8fd06 Fix T39843: cycles memory leak rendering with high transparent depth. 2014-04-25 15:30:12 +02:00
Campbell Barton
a15be34389 Code cleanup: unused python vars & imports
Use frosted rather then pyflakes
2014-04-25 05:36:16 +10:00
Campbell Barton
e0920364ce Quiet warning 2014-04-23 17:01:56 +10:00
6b9ca06088 Cycles: some tiny hair intersection optimizations that help maybe 2%. 2014-04-23 01:35:28 +02:00
0f85174d50 Fix occasional wrong normal for curves with minimum width.
This caused a couple of fireflies in koro_final.blend. The wrong normal would
cause the shading point to be set as backfacing, which triggered another bug
with hair BSDFs on the backface of hair curves. That one is not fixed yet but
there's a comment in the code about it now.
2014-04-23 01:35:27 +02:00
6974b69c61 Cycles: optimization for hair BVH build, allow max 2 hair curves per leaf.
This gives me 14% reduction in render time for koro_final.blend.
2014-04-22 17:15:41 +02:00
Bastien Montagne
0e2f6c7fc4 Fix T39833: Nurbs Crash
Converting empty object to mesh can generate a 'Null' BL:Mesh, we have to check against it.
2014-04-21 23:41:39 +02:00
9ab259f55b Cycles: shadow function optimization for transparent shadows (CPU only).
Old algorithm:

Raytrace from one transparent surface to the next step by step. To minimize
overhead in cases where we don't need transparent shadows, we first trace a
regular shadow ray. We check if the hit primitive was potentially transparent,
and only in that case start marching. this gives extra ray cast for the cases
were we do want transparency.

New algorithm:

We trace a single ray. If it hits any opaque surface, or more than a given
number of transparent surfaces is hit, then we consider the geometry to be
entirely blocked. If not, all transparent surfaces will be recorded and we
will shade them one by one to determine how much light is blocked. This all
happens in one scene intersection function.

Recording all hits works well in some cases but may be slower in others. If
we have many semi-transparent hairs, one intersection may be faster because
you'd be reinteresecting the same hairs a lot with each step otherwise. If
however there is mostly binary transparency then we may be recording many
unnecessary intersections when one of the first surfaces blocks all light.

We found that this helps quite nicely in some scenes, on koro.blend this can
give a 50% reduction in render time, on the pabellon barcelona scene and a
forest scene with transparent leaves it was 30%. Some other files rendered
maybe 1% or 2% slower, but this seems a reasonable tradeoff.

Differential Revision: https://developer.blender.org/D473
2014-04-21 19:34:25 +02:00
Thomas Dinges
f6abc96b6b Cleanup: Remove OpenCL __MULTI_CLOSURE__ sanity check, not needed anymore after 04a10907dc41. 2014-04-21 18:08:01 +02:00
Thomas Dinges
5ce2edfc6f Cleanup: Pass PathState as a whole, instead of individual members.
Differential Revision: https://developer.blender.org/D477
2014-04-21 17:52:19 +02:00
785f20f8c3 Fix T39793: cycles SVM shading bug with tangled up nodes after recent optimization. 2014-04-21 17:17:52 +02:00
04a10907dc Code cleanup: remove old closure sampling code Cycles.
This was the original code to get things working on old GPUs, but now it is no
longer in use and various features in fact depend on this to work correctly to
the point that enabling this code is too buggy to be useful.
2014-04-21 16:14:37 +02:00