Commit Graph

1569 Commits

Author SHA1 Message Date
6ccf3402cb Fix T37790: OSL not rendering subsurface scattering color correct since upgrade to 1.4. 2013-12-18 12:29:11 +01:00
Sergey Sharybin
c5d7ea091f Changes to partial update during rendering
Summary:
Mainly addressed to solve old TODO with color managed fallback
to CPU mode when displaying render result during rendering.

That fallback was caused by the fact that partial image update
was always acquiring image buffer for composite output and was
only modifying display buffer directly.

This was a big issue for Cycles rendering which renders layers
one by one and wanted to display progress of each individual
layer. This lead to situations when display buffer was based on
what Cycles passes via RenderResult and didn't take layer/pass
from image editor header into account.

Now made it so image buffer which partial update is operating
with always corresponds to what is set in image editor header.

To make Cycles displaying progress of all the layers one by one
made it so image_rect_update switches image editor user to
newly rendering render layer. It happens only once when render
engine starts rendering next render layer, so should not be
annoying for navigation during rendering.

Additional change to render engines was done to make it so
they're able to merge composite output to final result
without marking tile as done. This is done via do_merge_result
argument to end_result() callback. This argument is optional
so should not break script compatibility.

Additional changes:

- Partial display update for Blender Internal now happens from
  the same thread as tile rendering. This makes it so display
  conversion (which could be pretty heavy actually) is done in
  separate threads. Also gives better UI feedback when rendering
  easy scene with small tiles.

- Avoid freeing/allocating byte buffer for render result
  if it's owned by the image buffer. Only mark it as invalid
  for color management.

  Saves loads of buffer re-allocations in cases when having
  several image editors opened with render result. This change
  in conjunction with the rest of the patch gave around
  50%-100% speedup of render time when displaying non-combined
  pass during rendering on my laptop.

- Partial display buffer update was wrong for buffers with number
  of channels different from 4.

- Remove unused window from RenderJob.

- Made image_buffer_rect_update static since it's only used
  in single file.

Reviewers: brecht

Reviewed By: brecht

CC: dingto

Differential Revision: http://developer.blender.org/D98
2013-12-17 23:42:38 +06:00
Thomas Dinges
011ae78857 Cycles / OpenCL: Fix compile error on OS X
After update to Mac OS X 10.9.1, OpenCL works now on my Intel CPU in the 2013 Macbook Pro (even the entire kernel).
The Intel Iris Pro GPU still segfaults here though, even when all flags are disabled (building "clay like" kernel only).

Maybe we need the -no-missing-prototypes for AMD hardware still, but I couldn't find a way to distuinguish here.
2013-12-17 09:59:18 +01:00
c05209ec01 Fix T37827: cycles XML mesh export utility not longer worked. 2013-12-16 11:08:41 +01:00
Peter Staples
4a141022c3 Fix T37816: make cycles panel registration work better with addons.
This would give an error when an addon removed a panel.
2013-12-14 18:00:25 +01:00
Thomas Dinges
1bebdc9ad0 Fix T37264: cycles CPU render had limited number of float images, bumped to 1024.
GPU is still limited to 5, but there's no good reason for the CPU to be limited.
2013-12-14 15:07:46 +01:00
Thomas Dinges
b43ce8a140 Code cleanup / Cycles: Remove some unused hair code. 2013-12-14 13:11:44 +01:00
1e045a2417 Cycles: CUDA runtime kernel compilation can now find CUDA 6.0. 2013-12-13 19:12:07 +01:00
Campbell Barton
6c96535fd8 Code Cleanup: use static for sky_model_data.h 2013-12-13 04:40:30 +11:00
d7945b7202 Fix T37704: cycles hair render error with hair density vertex group.
Zero length hairs were causing problems, now it skips rendering them as they
are invisible anyway.
2013-12-10 19:47:27 +01:00
7e5d2fee71 Fix T37694: cycles particles emitter object rendering when it shouldn't.
This was broken by a recent bugfix for T37159.
2013-12-09 21:59:45 +01:00
b38f645bf1 Fix build error when building without OSL support. 2013-12-09 05:28:19 +01:00
38adc8a91f Cycles OSL: update to build with latest OSL master shader group changes. 2013-12-08 15:15:27 +01:00
Campbell Barton
05e96ba160 Style: use frozen sets 2013-12-08 22:53:55 +11:00
Thomas Dinges
28d5f2ab60 Cycles: Update stdosl.h to OSL 1.4.0. (includes new aastep functions). 2013-12-08 12:20:15 +01:00
Thomas Dinges
2069606dc5 Code cleanup: UI cleanup for cycles UI code and fix typo in system info. 2013-12-08 12:13:09 +01:00
Sergey Sharybin
b6646c6a2a Bummer, forgot to test with OSL disabled. 2013-12-08 15:19:59 +06:00
Sergey Sharybin
46f8dba4c7 Extend system-info with information about OIIO, OCIO and OSL
Summary:
Version of those libraries might be useful to know.

- OIIO and OCIO is exposed via bpy.app.oiio and bpy.app.ocio.
  There're "supported", "version" and "version_string" defined
  in those modules.

- OSL is available as _cycles.osl_version and _cycles.osl_version_string.

Reviewers: campbellbarton

Reviewed By: campbellbarton

CC: dingto

Differential Revision: http://developer.blender.org/D79
2013-12-08 15:03:17 +06:00
Martijn Berger
85a0c5d4e1 Cycles: network render code updated for latest changes and improved
This actually works somewhat now, although viewport rendering is broken and any
kind of network error or connection failure will kill Blender.

* Experimental WITH_CYCLES_NETWORK cmake option
* Networked Device is shown as an option next to CPU and GPU Compute
* Various updates to work with the latest Cycles code
* Locks and thread safety for RPC calls and tiles
* Refactored pointer mapping code
* Fix error in CPU brand string retrieval code

This includes work by Doug Gale, Martijn Berger and Brecht Van Lommel.

Reviewers: brecht

Differential Revision: http://developer.blender.org/D36
2013-12-07 12:26:58 +01:00
Thomas Laroche
5c07f62fab Cycles: show remaining render time in render info text
It's a simple estimate, not very precise but that isn't really possible always.
For progressive render it will become more accurate the longer you render.

Reviewed By: brecht

Differential Revision: http://developer.blender.org/D67
2013-12-07 12:26:58 +01:00
4d6c877b66 Cycles OSL: fix mistake in recent refactoring, parameters are not set before setup. 2013-11-29 17:18:43 +01:00
746628e0d0 Cycles OSL: refactoring to remove all dependencies on builtin OSL closures.
These were removed in new OSL versions. We only used these as base classes,
not using them at all simplifies the code a bit.
2013-11-29 04:01:07 +01:00
62bf24a5c3 Cycles: experimental OpenSubdiv code.
This code can't actually be enabled for building and is incomplete, but it's
here because we know we want to support this at some point and there's not much
reason to have it in a separate branch if a simple #ifdef can disable it.
2013-11-28 02:11:42 +01:00
89cfeefab5 Cycles: experimental OSL ptex reading code.
This code can't actually be enabled for building and is incomplete, but it's
here because we know we want to support this at some point and there's not much
reason to have it in a separate branch if a simple #ifdef can disable it.
2013-11-28 02:11:42 +01:00
44d1c92e60 Cycles: add ptex face ID and UV attributes.
Not the most memory efficient way to store these things but it's simple and
implementing it better requires some work to natively support subd grids as
a primitive in some way.
2013-11-28 02:11:42 +01:00
731ffd3cd4 Cycles: remove approximate subdivision surface with gregory patches code.
It was never fully implemented and will be replaced by OpenSubdiv. Only linear
subdivision remains now. Also includes some refactoring in the split/dice code,
adding a SubdParams struct to pass around parameters more easily.
2013-11-28 02:11:42 +01:00
f67dda6893 Fix T37159: cycles rendering particle emitter mesh incorrectly when using non-hair particles. 2013-11-27 17:17:25 +01:00
8cb78f1094 Fix mistake in last commit with submodules. 2013-11-26 20:40:55 +01:00
b98ff5cb5b Fix T37303, Fix T37163: cycles mask layers that are also excluded not rendering
correct with multiple render layers.

This case is somewhat weak, we now do a few more checks on sync than I would
like, but it's not too bad.
2013-11-26 20:36:53 +01:00
Thomas Dinges
5dec5fd4e5 Cycles: Add missing unregister for world ray visibility pointer. 2013-11-24 22:30:11 +01:00
fab96b5913 UI List: remove separate name text fields.
It was never the intention to have these separate, and now that we can rename
directly in the list there is no more need for them.
2013-11-24 14:27:02 +01:00
58ec292fd8 Fix cycles build error with visual studio, apparently the windows ABI does not
like 16 bit alignment on 32 bit.
2013-11-23 05:47:57 +01:00
Martijn Berger
e3a79258d1 Cycles: test code for sse 4.1 kernel and alignment for some vector types.
This is mostly work towards enabling the __KERNEL_SSE__ option to start using
SIMD operations for vector math operations. This 4.1 kernel performes about 8%
faster with that option but overall is still slower than without the option.

WITH_CYCLES_OPTIMIZED_KERNEL_SSE41 is the cmake flag for testing this kernel.

Alignment of int3, int4, float3, float4 to 16 bytes seems to give a slight 1-2%
speedup on tested systems with the current kernel already, so is enabled now.
2013-11-22 14:42:41 +01:00
Thomas Dinges
bd5da19d86 Cycles: Add a "Normal" input socket to the Layer Weight node + GLSL drawing code.
Patch by lichtwerk (Philipp Oeser).

Differential Revision: http://developer.blender.org/D28
2013-11-22 00:33:28 +01:00
c18712e868 Cycles: change __device and similar qualifiers to ccl_device in kernel code.
This to avoids build conflicts with libc++ on FreeBSD, these __ prefixed values
are reserved for compilers. I apologize to anyone who has patches or branches
and has to go through the pain of merging this change, it may be easiest to do
these same replacements in your code and then apply/merge the patch.

Ref T37477.
2013-11-18 08:48:15 +01:00
Thomas Dinges
cc7b2a0b04 Cycles / Fresnel Node:
* Add a "Normal" Input to the Fresnel node.
* Fix for the Fresnel GLSL code (normalize the Incoming vector).

Patch #37384 by Philipp Oeser (lichtwerk) , thanks!
2013-11-09 13:14:00 +00:00
Thomas Dinges
2c57e4f577 Cycles:
* Change the default Light Path settings.

* Diffuse/Glossy bounces are now set to 4, to give a bit faster renders in default scenes. More bounces are often not needed (especially in animation). 
* Transmission bounces have been increased to 12, to not run into problems with dark glass too quickly. 
* Max/Min bounces are now 12/3.
2013-11-01 09:37:42 +00:00
Campbell Barton
f9d5bccb06 code cleanup: spelling 2013-10-31 23:52:44 +00:00
Lukas Toenne
06fb71bc46 Fix #37194, OSL script crashes blender. The lookup functions for finding Cycles shader inputs/outputs based on socket names are using a few modifications on the Blender socket names. But these only apply
to standard nodes where the Blender socket names can differ from associated Cycles names and may require additional indices to make them unique. Script node sockets are already unique and exact due to
being generated from the script function parameters.
2013-10-30 11:21:31 +00:00
Brecht Van Lommel
70e9191e15 Fix #37184: film exposure + transparency not working well in cycles viewport. 2013-10-28 19:01:01 +00:00
Campbell Barton
48c1e0c0fc spelling: use American spelling for canceled 2013-10-26 01:06:19 +00:00
Campbell Barton
00160d4a1b remove unused var 2013-10-26 01:03:16 +00:00
Lukas Toenne
89fc09b3be Fix for OSL bug reported on IRC by Pablo Vasquez: Clamp option of the math node in OSL produces bad results. Really stupid bug, OSL math node was assigning the clamped 1st input value instead of the
clamped result of the actual operation.
2013-10-23 11:30:18 +00:00
Brecht Van Lommel
4ecfb215e2 Fix: ensure cycles mist pass stays in range 0..1, it could have values out of
this range due to sampling noise.

Side note: I looked into the mist pass because it was apparently not calculating
mist correctly on characters with transparent hair. Turns out this is just
sampling noise that goes away with more samples.

This noise is because the ray will randomly go to the next transparency layer or
get reflected, the path tracing integrator will not branch the path and only pick
one of the two directions each time.

Branched path tracing however will shade all transparent layers for each AA
sample, which means this source of noise is eliminated.
2013-10-18 23:44:25 +00:00
Brecht Van Lommel
451607630e Fix #37134: cycles viewport not displaying correct with multi GPU render
and graphics card that does not support CUDA OpenGL interop.
2013-10-18 20:11:07 +00:00
Sergey Sharybin
598239eb51 Make strict compiler flags happy 2013-10-18 15:30:38 +00:00
Brecht Van Lommel
5a355c2b01 Fix cycles hair segments not giving correct vector speed pass, the motion vector
export was not implemented yet for this primitive.
2013-10-18 15:03:18 +00:00
Brecht Van Lommel
2e8ab664d5 Fix cycles mesh synchronization being too slow with vector blur and duplis. 2013-10-17 16:05:57 +00:00
Thomas Dinges
0cbdac99b8 Interface:
* More compact and better looking Vertex Groups panel (Particle System).
* Smaller uiLists for Cycles as well.
2013-10-13 23:45:41 +00:00
Brecht Van Lommel
9d7567d6ac Fix #37002: cycles viewport render shows white on old graphics cards with no
support for non-power-of-two textures.
2013-10-12 13:55:52 +00:00
Thomas Dinges
c0295bd3d3 Code cleanup: Remove some more unused cycles SSS code, related to the lookup table. 2013-10-12 09:54:57 +00:00
Brecht Van Lommel
8f33609374 Code cleanup: remove some unused cycles SSS code. 2013-10-12 00:08:31 +00:00
Campbell Barton
8fd52b3433 style cleanup 2013-10-10 17:28:01 +00:00
Thomas Dinges
3d4bbd278a * Code cleanup for M_PI code. 2013-10-10 17:14:04 +00:00
Brecht Van Lommel
a200256451 Fix windows scons OSL build error, just use quotes now instead of array. 2013-10-09 20:11:18 +00:00
Brecht Van Lommel
bde4148375 Fix OSL shader build failing with spaces in the path to build directory,
patch by Campbell.
2013-10-09 18:48:32 +00:00
Thomas Dinges
e6ce07a5d4 Cycles / SSS:
* Remove the compatible falloff SSS implementation. We shouldn't support two implementations in the long term, and 2.7x is a good release number do break some compatibility as well. 

* Version patch added, so Files with Compatible falloff will automatically use Cubic now. 

It was already mentioned in the manual, that Compatible is deprecated. 
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/Shaders#BSSRDF
2013-10-08 17:07:18 +00:00
Thomas Dinges
b5a5773fa9 Cycles / CUDA:
* Remove support for  CUDA Toolkit 4.x, only Toolkit 5.0 and above are supported now.
* Remove support for sm_1x cards (< Fermi) for good. We didn't officially support those cards for a few releases already, now remove some special code that was still there.
2013-10-08 15:29:28 +00:00
Antony Riakiotakis
1beec5ba47 Add GLEW_STATIC definition for CMake as well. 2013-10-07 18:56:21 +00:00
Brecht Van Lommel
e9d03296c7 Better fix for #36935 and 36316:
* 32 bit GCC builds now have the SSE BVH optimizations turned off, but still
  compile with SSE flags for better performance.

* White color when rendering on Windows seems to have been unrelated to SSE,
  rather it was a graphics driver not supporting half float textures, added a
  check for that now.
2013-10-05 19:56:34 +00:00
Lukas Toenne
4aacb0eda9 Fix #36962, "Render emitter" option for hair is ignored in Cycles. Hair particles use the hide_tris boolean to disable rendering of the emitter, but this was still ANDed with the "experimental" flag.
Hair is not experimental any longer, so this has to be removed.
2013-10-05 12:46:32 +00:00
Brecht Van Lommel
4c5d6dcbaf Fix cycles hair render UI panel showing for particles that are not hair,
patch by Greg Zaal.
2013-10-04 18:04:29 +00:00
Brecht Van Lommel
6737a04061 Attempt to fix #36935: disable SSE optimizations on 32 bit windows too. Something
strange is going on here, but I don't think it can be fixed before the release,
if it is worth at all spending time on this.
2013-10-04 14:47:37 +00:00
Brecht Van Lommel
e308c2f166 Fix #36316: dots in cycles render on certain CPUs with 32 bit linux builds.
There is some sort of problem with the SSE2 code path, but I couldn't find
the cause, maybe a compiler bug due to the large amount of inlining? For
now I've disabled SSE2 optimizatons in 32 bit GCC builds.
2013-10-02 19:00:16 +00:00
Brecht Van Lommel
a47e6810a2 Fixes for cycles Mapping and Vector Transform node:
* Keep the Mapping node default type as Point for now, instead of Texture. The
  latter is a better default, but this is breaking API compatibility and it's
  too close to release to expect addons to be fixed in time.

* Vector Transform and Mapping nodes had properties with name "type" to set the
  type of vector, but this conflicts with the node type property, so renamed to
  vector_type now.
2013-10-02 17:02:59 +00:00
Brecht Van Lommel
cbb783f1d6 Fix cycles OpenCL compile error on AMD, and fix assert in debug builds. 2013-10-02 14:41:04 +00:00
Brecht Van Lommel
31e6181187 Fix #36873: cycles opencl render status show negative sample count. 2013-09-30 12:11:25 +00:00
Thomas Dinges
85cb0bc19d Fix [#36863] OSL clamp, min and max functions have wrong signature when arguments are integers
* This was fixed in OSL 1.3.2, but we used an outdated stdosl.h.
2013-09-29 23:24:45 +00:00
Brecht Van Lommel
fa352bb749 Fix #35684: cycles unable to use full 6GB of memory on NVidia Titan GPU. We now
use arrays instead of textures for general storage on this card (image textures
are still stored as texture). Textures were found to be faster on older cards,
but the limits on 1D texture size have not increased along with the memory size,
which meant that the full 6 GB could not be used.

The performance actually seems to be slightly better with arrays in some tests
on Titan. For older cards there seems to be a bit of a mix, some are better and
others not. We may change those to use arrays too, but more testing is needed,
only Titan and Tesla K20 (sm_35) is changed for now.

The fact that arrays are faster is a bit surprising, as others found textures
to be faster on Kepler. However even if they were, the memory limitation is
more important to solve anyway.
https://research.nvidia.com/publication/understanding-efficiency-ray-traversal-gpus-kepler-and-fermi-addendum
2013-09-27 19:09:31 +00:00
Thomas Dinges
d0a092be5c Fix [#36822], Sky Turbidity values > 10 could result in weird behavior and crashes with the new sky model.
Soft UI range is 10 already, now clamp inside the code as well.
2013-09-27 10:26:00 +00:00
Brecht Van Lommel
c3d3d8be36 Fix cycles issue with mapping node rotation and scale order. When using both
scale and rotation in mapping node, there would be shearing, and the only way
to avoid that was to add 2 mapping nodes. This is because to transform the
texture, the inverse transform needs to be done on the texture coordinate

Now the mapping node has Texture/Point/Vector/Normal types to transform the
vector for a particular purpose. Point is the existing behavior, Texture is
the new default that behaves more like you might expect.
2013-09-25 20:28:49 +00:00
Lukas Toenne
d4c67adb5a Minor cleanup for own commit, removed unused line. 2013-09-23 08:57:46 +00:00
Lukas Toenne
a18d89e14f Fix #36790, OSL point parameters of shader nodes not initialized correctly from UI inputs.
normal and point parameter types of OSL shaders are creating SOCK_VECTOR sockets in the script node. When these sockets are in turn used to define the fixed input values for these parameters they get
converted as OSL vector always, losing the distinction of vector/normal/point. To prevent OSL rejecting the value due to type mismatch, explicitly define the parameter defaults in the OSL script node
compiler function as vector, normal and point (unused types will simply be ignored).
2013-09-23 08:57:02 +00:00
Campbell Barton
e9bcb8f518 remove unused modifier argument from ParticleSystem.co_hair 2013-09-20 06:20:07 +00:00
Thomas Dinges
9a348c354a * Style cleanup / Cycles. 2013-09-19 23:54:16 +00:00
Brecht Van Lommel
e1a57e7858 Fix #36750: windows crash with empty cycles scene, can't do &references[0] with
MSVC when references is an empty vector.
2013-09-17 15:03:01 +00:00
Brecht Van Lommel
edde749850 Fix #36741: cycles AO pass giving values > 1.0 with transparency. 2013-09-17 13:22:42 +00:00
Brecht Van Lommel
66d465cbcc Fix #36731: border render not updating properly with persistent images
setting enabled in cycles.
2013-09-16 21:20:21 +00:00
Brecht Van Lommel
2228c455f9 Fix #36738: object ray visibility flags not working in cycles viewport if there
is only a single object in the scene.
2013-09-16 21:05:43 +00:00
Brecht Van Lommel
2513886f43 Fix #36725: mismatch between viewport and render result when no world is linked
to the scene in cycles.
2013-09-16 21:05:42 +00:00
Thomas Dinges
11ab2b00f1 Code cleanup / Cycles:
* Avoid some duplicated code for switch/case in the Attribute code.
2013-09-16 15:40:50 +00:00
Thomas Dinges
da5ce8cb1c Cycles / Hair:
* Hair rendering is now a supported feature, no further need to change the feature set to "Experimental".
2013-09-16 15:34:31 +00:00
Stuart Broadfoot
3306afac87 Cycles Hair: Two basic bair shaders added
A new hair bsdf node, with two closure options, is added. These closures allow the generation of the reflective and transmission components of hair. The node allows control of the highlight colour, roughness and angular shift.

Llimitations include:
-No glint or fresnel adjustments.
-The 'offset' is un-used when triangle primitives are used.
2013-09-15 23:58:00 +00:00
Brecht Van Lommel
5d54678477 Fix #36719: UV pass not rendering in second render layer if first render layer
does not have the UV pass enabled as well.
2013-09-13 14:31:28 +00:00
Thomas Dinges
e2171d7408 * Fix #36717, don't grey out AO distance property, as it affects the AO Render Pass and AO closure as well. 2013-09-13 10:26:20 +00:00
Brecht Van Lommel
ac78c4a634 Fix cycles too slow export of meshes with uvs when a motion vector pass is used. 2013-09-10 15:12:53 +00:00
Brecht Van Lommel
04316efc4a Cycles OSL: update to build with latest OSL master branch. 2013-09-09 21:52:26 +00:00
Brecht Van Lommel
6c5df7567b Fix OpenCL build error. 2013-09-09 12:15:16 +00:00
Thomas Dinges
5a6bcd1d42 Cycles:
* Refactor PathState struct and functions into its own file.
2013-09-08 18:59:39 +00:00
Thomas Dinges
3b9edee711 Cycles:
* Fix some compile errors, when building without Branched Path.
2013-09-08 17:20:47 +00:00
Thomas Dinges
da2c76d9f7 Code cleanup / Cycles:
* Some cleanup for disabled Volume code.
2013-09-06 16:07:49 +00:00
Campbell Barton
f6b37f34ec code cleanup:
- add missing headers from cmake (own omission)
- quiet rna_test.c unused define warnings.
- minor style edits
- spelling corrections and ignore all uppercase words with spell checking script.
2013-09-05 19:56:49 +00:00
Thomas Dinges
cb19d9fa35 Code cleanup / Cycles:
* Removed unused member of the device_memory template.
2013-09-04 16:24:58 +00:00
Thomas Dinges
65f21d9b43 Code cleanup / Cycles:
* Avoid special code, when Subsurface is enabled.
Ideally we should only use the function, and get rid of the extra duplicate, but this is slower on CUDA.
2013-09-04 16:11:21 +00:00
Thomas Dinges
37e91d8965 Compile fix / Cycles:
* 'T' is now also used for the Subsurface closure.
2013-09-04 13:37:35 +00:00
Brecht Van Lommel
efe7793152 Fix cycles CUDA/OpenCL build error after recent change. 2013-09-04 01:04:14 +00:00
Brecht Van Lommel
60e5abe71f Fix a few issues reported by coverity scan. 2013-09-03 22:39:21 +00:00
Brecht Van Lommel
b314209356 Cycles: add a sharpness input to the Cubic SSS falloff. When set to 1 this will
give a result more similar to the Compatible falloff option. The scale is x2
though to keep the perceived scatter radius roughly the same while changing the
sharpness. Difference with compatible will be mainly on non-flat geometry.
2013-09-03 22:39:17 +00:00
Thomas Dinges
dace5b9b84 Cycles:
* Document the members of the Ray struct.
2013-09-02 15:43:28 +00:00
Sergey Sharybin
35b61a7512 Move GCC attributes into a centraized defines
Instead of having ifdef __GNUC__ all over the headers
to use special compiler's hints use a special file where
all things like this are concentrated.

Makes code easier to follow and allows to manage special
attributes in more efficient way.

Thanks Campbell for review!
2013-09-01 15:01:15 +00:00
Brecht Van Lommel
f3252c261d Fix #36620: sss + indirect light rendering artifacts, due to wrong correlation in
the random numbers.
2013-09-01 14:10:40 +00:00
Thomas Dinges
ce326e20c8 Cycles:
* World background samples (Branched Path) were missing after integrator rename.
2013-08-31 16:36:54 +00:00
Thomas Dinges
f4f4dac523 Cleanup:
* Silence /arch:SSE2 warning on msvc x64.
2013-08-31 03:18:55 +00:00
Thomas Dinges
8f699dbd5e Cycles:
* More build fixes, 2 link errors remain. http://www.pasteall.org/45279

Note: Probably those paths should only be added for Windows and Linux, as "OPENIMAGEIO_LIBPATH" already inherit them for Mac OS. Also "OPENIMAGEIO_LIBRARIES" inherits the libs for Linux already. Is that intended or a lack of consistency?
2013-08-31 02:56:03 +00:00
Thomas Dinges
615894323a Cycles / Standalone:
* Fix some link errors on Windows, still missing png, zlib, jpeg and tiff.

I couldn't yet figure out the correct flags to pass on here, and the 2300 lines huge main CMakeLists file doesn't help with it...
2013-08-31 02:25:43 +00:00
Brecht Van Lommel
29f6616d60 Cycles: viewport render now takes scene color management settings into account,
except for curves, that's still missing from the OpenColorIO GLSL shader.

The pixels are stored in a half float texture, converterd from full float with
native GPU instructions and SIMD on the CPU, so it should be pretty quick.
Using a GLSL shader is useful for GPU render because it avoids a copy through
CPU memory.
2013-08-30 23:49:38 +00:00
Brecht Van Lommel
6785874e7a Fix #36137: cycles render not using all GPU's when the number of GPU's is larger
than the number of CPU threads
2013-08-30 23:09:22 +00:00
Campbell Barton
427317d8d8 use CMAKE_DL_LIBS rather then linking libdl directly.
added to cycles standalone too.
2013-08-30 20:26:57 +00:00
Thomas Dinges
499bec2a85 Fix for [#36610] The new sky model produces strange results
* Clamp theta sky coordinates, to prevent a negative solarElevation. 

Note: This means that you cannot get absolute night with the new model, but this is not supported anyway. So when you reach the maximum sunset, use the World Strength to further decrease the light.
2013-08-30 18:04:23 +00:00
Thomas Dinges
a51f8e4353 Cycles / Standalone:
* Standalone can now be compiled without the GUI, making the glut dependency optional. 

Added WITH_CYCLES_STANDALONE_GUI cmake flag.
2013-08-30 17:34:27 +00:00
Brecht Van Lommel
0933c6093e Fix #36611: cycles issue loading png file with 2 channels. 2013-08-30 17:01:44 +00:00
Campbell Barton
e8605f9df9 quiet compiler warnings 2013-08-30 16:52:54 +00:00
Thomas Dinges
0502fc0112 Cycles Standalone:
* Fix compiler warning, == / = mismatch.
2013-08-30 16:39:39 +00:00
Brecht Van Lommel
978080707c Fix part of #36594: 16 bit tiff not loading with correct color space in cycles. 2013-08-29 20:53:20 +00:00
Sergey Sharybin
034d5a9578 Use static odifier for non-public functions in new sky model. 2013-08-29 12:36:02 +00:00
Brecht Van Lommel
841fe45df9 Cycles: change Gaussian subsurface scattering falloff to be more similar to
the Cubic falloff, see here for details.
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/Shaders#Subsurface_Scattering
2013-08-28 19:22:46 +00:00
Thomas Dinges
7ba41a3c7c Cycles / OpenCL:
* Some fixes for OpenCL, was broken after recent changes.
2013-08-28 14:36:47 +00:00
Thomas Dinges
d539bd4672 Cycles / Sky Texture:
* Added a new sky model by Hosek and Wilkie: "An Analytic Model for Full Spectral Sky-Dome Radiance" http://cgg.mff.cuni.cz/projects/SkylightModelling/ 

Example render:
http://archive.dingto.org/2013/blender/code/new_sky_model.png
Documentation:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/Textures#Sky_Texture

Details:
* User can choose between the older Preetham and the new Hosek / Wilkie model via a dropdown. For older files, backwards compatibility is preserved. When we add a new Sky texture, it defaults to the new model though. 
* For the new model, you can specify the ground albedo (see documentation for details). 
* Turbidity now has a UI soft range between 1 and 10, higher values (up to 30) are still possible, but can result in weird colors or black. 
* Removed the limitation of 1 sky texture per SVM stack. (Patch by Lukas Tönne, thanks!)

Thanks to Brecht for code review and some help! 

This is part of my GSoC 2013 project, SVN merge of r59214, r59220, r59251 and r59601.
2013-08-28 14:11:28 +00:00
Thomas Dinges
ff4e018753 Cycles / Standalone:
* Rename test to standalone.

Note: New CMAKE flag is WITH_CYCLES_STANDALONE.
2013-08-27 02:37:48 +00:00
Brecht Van Lommel
60ca0558c0 Fix issue in last subsurface commit with branched path tracing, was rendering too bright. 2013-08-24 15:36:14 +00:00
Brecht Van Lommel
722d0d92ad Cycles: reduce noise using regular path tracing + subsurface scattering with
new cubic and gaussian falloff. Like the branched path tracer, this will now
shade all intersection points instead of using one at random.
2013-08-24 15:02:08 +00:00
Campbell Barton
b97334f992 add GPL header to treehash.c and add missing includes to cmake. 2013-08-24 03:17:28 +00:00
Thomas Dinges
8b20dfe60e Cycles:
* Fix Cycles using wrong AA sample values, after integrator renaming.
2013-08-24 00:27:20 +00:00
Brecht Van Lommel
e25ad0778f Fix #36545: crash with branched path tracing, correlated multi-jittered
sampling and subsurface scattering.
2013-08-23 23:04:50 +00:00
Bastien Montagne
5b83a89c81 Followup to r59434 : py UI scripts edits.
Notes:
* Made those edits by full checking of py files, so I should have spoted most needed edits, yet it remains quite probable I missed a few ones, we'll fix if/when someone notice it...
* Also made some cleanup "on the road"!
2013-08-23 20:41:21 +00:00
Brecht Van Lommel
01e22d1b9f Cycles: more code refactoring to rename things internally as well. Also change
property name back so we keep compatibility.
2013-08-23 14:34:34 +00:00
Brecht Van Lommel
22f4874877 Cycles: change Progressive sampling option in UI to an enum of "Path Tracing"
and "Branched Path Tracing", to try to make it more clear that this is not
related to progressive refinement, non-progressive was always a bad name anyway.
2013-08-23 14:08:40 +00:00
Brecht Van Lommel
805cca3903 Fix clang compile warning. 2013-08-23 14:08:39 +00:00
Thomas Dinges
f560d25666 Code cleanup / Cycles:
* Some style tweaks for hair code.
2013-08-23 12:19:35 +00:00
Thomas Dinges
e203c4c390 Cycles / Sampling UI:
* Do not show Total Samples print for Progressive, when Square Samples are disabled. In this case it's obvious even without the print. :)
2013-08-23 11:39:48 +00:00
Campbell Barton
e8dced9074 style cleanup: pep8 2013-08-23 04:04:46 +00:00
Thomas Dinges
fc9d4bdf73 Cycles / Sampling UI:
* Add a "Total Samples" info at the bottom of the panel.
This makes understanding the Non-Progressive integrator easier, as it displays how many samples are used for the different ray types. 

* Rename Squared Samples to Square samples, to indicate that the action is not already done. The new Total Samples info should make this easier to understand now as well. Also added back for Progressive integrator, for consistency. 

Screenshot:
http://www.pasteall.org/pic/show.php?id=57980
2013-08-22 19:57:56 +00:00
Brecht Van Lommel
0b42f14079 Fix #36526: SSS + hair crash after recent changes. 2013-08-21 12:20:38 +00:00
Brecht Van Lommel
5d97c93c08 Fix compiler warning due to undefined BVH_FUNCTION_FEATURES with patch by Campbell,
and a coverity warning about use of uninitialized variables with OSL.
2013-08-20 18:25:59 +00:00
Thomas Dinges
605f7f4b9f Code cleanup / Cycles:
* Remove unused hair presets enum.
2013-08-20 11:22:26 +00:00
Campbell Barton
f3654ce6b6 fix incorrect docs [#36518] Vector.rotate() does not return value as documented 2013-08-20 08:41:34 +00:00
Bastien Montagne
c79e175d9b Fix [#36454] 'Tiles' settings in Render/Performance panel don't respect keyframes
These are not animatable! Note this is the case of most (all?) render settings, maybe we should go over both Cycles and internal ones, there are still quite a bunch of them that are marked as animatable... :/
2013-08-19 13:30:17 +00:00
Thomas Dinges
676b019846 Cycles:
* Fix 16 byte alignment for constant hair kernel data.
2013-08-18 22:25:37 +00:00
Thomas Dinges
8080c10c32 Cycles / SSS:
* OSL rendered Black with Compatible Fallof option, fixed. 

Note: OSL uses compatible scattering when "Compatible" or "Bicubic" is selected. I guess compatible will be removed later? If not we need to fix this properly.
2013-08-18 20:49:58 +00:00
Stuart Broadfoot
a71f84606a Fix compile of last commit 2013-08-18 15:09:51 +00:00
Brecht Van Lommel
b9ce231060 Cycles: relicense GNU GPL source code to Apache version 2.0.
More information in this post:
http://code.blender.org/

Thanks to all contributes for giving their permission!
2013-08-18 14:16:15 +00:00
Brecht Van Lommel
d43682d51b Cycles: Subsurface Scattering
New features:

* Bump mapping now works with SSS
* Texture Blur factor for SSS, see the documentation for details:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/Shaders#Subsurface_Scattering

Work in progress for feedback:

Initial implementation of the "BSSRDF Importance Sampling" paper, which uses
a different importance sampling method. It gives better quality results in
many ways, with the availability of both Cubic and Gaussian falloff functions,
but also tends to be more noisy when using the progressive integrator and does
not give great results with some geometry. It works quite well for the
non-progressive integrator and is often less noisy there.

This code may still change a lot, so unless you're testing it may be best to
stick to the Compatible falloff function.

Skin test render and file that takes advantage of the gaussian falloff:
http://www.pasteall.org/pic/show.php?id=57661
http://www.pasteall.org/pic/show.php?id=57662
http://www.pasteall.org/blend/23501
2013-08-18 14:15:57 +00:00
Stuart Broadfoot
2fd11a6617 Updates for the Cycle Hair UI. With the following changes
- Removed the cycles subdivision and interpolation of hairkeys.
- Removed the parent settings.
- Removed all of the advanced settings and presets.
- This simplifies the UI to a few settings for the primitive type and a shape mode.
2013-08-18 13:41:53 +00:00
Thomas Dinges
8b955e9b19 Cycles / Sky Model:
* Replaced the Preetham model with the newer Hosek / Wilkie model:
"An Analytic Model for Full Spectral Sky-Dome Radiance" http://cgg.mff.cuni.cz/projects/SkylightModelling/ 

* We use the sample code data, which comes with the paper, but removed some unnecessary parts, we only need the xyz version.
* New "Albedo" UI paraemeter, to control the ground albedo (between 0 and 1). 
* Works with SVM only atm (CPU and CUDA). 

Example render:
http://www.pasteall.org/pic/show.php?id=57635

ToDo / Open Questions:
* OSL still uses the old model, will be done later. In the meantime it's useful to compare the two models this way.
* The new model needs a much weaker Strength value (0.01), otherwise it's white. Can this be fixed? 
* Code cleanup.
2013-08-17 16:08:03 +00:00
Thomas Dinges
0786eebd11 Merged revision(s) 59108-59184 from trunk/blender into soc-2013-dingto. 2013-08-16 12:50:13 +00:00
Thomas Dinges
9591957c8a Cycles / Motion Blur:
* Added a new panel "Settings" to the object tab.
* Motion blur can now be enabled/disabled on a per object basis, so we can disable motion blur for certain objects.
* Also added some code for the Motion Multiplier, to weaken/strengthen the motion effect per object, but that is still disabled and hidden from the UI.
2013-08-16 12:18:01 +00:00
Thomas Dinges
2c2206a272 Cycles:
* Remove an unneeded return in shader_bsdf_eval(), function is void. 
* if / else if tweak in shader_bsdf_ao().
2013-08-14 19:38:14 +00:00
Campbell Barton
2f5e10f7b8 include order change for osl, fixes gcc compile error - undefined uintptr_t 2013-08-14 06:51:18 +00:00
Thomas Dinges
ace1dbf77f Merged revision(s) 59035-59107 from trunk/blender into soc-2013-dingto.
Skipping 59034 (Non-Progressive on GPU).
2013-08-13 09:15:03 +00:00
Thomas Dinges
8cda3264bd Code cleanup:
* Some typo fixes.
2013-08-13 08:43:31 +00:00
Lukas Toenne
795fa1f199 Fix #36437 Cycles no longer rendering Emitter object (Particle Systems). The change r58999 was ignoring the "show_emitter" setting by particles (the result would be the same as long as hair was not
used). If particle emitters are forced to show all other of the usual duplicator hiding should be disabled.
2013-08-12 06:53:17 +00:00
Thomas Dinges
9dfd2823c4 Code cleanup / Cycles:
* Remove unused "PathThroughput" variable.
* Don't compile unused voronoi code, we only use Distance Squared atm. 
* Various typo and comment fixes.
2013-08-11 16:55:24 +00:00
Thomas Dinges
48ae40ccdf Code cleanup / Cycles:
* Rename "curve_kernel_data" to just "curve", to avoid redundant naming.
2013-08-11 15:27:04 +00:00
Thomas Dinges
30f279be26 Code cleanup / Cycles:
* Remove code for the unused Wave texture variations. 

We have quite some unused code in the texture area, I guess it doesn't harm to clean a bit up here. 
We can always get the code back from SVN if we need something.
2013-08-10 00:52:57 +00:00
Thomas Dinges
743a7a4a4b Cycles:
* GPU kernel can now be compiled without __NON_PROGRESSIVE__ again, was broken after my last commit. Also add a check for have_error(), in case the GPU kernel comes without Non-Progressive, to avoid a crash.

* Don't compile progressive kernel twice on CPU, if __NON_PROGRESSIVE__ would be disabled there.
2013-08-09 20:03:49 +00:00
Brecht Van Lommel
be7b4e26b1 Fix cycles not rendering with 1x1 resolution anymore, not so common for users
but nice for debugging.
2013-08-09 19:55:46 +00:00
Brecht Van Lommel
fd263bf725 Fix cycles passes UI panel to line up better. 2013-08-09 19:55:45 +00:00
Thomas Dinges
a18112249d Cycles / Non-Progressive integrator:
* Non-Progressive integrator is now available on the GPU (CUDA, sm_20 and above). 

Implementation details:
* kernel_path_trace() has been split up into two functions:
kernel_path_trace_non_progressive() and kernel_path_trace_progressive().

* We compile two CUDA kernel entry functions (in kernel.cu) for the two integrators, they are still inside one .cubin file but due to the kernel separation there should be no performance problem. I tested with the BMW file on my Geforce 540M and the render times were the same for 100 samples (1.57 min in my case).

This is part of my GSoC project, SVN merge of r59032 + manual merge of UI changes for this from my branch.
2013-08-09 18:47:25 +00:00
Thomas Dinges
e924df98cb Merged revision(s) 58994-59032 from trunk/blender into soc-2013-dingto. 2013-08-09 17:30:21 +00:00
Thomas Dinges
17494b9fe8 Cycles / Non-Progressive integrator:
* Code refactor to split the GPU kernel into two, one for each integrator.
This way we can enable Non-Progressive integrator on GPU in trunk without a performance drop.

Thanks to Brecht for some help and review!
2013-08-09 17:23:54 +00:00
Brecht Van Lommel
9d9c64582b Fix #36355: cycles render of objects with both duplis and hair would not render
the hair in some cases.
2013-08-07 19:02:15 +00:00
Thomas Dinges
e4f9cc32ec Merged revision(s) 58859-58993 from trunk/blender into soc-2013-dingto. 2013-08-07 16:57:18 +00:00
Thomas Dinges
da4679f6d8 * Make MSVC happy. 2013-08-06 23:47:47 +00:00
Campbell Barton
d58a385084 minor edits to float/double conversion suggested by DingTo 2013-08-06 23:34:47 +00:00
Campbell Barton
34c64b8ea3 cycles builds with -Wdouble-promotion again. 2013-08-06 06:36:34 +00:00
Brecht Van Lommel
d01fbce3bb Fix #36380: cycles render error with sun lamp that has object scale 0,0,0. 2013-08-05 14:22:07 +00:00
Brecht Van Lommel
3bf175f270 Cycles OSL: image texture lookup optimization, acquire the per thread handle
for texture system in advance. Patch by Martijn Berger, with some tweaks.

There was about a 10% performance improvement on OS X in my tests with the
images.blend test file. This may be less on other platforms because OS X has
particularly slow mutex locks.
2013-08-05 12:49:15 +00:00
Brecht Van Lommel
28f893f23a Fix wrong cycles cmake + msvc build flags with relwithdebinfo and minsizerel.
Patch by Karsten Schwenk.
2013-08-05 12:02:43 +00:00
Thomas Dinges
d06fa3ba2b Code cleanup / Cycles:
* Various string and comment fixes.
2013-08-05 01:24:41 +00:00
Thomas Dinges
c26754fe9d Cycles / OpenCL:
* Was broken after Blackbody merge, forgot to rename a struct...
2013-08-04 12:40:46 +00:00
Thomas Dinges
02ec0b9431 Cycles:
* Forgot to rename some SSS pass strings.
* Some typo fixes.
2013-08-03 21:45:57 +00:00
Thomas Dinges
5fc6f04fc8 Cycles / SSS:
* Render Passes are now available for Subsurface Scattering (Direct, Indirect and Color pass). 

This is part of my GSoC project, SVN merge of r58587, r58828 and r58835.
2013-08-03 13:12:09 +00:00
Thomas Dinges
b84858778c Merged revision(s) 58785-58855 from trunk/blender into soc-2013-dingto. 2013-08-03 12:49:08 +00:00
Thomas Dinges
745ec9766e Cycles / SSS Render Passes:
* Finished the implementation, Direct and Indirect Passes work now. 

Patch by Brecht and myself.
2013-08-02 19:57:14 +00:00
Thomas Dinges
702bf77b34 Cycles / Squared Samples:
* After some feedback decided to remove this option from the Progressive integrator, it only makes sense for Non-Progressive where we have different values for the sample types.
2013-07-31 22:51:48 +00:00
Thomas Dinges
0d9364463f Merged revision(s) 58779, 58783-58784 from trunk/blender into soc-2013-dingto. 2013-07-31 21:49:10 +00:00
Thomas Dinges
e48acb7dec Code cleanup, use bools here. Forgot to change that. 2013-07-31 21:40:52 +00:00
Thomas Dinges
2a2f0319bc Cycles / HSV Separator and Combine node:
* Added nodes to separate and combine hsv colors.

Part of my GSoC 2013 project, SVN merge of r57981.
2013-07-31 21:27:48 +00:00
Thomas Dinges
34009da32e Cycles / Vector Transform node:
* Add a note to convert a Vector, Point or Normal between World <=> Camera <=> Object coordinate space. 

Documentation: http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/More#Vector_Transform

Part of my GSoC 2013 project, SVN merge of r57599, r57670, r57918, r57919, r58245 and r58775.
2013-07-31 21:18:23 +00:00
Thomas Dinges
6d9720ef63 Cycles / Blackbody to RGB node:
* Added a node to convert a temperature in Kelvin to an RGB color. This can be used e.g. for lights, to easily find the right color temperature. 
= Some common temperatures =
Candle light: 1500 Kelvin
Sunset/Sunrise: 1850 Kelvin
Studio lamps: 3200 Kelvin
Horizon daylight: 5000 Kelvin

Documentation: http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/More#Blackbody

Thanks to Philipp Oeser (lichtwerk), who essentially contributed to this with a patch! :)

This is part of my GSoC 2013 project. SVN merge of r57424, r57487, r57507, r57525, r58253 and r58774
2013-07-31 20:56:32 +00:00
Thomas Dinges
3840e0b234 Cycles / Ray Depth:
* Added a Ray Depth output to the Light Path node, which gives the user access to the current bounce.
This can be used to limit the maximum ray bounce on a per shader basis. Another use case is to restrict light influence with this, to have a lamp only contribute to the direct lighting. 

http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/More#Light_Path

This is part of my GSoC 2013 project. SVN merge of r58091 and r58772 from soc-2013-dingto.
2013-07-31 20:30:37 +00:00
Thomas Dinges
2a25acb108 Cycles / Vector Transform node:
* Code cleanup to avoid duplicated enum code.
* Added a third type for conversion next to Point and Vector: Normal. This is basically the same result as with the Vector type, but normalizes the vector at the end. 

Thanks to Brecht for code review!
2013-07-31 20:05:13 +00:00
Thomas Dinges
b6024a0e75 Cycles / Blackbody Node:
* Some optimizations to avoid divisions on runtime, avoid possible division by zero and code cleanup. 

Thanks to Brecht for code review!
2013-07-31 19:03:42 +00:00
Thomas Dinges
380ee3d30a Cycles / Non-Progressive integrator:
* Code cleanup, to avoid separate code for CPU and GPU.
2013-07-31 18:46:11 +00:00
Thomas Dinges
6a902d1a81 Cycles / Ray Depth:
* Fix some things which came up in code review. Includes some fixes for background lights and changes to variables, to avoid some castings.

Thanks to Brecht for code review! :)
2013-07-31 18:40:11 +00:00
Thomas Dinges
a3e34e5fbc Merged revision(s) 58682-58770 from trunk/blender into soc-2013-dingto. 2013-07-31 18:14:18 +00:00
Thomas Dinges
3d57740a38 Cycles / Non-Progressive integrator:
* Avoid check for !LABEL_TRANSPARENT in "kernel_path_non_progressive_lighting", transparency is either handled in the outer loop or in the "kernel_path_indirect" function, but not here.
2013-07-30 12:56:39 +00:00
Thomas Dinges
5ce3588c6c Cycles:
* Increase the maximum amount of closures per shader from 16 to 64, so more complex closure trees can be rendered.

I measured performance on CPU and GPU (Geforce 540M) and couldn't find a performance impact, but if someone encounters a noticeable impact on his system, please report.
2013-07-30 09:26:45 +00:00
Brecht Van Lommel
c0875290bc Fix #36290: cycles generated texture coordinates were not sticking to the
surface again, got lost in an unrelated optimization.
2013-07-29 19:39:23 +00:00
Brecht Van Lommel
6135a7adc8 Fix #36235: cycles crash deactivating render layer during rendering. 2013-07-29 15:32:24 +00:00
Thomas Dinges
ac80b9d198 Cycles / SSS Render Passes:
* First step toward Subsurface Scattering render passes (Color, Direct and Indirect).
* Added UI, DNA and RNA for the new Passes on the Blender side.
* Basic Cycles integration. 
* Only the SSS Color Pass works so far. 

ToDo: Direct and Indirect Pass.
Should "subsurface" be a part of BsdfEval and "path_subsurface" of PathRadiance or is that the wrong way? Should it be integrated more like the AO render pass? Some input from Brecht or Stuart would be nice. :)
2013-07-24 23:47:02 +00:00
Thomas Dinges
45227e25fe Merged revision(s) 58452-58584 from trunk/blender into soc-2013-dingto. 2013-07-24 21:56:06 +00:00
Thomas Dinges
965e0aeb59 Cycles / CMJ:
* path_rng_2D() was missing an else branch for the sobol case after fix in r57383.
2013-07-23 16:23:30 +00:00
Campbell Barton
b8c3efc8c3 code cleanup: compiler warnings 2013-07-21 16:40:34 +00:00
Thomas Dinges
636b314677 Code cleanup / Cycles:
* Remove useless else branch, after recent changes.
2013-07-21 10:30:22 +00:00
Thomas Dinges
19b5fc17dc Merged revision(s) 58424-58448 from trunk/blender into soc-2013-dingto
Had to resolve manual conflict in addon/ui.py and blender/blender_sync.cpp due to Non-Progressive integrator, which is enabled in my branch.
2013-07-20 15:46:49 +00:00
Thomas Dinges
715855d0b9 Merged revision(s) 58356-58423 from trunk/blender into soc-2013-dingto.
Note: Keep own splash.
2013-07-20 15:34:19 +00:00
Thomas Dinges
9732c6283e Cycles / CPU Rendering:
* "Auto Detect" now again uses the umber of cores, instead number of cores + 1.

This was added before we had Tile rendering and benchmarks on several systems showed that there is no gain with this now. There might be some slight difference (0.5% or so) slower/faster depending on the scene, but this is negligible.
2013-07-20 00:40:03 +00:00
Thomas Dinges
ac1d58d962 Cycles / Sampling Presets:
* Add Presets for Sampling. This comes with a simple Preview and Final preset, but as this is varying a lot depending on the scene, they should just be a starting point. The user can add own presets here.

* Some UI layout changes to match the settings a bit better.
2013-07-19 23:59:40 +00:00
Thomas Dinges
51a3371d87 Code cleanup / Cycles:
* Use USHRT_MAX rather than manual value, suggested by Campbell.
2013-07-19 22:56:54 +00:00
Thomas Dinges
d336ae8992 Cycles / Sampling UI:
* Add a "Squared Samples" option to the UI, to use squared values for ease of use. This can make it easier from an artist point of view, to weak settings. 

With this enabled, all Sample values will be squared. So 10 Samples become 100 Samples.
For the Non-Progressive integrator: 4 AA Samples * 5 Diffuse Samples would become 16 AA Samples * 25 Diffuse = 400 in total.

Patch by Matt Heimlich, with some minor edits by myself. Thanks!
2013-07-19 22:51:48 +00:00
Thomas Dinges
fd1d4151f1 Fix for [#36216] Viewport render with CMJ sampler and unlimited passes freezes
* If Preview Samples are set to 0 (unlimited) it now assumes 65536 instead of INT_MAX. 

This doesn't affect regular sampling, you can still enter fixed values of 100k or whatever.
2013-07-19 14:00:53 +00:00
Thomas Dinges
c04575b974 Merged revision(s) 58241-58355 from trunk/blender into soc-2013-dingto. 2013-07-17 21:43:38 +00:00
Thomas Dinges
271ffb43e5 * Fix a typo in code. 2013-07-17 21:25:44 +00:00
Thomas Dinges
17b1840a06 Cycles / Blackbody node:
* Fix the weird results with 800-804.3 Kelvin in SVM. This was an offset issue with the lookup table, made the table slightly larger now (from 954 to 956) which gives a small gap between the R/G/B components. 
* Use Luminance also for values below 800 Kelvin, for consistency.
2013-07-15 04:38:35 +00:00
Thomas Dinges
b39a84e9aa Cycles / Vector Transform node:
* Code cleanup, to avoid case-sensitive checks for OSL.
2013-07-14 22:02:40 +00:00
Thomas Dinges
11fe01b0da Merged revision(s) 58226-58240 from trunk/blender into soc-2013-dingto. 2013-07-14 16:54:20 +00:00
Brecht Van Lommel
08dc76b1ec Fix a few issues found by coverity code scan in cycles code, nothing that caused
an actual bug as far as I can tell.
2013-07-14 13:19:57 +00:00
Brecht Van Lommel
cad3406c81 Fix some unnecessary memory allocation slowness in cycles mesh export. 2013-07-14 12:51:41 +00:00
Thomas Dinges
12a45c8b1b Merged revision(s) 58093-58225 from trunk/blender into soc-2013-dingto. 2013-07-13 23:52:43 +00:00
Thomas Dinges
17ee2732f4 UI / Cycles:
* Make it more clear for the user what affects 3D View and Final render.
* Static / Dynamic BVH only affects viewport, BVH Cache only final. (see BlenderSync::get_scene_params)
2013-07-12 00:08:55 +00:00
Brecht Van Lommel
e64937c96d Fix #36091: external render engines like Luxrender don't work well with the save
buffers option, it requires specific tile sizes and if they don't match what
OpenEXR expects file saving can get stuck.

Now I've made support for his optional, with a bl_use_save_buffers property for
RenderEngine, set to False by default.
2013-07-11 12:22:29 +00:00
Brecht Van Lommel
3a89f98a24 Fix #36053: slow GPU render with panorama camera + depth of field. 2013-07-10 17:25:52 +00:00
Brecht Van Lommel
9460d9f344 Fix #36080: fix cycles crash with certain group node setups, accessing freed
memory.
2013-07-10 10:50:19 +00:00
Thomas Dinges
0b4244d1df Merged revision(s) 58059-58092 from trunk/blender into soc-2013-dingto. 2013-07-09 00:58:25 +00:00
Thomas Dinges
c4fa047894 Cycles / Ray Depth:
* Added a Ray Depth output to the Light Path node, which returns the current ray bounce (0, 1, 2, 3...)
* This can be used to use different shaders for direct and indirect lighting and artificial effects.

Examples:
* http://www.pasteall.org/pic/show.php?id=55158 Here we use the output to apply a different shader to the third bounce. As in this example, you can use Math Nodes (Greater Than / Less Than) if you want to use values outside of the 0/1 range.

* http://www.pasteall.org/pic/show.php?id=55159 Here we restrict the maximum bounce on a per shader basis for the left sphere. This way it looks like we would only have 1 max bounce set in the scene "Light paths" panel. 
This can be used to e.g. improve performance for objects far from the camera, which do not need full GI. 

Technical notes:
* Implemented for both integrators and SVM/OSL.
* This is done by passing state.bounce to the shader_setup_from_* functions.
* Note: We don't pass state.bounce to kernel_shader_evaluate() and therefore shader_setup_from_displacement() method doesn't set the value, this is outside the path trace loop. Maybe a ToDo?
2013-07-09 00:18:13 +00:00
Brecht Van Lommel
3d847ed6e6 Fix #36064: cycles direct/indirect light passes with materials that have zero
RGB color components gave non-grey results when you might no expect it.

What happens is that some of the color channels are zero in the direct light
pass because their channel is zero in the color pass. The direct light pass is
defined as lighting divided by the color pass, and we can't divide by zero. We
do a division after all samples are added together to ensure that multiplication
in the compositor gives the exact combined pass even with antialiasing, DoF, ..

Found a simple tweak here, instead of setting such channels to zero it will set
it to the average of other non-zero color channels, which makes the results look
like the expected grey.
2013-07-08 23:31:45 +00:00
Brecht Van Lommel
a2553444fa Fix #35969: blender internal and cycles not updating mesh while in edit mode.
Patch for blender internal made by Campbell.
2013-07-08 22:41:14 +00:00
Sergey Sharybin
7d2030d233 Arrempt to fix Cycles compilation with Clang
Issue is caused by missing sse flags for Clang compilers,
this flags only was set for GNU C compilers.

Added if branch for Clang now, which contains the same
flags apart from -mfpmath=sse, This is because Clang was
claiming it's unused argument.

Probably OSX would need some further checks since it's
also using Clang. I've got no idea why it could have
worked for OSX before..
2013-07-07 18:29:57 +00:00
Thomas Dinges
0b5b82bb53 Merged revision(s) 57979-58058 from trunk/blender into soc-2013-dingto 2013-07-07 14:23:20 +00:00
Brecht Van Lommel
e75064bd34 Fix #36037: cycles from dupli generated texture coordinates were wrong, should
have been normalized to 0..1 range.
2013-07-07 10:39:56 +00:00
Thomas Dinges
285ef99931 Cycles:
* Added 2 new nodes to combine and separate HSV colors. 

Screenshot:
http://www.pasteall.org/pic/show.php?id=54828
2013-07-03 23:46:56 +00:00
Thomas Dinges
e7fc69bdfd Merged revision(s) 57908-57978 from trunk/blender into soc-2013-dingto. 2013-07-03 22:12:42 +00:00
Brecht Van Lommel
65cbcde831 Fix cycles world ray visibility not working correct with multiple importance
sampling.
2013-07-02 21:03:16 +00:00
Thomas Dinges
3a6e382d4a Cycles / Vector Transform Node:
* After some more thinking, solved the remaining ToDos. :) 
* Added is_object check to check if we have a valid object.
* If we operate on the world, and try to convert from/to object space, we now assume world space instead, same as OSL.
2013-07-01 23:17:24 +00:00
Thomas Dinges
7f1005cd6a Cycles / Vector Transform Node:
* Implementation of the node for SVM. This covers all possible transformations: World <> Object <> Camera space.
As far as I can tell, it also works fine with Motion Blur enabled.

ToDo:
* SVM differs from OSL, when the node is used on the world.
2013-07-01 22:56:56 +00:00
Thomas Dinges
8c9769c18d Cycles UI script:
* Fix a merge error, device_type was not defined anymore after Non-Progressive integrator changes for GPU.
2013-07-01 21:30:45 +00:00
Thomas Dinges
465a7195b4 Merged revision(s) 57828-57907 from trunk/blender into soc-2013-dingto 2013-07-01 15:23:48 +00:00
Brecht Van Lommel
54b1976958 Fix #35896: cycles crash with OSL image textures and viewport + preview render
running at the same time.
2013-06-28 13:05:21 +00:00
Thomas Dinges
4a113cab0a Merged revision(s) 57768-57827 from trunk/blender into soc-2013-dingto 2013-06-27 16:16:54 +00:00
Thomas Dinges
c15b13f78f Cycles / Ramp closures:
* Fix crash with negative values in Phong Ramp, and add some checks to survive INF and NAN values. 

Patch by Brecht and myself.
2013-06-27 16:08:06 +00:00
Thomas Dinges
c6ce8de20e Code cleanup / Cycles:
* Some cleanup for castings.
2013-06-27 15:48:16 +00:00
Campbell Barton
603258d763 fix for zero length normalize before scanfill for meshes and other minor changes. 2013-06-27 04:32:44 +00:00
Thomas Dinges
29a82a04fa Cycles:
* Assure SSE2 intrinsics are also used on SSE3 CPUs and x86.
2013-06-27 00:03:48 +00:00
Brecht Van Lommel
7902fa57b6 Code cleanup: cycles
* Reshuffle SSE #ifdefs to try to avoid compilation errors enabling SSE on 32 bit.
* Remove CUDA kernel launch size exception on Mac, is not needed.
* Make OSL file compilation quiet like c/cpp files.
2013-06-26 23:29:33 +00:00
Thomas Dinges
372c4f80f4 * Comment out change from r57790 to fix compilation for now. 2013-06-26 23:15:52 +00:00
Thomas Dinges
ce06d6d795 Cycles / Brick texture:
* Avoid some unneeded int castings, they were only needed in the original Texture Nodes implementation as custom1 and custom2 were shorts.
2013-06-26 23:08:18 +00:00
Thomas Dinges
15f5da4cd4 Cycles / SSE2:
* kernel_sse2 was built without actual SSE2 intrinsics on x86 systems.
2013-06-26 22:12:23 +00:00
Brecht Van Lommel
e11e30aadf Fix Cycles OpenCL issue if context/program creation fails, mistake by me,
patch #35866 by Doug Gale to fix it.
2013-06-26 12:24:33 +00:00
Thomas Dinges
63f1e253c3 Merged revision(s) 57671-57767 from trunk/blender into soc-2013-dingto 2013-06-26 11:46:55 +00:00
Brecht Van Lommel
8574808b2d Fix #35546: clicking cycles "Use Nodes" did not do a proper undo push, due to
button disappearing as soon as it's clicked. Workaround now is to make this an
operator. Thanks to Lukas and Campbell for tracking this down.
2013-06-25 16:38:40 +00:00
Brecht Van Lommel
0309f442bb Render stats text: show elapsed time for blender internal, hide useless "Single Layer"
at the start, more clearly indicate what the render time of the last frame was, some
other tweaks for consistency.
2013-06-24 22:41:24 +00:00
Thomas Dinges
15aed4127b Fix [#35852], hide Cycles sampling pattern menu, when using GPU. 2013-06-24 04:28:07 +00:00
Brecht Van Lommel
8acdc0515d Fix #35847: cycles group nodes did not work well exposing inputs like normal or
texture coordinate that should automatically use the default normal or texture
coordinate appropriate for that node, rather than some fixed value specified by
the user.
2013-06-23 19:24:32 +00:00
Thomas Dinges
00234dab2f Merged revision(s) 57587-57670 from trunk/blender into soc-2013-dingto 2013-06-23 18:04:13 +00:00
Thomas Dinges
e4ef608020 Cycles / Vector Transform Node:
* Implementation of Vector Transform Node into Cycles.
* OSL backend is done, SVM needs the matrices still.
2013-06-23 17:51:08 +00:00
Brecht Van Lommel
240fb6fa26 Cycles: ensure any SSE data is allocated 16 byte aligned, happens automatically
on many platforms but is not assured everywhere.
2013-06-22 14:35:09 +00:00
Brecht Van Lommel
5da48f425f Cycles OSL: don't set optimize=2 option in OSL shading system, this is already
the default, and by not setting it the user can override it with an environmnet
variable, for example:

export OSL_OPTIONS="optimize=0"
2013-06-22 12:52:15 +00:00
Campbell Barton
dfbbac9b94 style cleanup 2013-06-22 10:59:30 +00:00
Brecht Van Lommel
86c7bf7331 Fix #35812: cycles image texture node not doing proper alpha handling of PNG
images with open shading language enabled.
2013-06-21 13:05:10 +00:00