Commit Graph

495 Commits

Author SHA1 Message Date
11310b554a Cycles: avoid some CUDA performance on scenes without deformation motion blur. 2014-04-26 14:29:52 +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
Carlo Andreacchio
7765b73f6d Cycles: add Transparent Depth output to Light Path node.
This can for example be useful if you want to manually terminate the path at
some point and use a color other than black.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D454
2014-04-21 14:44:36 +02:00
John Pavel
f8cd3d974d Code cleanup: add some asserts and fix a typo in BVH build.
Reviewed By: brecht

Differential Revision: https://developer.blender.org/D467
2014-04-21 14:44:36 +02:00
Kevin Dietrich
83988b6cdd Fix new Cycles UV Map node not working correct for bump mapping.
Reviewed By: brecht

Differential Revision: https://developer.blender.org/D475
2014-04-21 14:44:36 +02:00
2a9ef256b1 Cycles: SVM optimization for mix shaders, to skip more code when the mix weight
for one of the input shaders is zero.

This gives about 5% speedup for koro_final.blend. In general this is important
so you can design shaders that run faster for shadows, diffuse bounces, etc, for
example by skipping procedural textures or even using a single fixed color.
2014-04-18 14:40:19 +02:00
eecc426d86 Fix cycles standalone file saving not taking number of samples into account properly. 2014-04-16 15:28:24 +02:00
976f59ab8c Fix cycles standalone not writing images in background mode properly. 2014-04-15 15:19:23 +02:00
2ab9a0ff09 Fix cycles standalone not saving renders in background mode. 2014-04-14 14:11:07 +02:00
Bastien Montagne
e29698d3cd Split Normals I (5/5): Add support of split normals to Cycles.
Idea and code by Brecht, many thanks!

Reviewers: brecht

Reviewed By: brecht

CC: campbellbarton, dingto

Differential Revision: https://developer.blender.org/D369
2014-04-13 12:51:13 +02:00
cb0520f79a Fix for auto detect homogeneous volume with OSL, forgot to include this file in last commit. 2014-04-05 14:49:50 +02:00
bd03e4cfe8 Cycles volume: detect homogeneous volume automatically in common cases.
In practice this means that if you don't connect a texture to your volume nodes
it will figure that out and render the node faster, rather than you having to
specify it manually.

Main weakness is custom OSL nodes where we have to assume it is heterogeneous
because we don't know what kind of data the node accesses.
2014-04-03 22:13:05 +02:00
Kevin Dietrich
cb7cfd3ab6 Cycles: add dedicated UV Map node, easier to find and has convenient auto complete.
Fixes T37954.

Reviewed By: brecht, dingto

Differential Revision: https://developer.blender.org/D230
2014-04-02 11:53:44 +02:00
Sergey Sharybin
a9b82244de Code cleanup: fixes for function prototypes 2014-03-31 17:35:56 +06:00
73299516fa Fix scons CUDA build and compile error with more strict compilers. 2014-03-29 15:57:27 +01:00
691c4c17ad Cycles: add "density", "flame" and "color" attributes for smoke domains.
These can currently be accessed by adding an Attribute node and specifying one
of those three names. A Smoke/Fire node should be added at some point to make
this more convenient.

These values might change still before the release, in particular for flame the
meaning seems unclear, it's just values in the 0..1 range. This is useful for
color ramps, but it might be good if this was also available as temperature in
kelvin so it can be plugged into the blackbody node. But I couldn't figure out
from the smoke code if or how this corresponds to a physical unit.

Here's a (quite poor) example file for a fire + smoke setup:
http://www.pasteall.org/blend/27990
2014-03-29 13:03:48 +01:00
27043b8e40 Cycles code internals: add support for mesh voxel grid attributes.
These are internally stored as a 3D image textures, but accessible like e.g.
UV coordinates though the attribute node and getattribute().

This is convenient for rendering e.g. smoke objects where data like density is
really a property of the mesh, and it avoids having to specify the smoke object
in a texture node, instead the material will work with any smoke domain.
2014-03-29 13:03:48 +01:00
663a750c7f Fix: cycles volume emission incorrectly enabling surface importance sampling. 2014-03-29 13:03:48 +01:00
a2e4ebd36a Cycles code internals: add CPU kernel support for 3D image textures. 2014-03-29 13:03:48 +01:00
e8b1cfed0a Cycles code refactor: replace magic ~0 values in the code with defines. 2014-03-29 13:03:47 +01:00
e2184c653e Cycles: add support for curve deformation motion blur. 2014-03-29 13:03:47 +01:00
6020d00990 Cycles: add support for mesh deformation motion blur. 2014-03-29 13:03:47 +01:00
8f33538fab Cycles code refactor: add motion sampled normals attribute. 2014-03-29 13:03:46 +01:00
99f5993088 Cycles code refactor: improve vertex motion attribute storage and export.
This now supports multiple steps and subframe sampling of motion.

There is one difference for object and camera transform motion blur. It still
only supports two steps there, but the transforms are now sampled at subframe
times instead of the previous and next frame and then interpolated/extrapolated.
This will give different render results in some cases but it's more accurate.

Part of the code is from the summer of code project by Gavin Howard, but it has
been significantly rewritten and extended.
2014-03-29 13:03:46 +01:00
934767cf7f Cycles code refactor: change curve key to float4 for easier storage as attribute. 2014-03-29 13:03:46 +01:00
0509553b5e Cycles code refactor: changes to make adding new primitive types easier. 2014-03-29 13:03:46 +01:00
24ad7e0bea Cycles code refactor: add support for motion vertex attributes. 2014-03-29 13:03:46 +01:00
41d1675053 Cycles code refactor: move more geometry code into per primitive files. 2014-03-29 13:03:45 +01:00
Lukas Tönne
8da4936590 Fix for build error in Cycles standalone caused by new DeviceDrawParams
added in rB74518b28267e9b18199212fbaa3c689fa018d20c.

No special bind/unbind needed for standalone viewer, so can just use a
static stub in the display callback.
2014-03-26 18:11:16 +01:00
Sergey Sharybin
74518b2826 Fix T39420: Cycles viewport/preview flickers, when moving mouse across editors
Issue was caused by the wrong usage of OCIO GLSL binding API. To make it
work properly on pre-GLSL-1.3 drivers shader is to be enabled after the
texture is binded to the opengl context. Otherwise it wouldn't know the
proper texture size.

This is actually a regression in 2.70 and to be ported to 'a'.
2014-03-26 15:58:53 +06:00
Thomas Dinges
31cc49b5df Code cleanup: Move AA Samples variable, this is not exclusive to Branched Path. 2014-03-23 12:15:33 +01:00
Thomas Dinges
211f08d89b Cycles: Direct multi light sampling in the Branched Path Integrator is optional now.
Disabling this can improve performance, when we need a lot of AA Samples anyway, to clear up the render.

Simple example .blend: http://www.pasteall.org/blend/27582

Differential Revision: https://developer.blender.org/D392
2014-03-15 17:37:43 +01:00
f959e3d4ba Fix T39146: recent cycles CUDA regression in fix for T39114.
This commit is to be backported to the 2.70 release.
2014-03-13 14:18:34 +01:00
d7cff8f74c Fix T39114: cycles lamp ray visibility not working.
Thanks to Thomas for finding the cause.
2014-03-12 18:21:23 +01:00
Thomas Dinges
99e20d7b89 Cycles: Option to Sample all Lights in the Branched Path integrator for indirect samples
This adds a new option "Sample All Lights" to the Sampling panel in Cycles (Branched Path). When enabled, Cycles will sample all the lights in the scene for the indirect samples, instead of randomly picking one. This is already happening for direct samples, now you can optionally enable it for indirect.

Example file and renders:
Blend file: http://www.pasteall.org/blend/27411
Random: http://www.pasteall.org/pic/show.php?id=68033
All: http://www.pasteall.org/pic/show.php?id=68034

Sampling all lights is a bit slower, but there is less variance, so it should help in situations with many lights.

Patch by myself with some tweaks by Brecht.
Differential Revision: https://developer.blender.org/D391
2014-03-09 22:20:01 +01:00
Thomas Dinges
36279afbd3 Cycles: Compile fix and some cleanup for the Image interpolation commit. 2014-03-08 00:23:45 +01:00
Martijn Berger
dd2dca2f7e Add support for multiple interpolation modes on cycles image textures
All textures are sampled bi-linear currently with the exception of OSL there texture sampling is fixed and set to smart bi-cubic.

This patch adds user control to this setting.

Added:
- bits to DNA / RNA in the form of an enum for supporting multiple interpolations types
- changes to the image texture node drawing code ( add enum)
- to ImageManager (this needs to know to allocate second texture when interpolation type is different)
- to node compiler (pass on interpolation type)
- to device tex_alloc this also needs to get the concept of multiple interpolation types
- implementation for doing non interpolated lookup for cuda and cpu
- implementation where we pass this along to osl ( this makes OSL also do linear untill I add smartcubic to the interface / DNA/ RNA)

Reviewers: brecht, dingto

Reviewed By: brecht

CC: dingto, venomgfx

Differential Revision: https://developer.blender.org/D317
2014-03-07 23:16:33 +01:00
Thomas Dinges
8a38d840e9 Cycles: Use Displacement type in OSL ShadingSystem.
Reviewed by: brecht
Differential Revision: https://developer.blender.org/D386
2014-03-06 21:03:22 +01:00
4d1159627c Fix cycles wrong volume scatter value in light path node.
Thanks to Thomas for spotting this.

Differential Revision: https://developer.blender.org/D370
2014-02-27 21:15:23 +01:00
Lukas Tönne
0bef196894 Fix T38811: Cycles particle ids are inconsistent when using multiple particle systems.
Problem is that the particle systems in the cycles database are not
stored in a well-defined order. This means the particle_id for dupli
objects can not simply be assigned using a global running index during
sync.

Now the particle index is assigned locally for each particle system.
When transferring particle data to the device as a single texture, the
particle indices are offset based on the final order of particle systems
in the database.

Reviewers: brecht

Reviewed By: brecht

CC: Andreas80

Differential Revision: https://developer.blender.org/D352
2014-02-25 18:29:11 +01:00
Thomas Dinges
8cc925a216 Cycles Standalone: The camera now gets properly updated, when changing window size or using --width --height overwrites. 2014-02-14 18:40:31 +01:00
2bf591762a Cycles: equi-angular sampling for homogeneous volumes
This adds an option in the Volume Sampling panel, which helps rendering lamps
inside or near volumes with less noise. It can also increase noise though and
needs improvements to support MIS and heterogeneous volumes, but since it's
useful in some cases already (especially world volumes) it's there now.

Based on the code in the old branch by Stuart, with modifications by Thomas
and Brecht.

Differential Revision: https://developer.blender.org/D291
2014-02-14 17:37:34 +01:00
Thomas Dinges
0da1321985 Cycles Standalone: More updates for the Node XML API.
Should be almost complete now, apart from Ramp Nodes (Color Ramp, RGB Curves...).
2014-02-13 20:37:41 +01:00
Thomas Dinges
5a35034fb3 Fix Cycles Light Passes being always enabled, own regression in Clamp commit yesterday.
KernelIntegrator just doesn't have valid data at this point, so we need to go one level deeper.
2014-02-11 14:14:43 +01:00
Thomas Dinges
e29a45b396 Cycles: Separation of Indirect and Direct clamping.
Indirect and Direct samples can now be clamped individually. This way we can clamp the indirect samples (fireflies), while keeping the direct highlights.
Example render: http://www.pasteall.org/pic/show.php?id=66586

WARNING: This breaks backwards compatibility. If you had Clamping enabled in an old file, you must re-enable either Direct/Indirect clamping or both again.

Reviewed by: brecht
Differential Revision: https://developer.blender.org/D303
2014-02-10 21:46:02 +01:00
0f8ad228c3 Fix T38526: crash using blackbody node on background with multiple importance sampling. 2014-02-06 21:10:22 +01:00
a41648c1dc Cycles: add pass alpha threshold value to render layers.
Z, Index, normal, UV and vector passes are only affected by surfaces with alpha
transparency equal to or higher than this threshold. With value 0.0 the first
surface hit will always write to these passes, regardless of transparency. With
higher values surfaces that are mostly transparent can be skipped until an opaque
surface is encountered.
2014-02-06 15:24:15 +01:00
Campbell Barton
1dc1d92dab Code cleanup: white space and cmake was broken on all platforms 2014-02-03 13:56:34 +11:00
Thomas Dinges
c0e6a0d318 Code cleanup / Cycles: Remove unused "curverender" variable from Object class, was never used. 2014-02-02 20:11:50 +01:00