Commit Graph

452 Commits

Author SHA1 Message Date
Nathan Letwory
9a7c4ead3f Move BVHType and shadingsystem enums to top-level of Cycles namespace.
Easier access of BVHType and deduplication for ShadingSystem.

Reviewers: dingto, brecht

Differential Revision: https://developer.blender.org/D534
2014-05-19 14:46:57 +03:00
8cd88e3bd0 Fix T39757: missing cuda libary on linx, now also try to find libcuda.so.1.
I'm not sure this should be needed, but some particular systems don't have
libcuda.so so we do this now.
2014-05-17 15:31:47 +02:00
be03b735c5 Fix T39757: missing cuda libary on linx, now also try to find libcuda.so.1.
I'm not sure this should be needed, but some particular systems don't have
libcuda.so so we do this now.
2014-05-17 15:16:07 +02:00
Campbell Barton
c88e65da61 Code cleanup: comment typos 2014-05-11 16:22:05 +10:00
Campbell Barton
65d54f34b1 Code cleanup: spelling/indentation 2014-05-08 04:53:05 +10: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
Campbell Barton
d27eea6dc6 Add check for LIKELY/UNLIKELY is CPU only 2014-05-05 07:26:49 +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
95d885b3f4 Quiet float conversion warnings when building cycles standalone 2014-05-04 03:15:20 +10:00
Campbell Barton
e0920364ce Quiet warning 2014-04-23 17:01:56 +10:00
Sv. Lockal
ab32a1807d Cycles: SSE optimization for Voronoi cells texture
Gives 5-6% speedup for Caterpillar_PatazStudio.blend.

Reviewed By: brecht, dingto

Differential Revision: https://developer.blender.org/D419
2014-04-03 23:35:10 +04:00
3847d0c0df Cycles code internals: add initial implementation of decoupled ray marching.
This basically records all volumes steps, which can then later be used multiple
time to take scattering samples, without having to step through the volume
again. From the paper:

"Importance Sampling Techniques for Path Tracing in Participating Media"

This works only on the CPU, due to usage of malloc/free.
2014-03-29 13:03:50 +01:00
6020d00990 Cycles: add support for mesh deformation motion blur. 2014-03-29 13:03:47 +01:00
934767cf7f Cycles code refactor: change curve key to float4 for easier storage as attribute. 2014-03-29 13:03:46 +01:00
Sv. Lockal
c45c472e1b Cycles: SSE optimization for line segments/ribbons hair
Gives ~11% speedup for hair.blend, ~10% for koro_final.blend

Also extract few common subexpressions in hair calculation.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D318
2014-03-23 00:45:59 +04:00
Thomas Dinges
ce5395868f Cycles Standalone: Support for relative paths and string OSL parameters.
Patch by John Haddon.
Differential Revision: https://developer.blender.org/D418
2014-03-21 17:22:41 +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
Sv. Lockal
6045de2bf5 Cycles: remove ccl_align macro for GPU as unused and unsupported in OpenCL 2014-03-02 12:44:52 +04:00
Sv. Lockal
5031ca05aa Cycles: compile fix after rB7808360c5f (own mistake) 2014-02-27 17:29:35 +04:00
Sv. Lockal
7808360c5f Cycles: fix crash in SSE hair and half-floats on x86+vc2008
MSVC 2008 ignores alignement attribute when assigning from unaligned
float4 vector, returned from other function. Now Cycles uses unaligned
loads instead of casts for win32 in x86 mode.
2014-02-27 15:01:20 +04:00
Martijn Berger
eb4f2b4897 Fix missing brackets in cpuid bitfield check.
concern raised by lukas_t (rBef73d547cc7c663ad180721094c81b3c81482ac3)
2014-02-25 19:52:38 +01:00
Martijn Berger
ef73d547cc Fix T38815
For AVX support we need to check both OS support and CPU support.
2014-02-25 17:57:05 +01:00
Thomas Dinges
2d26d1dbbd Cycles: Make CUDA aware of COMPUTE_50 (sm_50, Maxwell).
If you have a Maxwell GPU and want to test, you have to use the CUDA Toolkit 6.0(RC) and enable sm_50 in scons/cmake.
2014-02-24 21:47:45 +01:00
c0e0b61222 Fix cycles standalone crash on Mac OS X. 2014-02-21 15:39:46 +01:00
Thomas Dinges
8a1f3238be Cycles Standalone: Add more controls and options
* P key, pauses the render
* W/A/S/D for camera movement
2014-02-14 21:40:51 +01:00
Thomas Dinges
34d1746331 Cycles Standalone: Add interactive mode (I-key), to avoid accidental changes/movement.
Also some code and whitespace cleanup.
2014-02-14 13:41:02 +01:00
Thomas Dinges
b09684567e Cycles Standalone: The camera can now be moved and rotated with LMB/RMB mouse key.
ToDo: Add controls for forward/backward movement.
2014-02-14 01:17:01 +01:00
Sv. Lockal
bd438de8c6 Cycles: bvh_cardinal_curve_intersect intro SSE optimization
Gives 5% speedup for koro_final.blend, 10-15% for hair.blend

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D225
2014-02-04 23:39:02 +04:00
28e6d05e09 Fix cycles crash with float image textures on CPU without AVX support.
The AVX kernel functions for reading image textures could be get used from non-AVX
kernels. These are C++ class methods and need to be marked for inlining, all other
functions are static so they don't leak into other kernels.
2014-02-04 16:07:50 +01:00
Sv. Lockal
cb96cf0b63 Cycles: small optimization for SSE 4.1 bvh intersector
Gives 0.7% - 1.3% speedup for BMW1M-MikePan scene.

Reviewers: juicyfruit

Differential Revision: https://developer.blender.org/D280
2014-02-03 20:49:07 +04:00
Campbell Barton
1dc1d92dab Code cleanup: white space and cmake was broken on all platforms 2014-02-03 13:56:34 +11:00
Sv. Lockal
1ff299b317 Cycles: less instructions for CPU perlin code
Also move shuffle() in bvh traversal back (was accidentally lost in SSE hair revert)
2014-02-01 14:07:53 +04:00
Campbell Barton
b3bb50f687 Warnings: quiet unused define message 2014-01-30 15:26:22 +11:00
f70d966047 Scons: refactor cycles kernel code to avoid building the AVX kernel with
compilers that don't support it.

CMake still needs to updated to work the same for consistency, but this should
fix the OS X buildbot at least.
2014-01-28 23:02:06 +01:00
Thomas Dinges
f746d90398 Cycles Standalone: Various changes
* Change Info in header, put more important info to the left
* API: Move Camera width/height to camera, add some film properties
* Add ESC key to help menu
2014-01-25 18:57:02 +01:00
Thomas Dinges
544b7e6be4 Cycles Standalone: Add a help message, which appears when pressing the "h" key.
This is very basic for now, but can be extended with more info (available devices for example) later.

Thanks to Bastien and Sergey for some help with the glRect coordinates stuff.
2014-01-24 12:59:15 +01:00
4b820fb673 Fix T38311: cycles BVH cache crash on Windows. 2014-01-23 01:13:46 +01:00
Thomas Dinges
de28a4d4b2 Cycles: Add an AVX kernel for CPU rendering.
* AVX is available on Intel Sandy Bridge and newer and AMD Bulldozer and newer.
* We don't use dedicated AVX intrinsics yet, but gcc auto vectorization gives a 3% performance improvement for Caminandes. Tested on an i5-3570, Linux x64.
* No change for Windows yet, MSVC 2008 does not support AVX.

Reviewed by: brecht
Differential Revision: https://developer.blender.org/D216
2014-01-16 17:04:11 +01:00
d9e52ac98b Code cleanup: move half float functions to separate header file. 2014-01-15 15:29:22 +01:00
8af782ad22 Code cleanup: some reshuffling of SIMD defines moving more code to util_optimization.h. 2014-01-15 15:11:50 +01:00
Thomas Dinges
9e3ddd70d4 Cycles: Disable SSE41 kernel on 32bit, we don't use intrinsics here anyway. Also disable it for Visual Studio < 2012, broken blendv instruction. 2014-01-14 23:51:59 +01:00
Thomas Dinges
9351ac0d85 Cycles: Skip the compilation of the dedicated SSE2 kernel on x86-64, we can assume SSE2 here, so just re-use the regular one. Saves 500kb in the blender binary.
Reviewed by: brecht
Differential Revision: https://developer.blender.org/D199
2014-01-14 20:39:54 +01:00
d980c3eccb Further fix for T37817: non-ascii paths fix in Cycles broke OSL rendering.
Not quite sure yet what is going on here, but this works for me.
2014-01-14 20:01:26 +01:00
Sv. Lockal
1c49eb0072 Cycles, Code cleanup: simplify code for color linear interpolation and float math
Reviewed By: brecht

Differential Revision: https://developer.blender.org/D215
2014-01-14 22:55:02 +04:00
Sv. Lockal
47c5898fa1 Cycles: SSE for Voronoi textures (targeted for Haswell CPUs)
Gives up to 15% speedup scenes with voronoi-based textures (up to 25% with volumes) on Haswell. The performance change for other CPUs is much smaller: 1-2%.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D203
2014-01-12 18:14:00 +04:00
Sv. Lockal
da3fdf0b4b Code Cleanup: in Cycles SSE replace macros with templates, skip unused code with preprocessor, simplify casts 2014-01-11 22:20:03 +04:00
4d72a5e34a Fix T38129: cycles viewport render display with very bright colors turning black.
This happened when exceeding the maximum value representable by half floats.
2014-01-11 00:50:53 +01:00
241fccaf6a Fix T37817: cycles CUDA detection problem on Windows with non-ascii paths. 2014-01-11 00:47:58 +01:00
Thomas Dinges
5022d9f81b Cycles: Don't include SIMD util file for OpenCL/CUDA, this fixes OpenCL compilation. 2014-01-06 21:28:18 +01:00
Sv. Lockal
96903508bc Cycles: SSE optimization for sRGB conversion (gives 7% speedup on CPU for pavillon_barcelone scene)
Thanks brecht/dingto/juicyfruit et al. for testing and reviewing this patch in T38034.
2014-01-06 20:03:30 +04:00
Campbell Barton
a288644b1e Code Cleanup: WIN32 defines, check for _MSC_VER instead of !FREE_WINDOWS 2014-01-03 20:46:12 +11:00
Martijn Berger
1c8a12ee61 Fix T37987: MSVC 2013 has C99 headers and warns for out define hypot _hypot for good reason it seems 2014-01-02 22:19:10 +01:00
Martijn Berger
114284b1fb creation of path from std::string on Windows (VC10/11/12) crashes (access error)
Summary:
Seems to be a known problem in boost: https://svn.boost.org/trac/boost/ticket/6320

Applied the solution but do not know if this is the right place.

Reviewers: dingto, brecht

Reviewed By: dingto

Differential Revision: https://developer.blender.org/D140
2013-12-27 22:38:46 +01:00
Thomas Dinges
1578b55c27 Cycles: Move SIMD utility functions into its own file.
Recently added SSE macros for noise texture can be moved here as well, but I leave this for later.
2013-12-27 21:30:21 +01:00
1e045a2417 Cycles: CUDA runtime kernel compilation can now find CUDA 6.0. 2013-12-13 19:12:07 +01: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
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
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
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
Campbell Barton
48c1e0c0fc spelling: use American spelling for canceled 2013-10-26 01:06:19 +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
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
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
60e5abe71f Fix a few issues reported by coverity scan. 2013-09-03 22:39:21 +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
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
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
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
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
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
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
Thomas Dinges
c6ce8de20e Code cleanup / Cycles:
* Some cleanup for castings.
2013-06-27 15:48:16 +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
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
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
8d6e5e2fee Cycles: update build configurations to include CUDA sm_35 architecture. When using
a compiler older than CUDA 5.0 it will give a warning and skip this architecture.
2013-06-20 13:10:47 +00:00
Brecht Van Lommel
f811e6e3ae Cycles: optimized SSE BVH traversal now also works with SSE2 CPUs, so all the
way back to Pentium 4, using a slightly less efficient instruction.

Also ensure /Ox is used for Visual Studio for RelWithDebInfo builds.
2013-06-19 17:54:26 +00:00
Brecht Van Lommel
16204bd647 Cycles: prepare to make CUDA 5.0 the official version we use
* Add CUDA compiler version detection to cmake/scons/runtime
* Remove noinline in kernel_shader.h and reenable --use_fast_math if CUDA 5.x
  is used, these were workarounds for CUDA 4.2 bugs
* Change max number of registers to 32 for sm 2.x (based on performance tests
  from Martijn Berger and confirmed here), and also for NVidia OpenCL.

Overall it seems that with these changes and the latest CUDA 5.0 download, that
performance is as good as or better than the 2.67b release with the scenes and
graphics cards I tested.
2013-06-19 17:54:23 +00:00
Brecht Van Lommel
649dd6f648 Fix cycles crash on some processors. We actually need S-SSE3 support for this
new BVH traversal code, not just SSE3.
2013-06-18 16:52:02 +00:00
Brecht Van Lommel
484d765bd4 Cycles: attempt to fix internal compile error with some visual studio builds 2013-06-18 13:19:16 +00:00
Jürgen Herrmann
5fc1d9205a Cycles BVH Build fix for MSVC 2012.
needs to include intrin.h for _BitScanForward and _BitScanReverse.
2013-06-18 12:32:43 +00:00
Brecht Van Lommel
d57c6748c4 Cycles: optimization for BVH traveral on CPU's with SSE3, using code from Embree.
On the BMW scene, this gives roughly a 10% speedup overall with clang/gcc, and 30%
speedup with visual studio (2008). It turns out visual studio was optimizing the
existing code quite poorly compared to pretty good autovectorization by clang/gcc,
but hand written SSE code also gives a smaller speed boost there.

This code isn't enabled when using the hair minimum width feature yet, need to
make that work with the SSE code still.
2013-06-18 09:36:06 +00:00
Campbell Barton
9161a4daa5 fix for own error in recent solitify refactor (r57402), face flip check was incorrect. 2013-06-14 16:10:32 +00:00
Thomas Dinges
9020df976c Cycles / Wavelength to RGB node:
* Added a node to convert wavelength (in nanometers, from 380nm to 780nm) to RGB values. This can be useful to match real world colors easier.

* Code cleanup:
** Moved color functions (xyz and hsv) into dedicated utility files.
** Remove svm_lerp(), use interp() instead. 

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

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

This is part of my GSoC 2013. (revisions 57322, 57326, 57335 and 57367 from soc-2013-dingto).
2013-06-10 21:55:41 +00:00
Antony Riakiotakis
b0d5555a06 Fix compilation of cycles for MinGW-w64 after recent commits. MinGW-w64 has conflicting redefinitions of the SSE functions in windows.h, so we will be using this header instead, since we can't always avoid including it instead of the sse headers. 2013-06-08 21:48:01 +00:00
Brecht Van Lommel
b20a7e01d0 Cycles: experimental correlated multi-jittered sampling pattern that can be used
instead of sobol. So far one doesn't seem to be consistently better or worse than
the other for the same number of samples but more testing is needed.

The random number generator itself is slower than sobol for most number of samples,
except 16, 64, 256, .. because they can be computed faster. This can probably be
optimized, but we can do that when/if this actually turns out to be useful.

Paper this implementation is based on:
http://graphics.pixar.com/library/MultiJitteredSampling/

Also includes some refactoring of RNG code, fixing a Sobol correlation issue with
the first BSDF and < 16 samples, skipping some unneeded RNG calls and using a
simpler unit square to unit disk function.
2013-06-07 16:06:22 +00:00
Brecht Van Lommel
d835d2f4e6 Code cleanup: avoid some warnings due to implicit uint/int/float/double conversion. 2013-06-07 16:06:17 +00:00
Thomas Dinges
9e4914e055 Cycles:
* Revert r57203 (len() renaming)
There seems to be a problem with nVidia OpenCL after this and I haven't figured out the real cause yet. 
Better to selectively enable native length() later, after figuring out what's wrong. 

This fixes [#35612].
2013-06-04 17:20:00 +00:00
Brecht Van Lommel
3fe117bd3d Fix build error on non-x86 architectures as pointed out by Jochen Schmitt. 2013-06-04 11:21:13 +00:00
Thomas Dinges
c5ed6765b9 Cycles / Math functions:
* Rename some math functions:
len -> length
len_squared -> length_squared
normalize_len -> normalize_length

* This way OpenCL uses its inbuilt length() function, rather than our own. The other two functions have been renamed for consistency. 
* Tested CPU, CUDA and OpenCL compile, should be no functional changes.
2013-06-02 20:39:32 +00:00
Brecht Van Lommel
2d0a586c29 Cycles OpenCL: keep the opencl context and program around for quicker rendering
the second time, as for example Intel CPU startup time is 9 seconds.

* Adds an cache for contexts and programs for each platform and device pair,
  which also ensure now no two threads try to compile and write the binary cache
  file at the same time.
* Change clFinish to clFlush so we don't block until the result is done, instead
  it will block at the moment we copy back memory.
* Fix error in Cycles time_sleep implementation, does not affect any active code
  though.
* Adds some (disabled) debugging code in the task scheduler.

Patch #35559 by Doug Gale.
2013-05-31 16:19:03 +00:00
Brecht Van Lommel
4bdb54a76e Cycles OpenCL: patch #35514 by Doug Gale
* Support using devices from all OpenCL platforms, so that you can use e.g. both
  Intel and NVidia OpenCL implementations if you have them installed.
* Fix compile error due to missing fmodf after recent math node change.
* Enable advanced shading for Intel OpenCL.
* CYCLES_OPENCL_DEBUG environment variable for generating debug symbols so you
  can debug with gdb. This crashes the compiler with Intel OpenCL on Linux though.
  To make this work the preprocessed kernel source code is written out, as gdb
  needs this.
* Show OpenCL compiler warnings even if the build succeeded.
* Some small fixes to initialize cdDevice to NULL, add missing NULL check when
  creating buffer and add missing space at end of build options for Apple OpenCL.
* Fix crash with multi device + opencl, now e.g. CPU + GPU render should work.

I did a few tweaks to the code and also:

* Fix viewport render failing sometimes with Apple CPU OpenCL, was not taking
  workgroup size limits into account properly.
* Add compile error when advanced shading in the Blender binary and OpenCL kernel
  are not in sync.
2013-05-27 16:21:07 +00:00
Thomas Dinges
38dc85f296 Math Node:
* Added a Modulo operation to the math node, available in Compositor, Shader and Texture Nodes.
2013-05-20 14:38:47 +00:00
Thomas Dinges
75e36650e3 Code cleanup / Cycles:
* Simplify shaperadius() function a bit to avoid castings.
* Style cleanup 1.f -> 1.0f, to follow rest of Cycles code.
2013-05-18 11:04:29 +00:00
Campbell Barton
f334df5624 code cleanup: double promotion warnings. 2013-05-16 17:20:56 +00:00
Thomas Dinges
d76b758f23 Cycles:
* Fix compile error, when building with __KERNEL_SSE__
2013-05-13 15:31:59 +00:00
Thomas Dinges
7636aeffe1 Cycles / Math:
* Add M_2PI_F and M_4PI_F constants and use them inside the codebase.
2013-05-12 14:13:29 +00:00
Brecht Van Lommel
d0ffbeec73 Cycles OpenCL: a few fixes to get things compiling after kernel changes,
for Apple OpenCL on OS X 10.8 and simple AO render.

Also environment variable CYCLES_OPENCL_TEST can now be set to CPU, GPU,
ACCELERATOR, DEFAULT or ALL values to test particuler devices.
2013-05-09 14:05:40 +00:00
Thomas Dinges
872a8ed1bf Cycles / Hair rendering:
* Enable hair rendering on the GPU.

Patch by Stuart Broadfoot, with small tweaks by me, to only enable it on sm_20 and above.
2013-05-08 17:33:25 +00:00
Brecht Van Lommel
34707c19f2 Fix 34764: cycles issue rendering instanced mesh with NaN coordinates. 2013-04-09 20:48:53 +00:00
Brecht Van Lommel
cf3ec257a2 Fix #34880: cycles motion blur render issue with some compilers. Actually is a bigger
problem where accessing float4 members with [] stops working due to optimizer, will
check that later.
2013-04-05 23:03:10 +00:00
Brecht Van Lommel
de9dffc61e Cycles: initial subsurface multiple scattering support. It's not working as
well as I would like, but it works, just add a subsurface scattering node and
you can use it like any other BSDF.

It is using fully raytraced sampling compatible with progressive rendering
and other more advanced rendering algorithms we might used in the future, and
it uses no extra memory so it's suitable for complex scenes.

Disadvantage is that it can be quite noisy and slow. Two limitations that will
be solved are that it does not work with bump mapping yet, and that the falloff
function used is a simple cubic function, it's not using the real BSSRDF
falloff function yet.

The node has a color input, along with a scattering radius for each RGB color
channel along with an overall scale factor for the radii.

There is also no GPU support yet, will test if I can get that working later.

Node Documentation:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/Shaders#BSSRDF

Implementation notes:
http://wiki.blender.org/index.php/Dev:2.6/Source/Render/Cycles/Subsurface_Scattering
2013-04-01 20:26:52 +00:00
Thomas Dinges
d4c97029ef Cycles GPU Rendering:
* Make Cycles aware of sm_35 (Tesla K20, GeForce GTX TITAN).

The CUDA Toolkit 5.0 is needed for that and this is not officially used yet, but people with access to such cards can start testing. (just build sm_35 kernels).
2013-02-21 17:16:32 +00:00
Campbell Barton
0528162eb6 patch [#34320] Cross compiling with mingw-w64 on ubuntu
from Martijn Berger (juicyfruit)

applying since this is only corrects header case which is ignored on windows anyway.
2013-02-19 12:05:38 +00:00
Brecht Van Lommel
6e03b70def Fix cycles hair curves with NaN values not rendering with dynamic BVH. These NaN
values were breaking the bounding box computation, now they should have no influence.
2013-02-14 21:40:28 +00:00
Brecht Van Lommel
4061f96d94 Fix cycles issue with BVH cache created with 64 bits and used for 32 bits binary,
and vice versa.
2013-02-13 11:02:51 +00:00
Brecht Van Lommel
7c9d993347 Fix cycles intersection issue with overlapping faces on windows 32 bit and CPU
without SSE3 support, due to 80 bit precision float register being used for one
bounding box but not the one next to it.
2013-02-04 16:12:37 +00:00
Brecht Van Lommel
38c94e9194 Fix cycles crash that happened with mesh emission and diffuse/glossy ray
visibility disabled on some objects.
2013-01-25 02:00:57 +00:00
Antony Riakiotakis
f2891d3731 For non-windows systems, check for CUDA compiler during runtime 2013-01-14 19:33:16 +00:00
Sergey Sharybin
e5179bfefc Remove usage WITH_CYCLES_CUDA_BINARIES in code, use check for
precompiled cubins instead,

Logic here is following now:
- If there're precompiled cubins, assume CUDA compute is available,
  otherwise
- If cuda toolkit found, assume CUDA compute is available
- In all other cases CUDA compute is not available

For windows there're still check for only precompiled binaries,
no runtime compilation is allowed.

Ended up with such decision after discussion with Brecht. The thing
is, if we'll support runtime compilation on windows we'll end up
having lots of reports about different aspects of something doesn't
work (you need particular toolkit version, msvc installed, environment
variables set properly and so) and giving feedback on such reports
will waste time.
2013-01-14 17:30:33 +00:00
Brecht Van Lommel
ad10cbf04a Cycles: multiple importance sampling for lamps, which helps reduce noise for
big lamps and sharp glossy reflections. This was already supported for mesh
lights and the background, so lamps should do it too.

This is not for free and it's a bit slower than I hoped even though there is
no extra BVH ray intersection. I'll try to optimize it more later.

* Area lights look a bit different now, they had the wrong shape before.
* Also fixes a sampling issue in the non-progressive integrator.
* Only enabled for the CPU, will test on the GPU later.
* An option to disable this will be added for situations where it does not help.

Same time comparison before/after:
http://www.pasteall.org/pic/show.php?id=43313
http://www.pasteall.org/pic/show.php?id=43314
2013-01-09 21:09:20 +00:00
Brecht Van Lommel
57cf48e7c6 Cycles Hair: refactoring to support generic attributes for hair curves. There
should be no functional changes yet. UV, tangent and intercept are now stored
as attributes, with the intention to add more like multiple uv's, vertex
colors, generated coordinates and motion vectors later.

Things got a bit messy due to having both triangle and curve data in the same
mesh data structure, which also gives us two sets of attributes. This will get
cleaned up when we split the mesh class.
2013-01-03 12:08:54 +00:00
Stuart Broadfoot
e9ba345c46 New feature
Patch [#33445] - Experimental Cycles Hair Rendering (CPU only)

This patch allows hair data to be exported to cycles and introduces a new line segment primitive to render with.

The UI appears under the particle tab and there is a new hair info node available.

It is only available under the experimental feature set and for cpu rendering.
2012-12-28 14:21:30 +00:00
Brecht Van Lommel
5f4c7e5da4 Cycles: add some extra CUDA nvcc paths for runtime compile, might help for #33622. 2012-12-21 10:27:35 +00:00
Brecht Van Lommel
12117a8187 Fix cycles aliasing warnings caused by motion blur transforms. 2012-12-21 10:26:48 +00:00
Campbell Barton
47a429d161 patches from fedora:
blender-2.64-64bit.patch
blender-2.64a-big-endian.patch
by Jochen@herr-schmitt.de
2012-12-21 03:02:36 +00:00
Brecht Van Lommel
54729df020 Cycles OSL: diffuse_toon and specular_toon closures. These are toon shaders with
a size parameter between 0.0 and 1.0 that gives a angle of reflection between
0° and 90°, and a smooth parameter that gives and angle over which a smooth
transition from full to no reflection happens.

These work with global illumination and do importance sampling of the area within
the angle. Note that unlike most other BSDF's these are not energy conserving in
general, in particular if their weight is 1.0 and size > 2/3 (or 60°) they will
add more energy in each bounce.

Diffuse: http://www.pasteall.org/pic/show.php?id=42119
Specular: http://www.pasteall.org/pic/show.php?id=42120
2012-12-19 21:17:16 +00:00
Campbell Barton
767bfba808 cmake was missing some header files. 2012-12-04 14:43:42 +00:00
Antony Riakiotakis
4e7a4960f7 get rid of annoying redefinition warning on cycles compilation for mingw64 2012-12-02 20:08:11 +00:00
Brecht Van Lommel
7c0a0bae79 Fix #33375: OSL geom:trianglevertices gave wrong coordinates for static BVH.
Also some simple OSL optimization, passing thread data pointer directly instead
of via thread local storage, and creating ustrings for attribute lookup.
2012-12-01 19:15:05 +00:00
Brecht Van Lommel
186bdbd8d8 Fix #33344: cycles motion blur was still crashing on CUDA sm 2.0. Solution now
is also an optimization, use quaternion nlerp instead of slerp, there's no good
reason to use slerp, and nlerp is faster too.
2012-11-29 13:07:45 +00:00
Brecht Van Lommel
0d6976ad0c Fix #32900: object motion blur not working on the GPU. To make this work I disabled motion
blurring of scale animation, probably not a big loss in practice since it's not so common
to animate this, can be added back later.
2012-11-29 00:43:50 +00:00
Dalai Felinto
f403ca34c7 final fix for Sensor Fit (AUTO, HOR, VERT) in panorama lens - patch by Brecht Van Lommel and me 2012-11-23 02:10:13 +00:00
Dalai Felinto
8c4fa687e0 Cycles bugfix: AUTO wasn't working for Equisolid Fisheye lens
Now one no longer needs to match the sensor dimensions with the render dimensions manually.

IMPORTANT NOTE: if you were using AUTO before with mismathing sensor aspect ratio (comparing to the render dimensions)
this will change your render! We can doversion this, but apart from Tube project I don't know if anyone else
is using this yet (part due to this bug and the only recently fixed 3dview preview aspect ratio).

That should help more artists to take advantage of this fantastic Blender feature.
It still helps to know the parameters of kwnown cameras/lens though.
For example:

Nikon DX2S with a 10.5mm fisheye can be set with:
Render resolution: 4288 x 2848
Sensor 23.7 x 15.70 (15.70 can be ommitted if AUTO is used as fit method)

Note: some cameras render different sizes according to the recording mode.
For example, a Red Scarlet in 5k (@12 fps) can render a full circular fisheye with a sigma 4.5 lens.
The same camera in the 30fps recording mode renders 4k in a cropped circular image.
So it's not only the resolution that changes, but the actual sensor been used.

So just keep in mind that the more information you have from the camera/lens you want to emulate the better.
Bug found at/patch written as a follow up of the BlenderPRO2012, patch reviewed by Brecht Van Lommel
2012-11-21 01:07:30 +00:00
Brecht Van Lommel
71389d4d74 Cycles OSL: windows build fixes. 2012-11-14 17:18:47 +00:00
Brecht Van Lommel
afd42031a9 Fix #32974: cycles curved motion blur is not working well combined with rotation,
problem is that the curved interpolation is not constant speed which leads to
mismatches. Turns out this is really hard to solve and implement efficiently, so
curved motion blur is disabled for now, until I can find a solution.
2012-11-11 15:02:05 +00:00
Brecht Van Lommel
1ca4670267 Cycles: panorama camera in viewport camera view now shows the render mapped
to the camera border rather than the entire viewport.
2012-11-10 22:31:29 +00:00
Sergey Sharybin
ffbf0a1b12 Cycles: no need in spin lock in memory statistics
This functions are called from device code which is guaranteed
not to be called simultaneously from different threads.
2012-11-09 08:47:08 +00:00
Sergey Sharybin
76525d5398 Cycles: persistent images option
This option enables keeping loaded images in the memory in-between
of rendering.

Implemented by keeping render engine alive for until Render structure
is being freed.

Cycles will free all data when render finishes, optionally keeping
image manager untouched. All shaders, meshes, objects will be
re-allocated next time rendering happens.

Cycles cession and scene will be re-created from scratch if render/
scene parameters were changed.

This will also allow to keep compiled OSL shaders in memory without
need to re-compile them again.

P.S. Performance panel could be cleaned up a bit, not so much happy
     with it's vertical alignment currently but not sure how to make
     it look better.

 P.P.S. Currently the only way to free images from the device is to
       disable Persistent Images option and start rendering.
2012-11-09 08:46:53 +00:00
Brecht Van Lommel
204113b791 Fix #33107: cycles fixed threads 1 was still having two cores do work,
because main thread works as well.
2012-11-07 21:00:49 +00:00
Brecht Van Lommel
27d647dcf8 Cycles: 4 new nodes.
* Tangent: generate a tangent direction for anisotropic shading. Can be either
  radial around X/Y/Z axis, or from a UV map. The default tangent for the
  anisotropic BSDF and geometry node is now always radial Z, for UV tangent use
  this node now.

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

* Normal Map: generate a perturbed normal from an RGB normal map image. This
  is usually chained with an Image Texture node in the color input, to specify
  the normal map image. For tangent space normal maps, the UV coordinates for
  the image must match, and the image texture should be set to Non-Color mode
  to give correct results.

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

* Refraction BSDF: for best results this node should be considered as a building
  block and not be used on its own, but rather mixed with a glossy node using a
  fresnel type factor. Otherwise it will give quite dark results at the edges for
  glossy refraction.

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

* Ambient Occlusion: controls the amount of AO a surface receives, rather than
  having just a global factor in the world. Note that this outputs a shader and
  not a color, that's for another time.

http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/Shaders#Ambient_Occlusion
2012-11-06 19:59:02 +00:00
Brecht Van Lommel
ccffb6811c Cycles: disable OpenCL in builds for now, since it's not working and is only
confusing users at this point. For experiments you can define the
CYCLES_OPENCL_TEST environment variable to make it show up in the UI.
2012-11-06 19:58:51 +00:00
Sergey Sharybin
6eec49ed20 Cycles: memory usage report
This commit adds memory usage information while rendering.

It reports memory used by device, meaning:

- For CPU it'll report real memory consumption
- For GPU rendering it'll report GPU memory consumption, but it'll
  also mean the same memory is used from host side.

This information displays information about memory requested by Cycles,
not memory really allocated on a device. Real memory usage might be
higher because of memory fragmentation or optimistic memory allocator.

There's really nothing we can do against this.

Also in contrast with blender internal's render cycles memory usage
does not include memory used by scene, only memory needed by cycles
itself will be displayed. So don't freak out if memory usage reported
by cycles would be much lower than blender internal's.

This commit also adds RenderEngine.update_memory_stats callback which
is used to tell memory consumption from external engine to blender.
This information is used to generate information line after rendering
is finished.
2012-11-05 08:04:57 +00:00
Brecht Van Lommel
2ba840652d Cycles: improve Anisotropic BSDF node, changing the Roughness U/V inputs to
Roughness, Anisotropy and Rotation. Also a fix for automatic tangents and
OSL attribute handling.

Meaning of new sockets explained in the documentation:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/Shaders#Anisotropic
2012-11-04 22:31:32 +00:00
Brecht Van Lommel
eb87529e23 Cycles OSL: shader script node
Documentation here:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/OSL
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.65/Cycles

These changes require an OSL build from this repository:
https://github.com/DingTo/OpenShadingLanguage

The lib/ OSL has not been updated yet, so you might want to keep OSL disabled
until that is done.

Still todo:
* Auto update for external .osl files not working currently, press update manually
* Node could indicate better when a refresh is needed
* Attributes like UV or generated coordinates may be missing when requested from
  an OSL shader, need a way to request them to be loaded by cycles
* Expose string, enum and other non-socket parameters
* Scons build support

Thanks to Thomas, Lukas and Dalai for the implementation.
2012-11-03 14:32:35 +00:00
Brecht Van Lommel
615fe0295f Cycles OSL: refactoring and fixes
* Moved kernel/osl/nodes to kernel/shaders
* Renamed standard attributes to use geom:, particle:, object: prefixes
* Update stdosl.h to properly reflect the closures we support
* Fix the wrong stdosl.h being used for building shaders
* Add geom:numpolyvertices, geom:trianglevertices, geom:polyvertices attributes
2012-11-03 14:32:13 +00:00
Brecht Van Lommel
57b7f405a4 Fix related to #32929: update list of available devices for cycles rendering
while Blender is running, not only on load. It might help a case when Blender
is started before the CUDA driver is fully initialized.
2012-10-22 14:04:44 +00:00
Sergey Sharybin
b861f8c3f8 Cycles: suppress path to nvcc appearing in the console in cases
cuda toolkit is installed to different place than /usr/local/cuda
(i.e. happens when using cuda toolkit from repository)
2012-10-18 13:48:02 +00:00
Brecht Van Lommel
d08b06f773 Cycles: motion blur is now curved and passes exactly through the midpoint.
Previously it would only interpolate between the previous and next frame,
which meant it might not hit the current frame position.
2012-10-17 12:55:23 +00:00
Campbell Barton
536d9fec80 code cleanup:
- move object_iterators.c --> view3d_iterators. (ED_object.h had to include ED_view3d.h which isn't so nice)
- move projection functions from view3d_view.c --> view3d_project.c (view3d_view was becoming a mishmash of utility functions and operators).
- some some cmake includes as system-includes.
2012-10-17 04:13:03 +00:00
Brecht Van Lommel
c10c6b1cea Fix #32844: cycles camera motion blur producing completely blurred frames sometimes. 2012-10-15 17:56:40 +00:00
Brecht Van Lommel
f0a9b66469 Cycles: Anisotropic BSDF enabled, with tangents now computed from the active UV map.
It's using the Ward BSDF currently, which has some energy loss so might be a bit
dark. More/better BSDF options can be implemented later.

Patch by Mike Farnsworth, some modifications by me. Currently it's not possible yet
to set a custom tangent, that will follow as part of per-bsdf normals patch.
2012-10-10 13:02:20 +00:00
Brecht Van Lommel
5f52285a01 Fix cycles task manager calling pthread_join() twice. I haven't seen any bugs
from this but best to fix anyway as it causes undefined behavior. Pointed out
on irc by dslammu, thanks!
2012-10-09 14:28:29 +00:00
Brecht Van Lommel
1d2e59ba1c Fix cycles "synchronizing object" status being shown when it was already finished. 2012-09-28 12:37:20 +00:00
Campbell Barton
b0c7c8756f code cleanup: cycles now uses system includes for boost/oiio.. etc, so we dont get warnings from system headers. 2012-09-20 09:04:43 +00:00
Campbell Barton
25c96bc9f3 code cleanup: remove unused macros, commet some which may be useful later - or good to keep for completeness. quieted some warnings and add flags -Wmissing-include-dirs and -Wno-div-by-zero to cmake/gcc 2012-09-20 01:02:39 +00:00
Lukas Toenne
efaf512406 Revert r50528: "Performance fix for Cycles: Don't wait in the main UI thread when resetting devices."
This commit leads to random freezes in Cycles rendering:
https://projects.blender.org/tracker/index.php?func=detail&aid=32545&group_id=9&atid=498

The goal of this commit was to remove UI lag for OSL, but since that is not officially supported yet, better revert it until a proper fix can be implemented in 2.65.
2012-09-17 12:07:06 +00:00
Brecht Van Lommel
3d38ad1b17 Attempted fix for #32415: tighten up cycles opencl initialization checks to try to
avoid crashes. Don't think these should be needed but maybe it helps.
2012-09-12 11:25:47 +00:00
Lukas Toenne
31ed71cb6b Performance fix for Cycles: Don't wait in the main UI thread when resetting devices.
When the scene is updated Cycles resets the renderer device, cancelling
all existing tasks. The main thread would wait for all running tasks to
finish before continuing. This is ok when tasks can actually cancel in a
timely fashion. For OSL however, this does not work, since the OSL
shader group optimization takes quite a bit of time and can not be
easily be cancelled once running (on my crappy machine in full debug
mode: ~0.12 seconds for simple node trees). This would lead to very
laggy UI behavior and make it difficult to accurately control elements
such as sliders.

This patch removes the wait condition from the device->task_cancel
method. Instead it just sets the do_cancel flag and returns. To avoid
backlog in the task pool of the device it will return early from the
BlenderSession::sync function while the reset is going on (tested in
Session::resetting). Once all existing tasks have finished the do_cancel
flag is finally cleared again (checked in TaskPool::num_decrease).

Care has to be taken to avoid race conditions on the do_cancel flag,
since it can now be modified outside the TaskPool::cancel function
itself. For this purpose the scope of the TaskPool::num_mutex locks has
been extended, in most cases the mutex is now locked by the TaskPool
itself before calling TaskScheduler methods, instead of only locking
inside the num_increase/num_decrease functions themselves. The only
occurrence of a lock outside of the TaskPool methods is in
TaskScheduler::thread_run.

This patch is most useful in combination with the OSL renderer mode, so
it can probably wait until after the 2.64 release. SVM tasks tend to be
cancelled quickly, so the effect is less noticeable.
2012-09-11 11:41:51 +00:00
Lukas Toenne
a9105a7dea Fix for Cycles (CUDA) compilation (again ...). Moved the AttributeStandard enum typedef and the attribute_standard_name mapping function to util_attribute/util_types headers, so they can properly be used by kernel and render files alike. This should avoid any std C includes which are not available in CUDA. Thanks to Sergey for help! 2012-09-07 11:06:45 +00:00
Brecht Van Lommel
adea12cb01 Cycles: merge of changes from tomato branch.
Regular rendering now works tiled, and supports save buffers to save memory
during render and cache render results.

Brick texture node by Thomas.
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/Textures#Brick_Texture

Image texture Blended Box Mapping.
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/Textures#Image_Texture
http://mango.blender.org/production/blended_box/

Various bug fixes by Sergey and Campbell.
* Fix for reading freed memory in some node setups.
* Fix incorrect memory read when synchronizing mesh motion.
* Fix crash appearing when direct light usage is different on different layers.
* Fix for vector pass gives wrong result in some circumstances.
* Fix for wrong resolution used for rendering Render Layer node.
* Option to cancel rendering when doing initial synchronization.
* No more texture limit when using CPU render.
* Many fixes for new tiled rendering.
2012-09-04 13:29:07 +00:00
Lukas Toenne
588e4a4327 Additional fix #32074, by Sven-Hendrik Haase (svenstaro). Boost version header must be included in cycles in order to expand the version check macro. 2012-07-29 13:52:38 +00:00
Sergey Sharybin
8ad3e73965 Make Cycles compatible with older boost versions.
Patch by IRIE Shinsuke, thanks!
2012-07-25 20:25:47 +00:00
Sergey Sharybin
a87051bd8e Patch #32074: Fix compilation with boost 1.50
This patch switches from boost's filesystem v2 to v3.

This should be completely smooth due to filesystem v3 is pretty
old already.

Patch by Sven-Hendrik Haase (aka svenstaro), thanks!
2012-07-11 14:48:47 +00:00
Campbell Barton
2c1abe1f58 style cleanup: assignment & indentation. 2012-06-09 18:56:12 +00:00
Campbell Barton
43361487ba code cleanup: quiet all warnings about double promotion (either by changing the type or explicitly casting). 2012-06-09 17:45:22 +00:00
Campbell Barton
0fbb6bff27 style cleanup: block comments 2012-06-09 17:22:52 +00:00
Campbell Barton
d5032657ed style cleanup 2012-06-06 22:38:39 +00:00
Brecht Van Lommel
6548f7efef Cycles: spot lamp support. 2012-06-04 17:17:10 +00:00
Brecht Van Lommel
131de4352b Cycles: fixes to make CUDA 4.2 work, compiling gave errors in shadows and
other places, was mainly due to instancing not working, but also found
issues in procedural textures.

The problem was with --use_fast_math, this seems to now have way lower
precision for some operations. Disabled this flag and selectively use
fast math functions. Did not find performance regression on GTX 460 after
doing this.
2012-05-28 19:21:13 +00:00
Campbell Barton
857dedbc58 style cleanup 2012-05-27 00:36:50 +00:00
Brecht Van Lommel
c3e1fce775 Cycles: add Object Info node, with outputs object location, object/material
pass index, and a random number unique to the instance of the object.

This can be useful to give some variation to a single material assigned to
multiple instances, either manually controlled through the object index, based
on the object location, or randomized for each instance. 

http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/More#Object_Info
2012-05-21 12:52:28 +00:00
Brecht Van Lommel
dd9c1b7fbf Cycles: OpenCL image texture support, fix an attribute node issue and refactor
feature enabling #defines a bit.
2012-05-13 12:32:44 +00:00
Brecht Van Lommel
8148d7b1df Cycles: reviewed the task scheduler code and fixed (hopefully all) windows threading problems. 2012-05-10 22:31:16 +00:00
Brecht Van Lommel
d9a70ceeb1 Fix 31370: light falloff node linear output not working code.
Fix part of thread safety issue, there's still something else wrong.
2012-05-08 19:57:56 +00:00
Brecht Van Lommel
022d12a721 Fix most of #31307: cycles panorama camera not working correct with speed
vectors and window texture coordinates. Only for Fisheye Equisolid it's
still not working correct yet. Patch from Dalai with modifications.
2012-05-07 10:53:09 +00:00
Brecht Van Lommel
8103381ded Cycles: threading optimizations
* Multithreaded image loading, each thread can load a separate image.
* Better multithreading for multiple instanced meshes, different threads can now
  build BVH's for different meshes, rather than all cooperating on the same mesh.
  Especially noticeable for dynamic BVH building for the viewport, gave about
  2x faster build on 8 core in fairly complex scene with many objects.
* The main thread waiting for worker threads can now also work itself, so
  (num_cores + 1) threads will be working, this supposedly gives better
  performance on some operating systems, but did not measure performance for
  this very detailed yet.
2012-05-05 19:44:33 +00:00
Brecht Van Lommel
1e2afcddd3 Fix #31168: cycles mask layer should only affect objects for camera rays.
Fix: texture coordinate normal output was not correct, still changed under
object transform.
2012-05-02 09:33:45 +00:00
Brecht Van Lommel
1d8c798188 Cycles: support for motion vector and UV passes.
Most of the changes are related to adding support for motion data throughout
the code. There's some code for actual camera/object motion blur raytracing
but it's unfinished (it badly slows down the raytracing kernel even when the
option is turned off), so that code it disabled still.

Motion vector export from Blender tries to avoid computing derived meshes
when the mesh does not have a deforming modifier, and it also won't store
motion vectors for every vertex if only the object or camera is moving.
2012-04-30 12:49:26 +00:00
Brecht Van Lommel
281f50cfcc Fix visual studio debug build issue with BVH boundbox, pointed out by Agustin Benavidez. 2012-04-30 10:00:55 +00:00
Joshua Leung
b7a59f52b8 mingw32 compiles again
"__force_inline" keyword used in Cycles header is not defined
2012-04-29 13:00:00 +00:00
Daniel Genrich
16d4c49c46 Fix Cycles to compile again on AMD OpenCL devices. 2012-04-29 12:20:06 +00:00
Brecht Van Lommel
44924a2e5e Cycles: fix for CUDA build. 2012-04-28 09:10:20 +00:00
Brecht Van Lommel
07b2241fb1 Cycles: merging features from tomato branch.
=== BVH build time optimizations ===

* BVH building was multithreaded. Not all building is multithreaded, packing
  and the initial bounding/splitting is still single threaded, but recursive
  splitting is, which was the main bottleneck.

* Object splitting now uses binning rather than sorting of all elements, using
  code from the Embree raytracer from Intel.
  http://software.intel.com/en-us/articles/embree-photo-realistic-ray-tracing-kernels/

* Other small changes to avoid allocations, pack memory more tightly, avoid
  some unnecessary operations, ...

These optimizations do not work yet when Spatial Splits are enabled, for that
more work is needed. There's also other optimizations still needed, in
particular for the case of many low poly objects, the packing step and node
memory allocation.

BVH raytracing time should remain about the same, but BVH build time should be
significantly reduced, test here show speedup of about 5x to 10x on a dual core
and 5x to 25x on an 8-core machine, depending on the scene.

=== Threads ===

Centralized task scheduler for multithreading, which is basically the
CPU device threading code wrapped into something reusable.

Basic idea is that there is a single TaskScheduler that keeps a pool of threads,
one for each core. Other places in the code can then create a TaskPool that they
can drop Tasks in to be executed by the scheduler, and wait for them to complete
or cancel them early.

=== Normal ====

Added a Normal output to the texture coordinate node. This currently
gives the object space normal, which is the same under object animation.

In the future this might become a "generated" normal so it's also stable for
deforming objects, but for now it's already useful for non-deforming objects.

=== Render Layers ===

Per render layer Samples control, leaving it to 0 will use the common scene
setting.

Environment pass will now render environment even if film is set to transparent.

Exclude Layers" added. Scene layers (all object that influence the render,
directly or indirectly) are shared between all render layers. However sometimes
it's useful to leave out some object influence for a particular render layer.
That's what this option allows you to do.

=== Filter Glossy ===

When using a value higher than 0.0, this will blur glossy reflections after
blurry bounces, to reduce noise at the cost of accuracy. 1.0 is a good
starting value to tweak.

Some light paths have a low probability of being found while contributing much
light to the pixel. As a result these light paths will be found in some pixels
and not in others, causing fireflies. An example of such a difficult path might
be a small light that is causing a small specular highlight on a sharp glossy
material, which we are seeing through a rough glossy material. With path tracing
it is difficult to find the specular highlight, but if we increase the roughness
on the material the highlight gets bigger and softer, and so easier to find.

Often this blurring will be hardly noticeable, because we are seeing it through
a blurry material anyway, but there are also cases where this will lead to a
loss of detail in lighting.
2012-04-28 08:53:59 +00:00
Brecht Van Lommel
93df58160e Fix #30966: cycles nan mesh vertices got set to (0, 0, 0), now remove them instead. 2012-04-16 08:35:21 +00:00
Brecht Van Lommel
59377695bd Fix #30929: cycles rendering of object with scale 0 on some axis did not work
correct with instancing.

Actually such object will not work in many places, e.g. transforming vertices
in edit mode doesn't work and textures will be misapplied in Blender Internal,
so these should be avoided.
2012-04-13 09:08:43 +00:00
Brecht Van Lommel
a3b491eca7 Fix cycles opencl compile issue, fminf/fmaxf() was defined both as macro and function. 2012-04-11 09:07:28 +00:00
Brecht Van Lommel
91eeddc973 Fix windows compile error in previous commit. 2012-04-05 16:23:47 +00:00
Brecht Van Lommel
e12adeb8c9 Fix #30551: cycles passes combining did not always give identical result combined
with antialiasing/defocus, now divide out color at the very end instead of for each
sample.
2012-03-28 12:18:12 +00:00
Thomas Dinges
d3c596035b Cycles / CUDA:
* Make Cycles aware of Computing Capability 3.0, used by the new Kepler Cards.
You'll need the CUDA 4.2 Toolkit to compile it.
2012-03-25 17:52:50 +00:00
Brecht Van Lommel
aecff24add Cycles: extra OpenCL NULL point check, maybe avoids some crashes. Don't think
this should ever happen in practice but maybe it does anyway.
2012-02-28 16:44:36 +00:00
Brecht Van Lommel
5c395b69f5 Fix for Luxrender boost::thread conflict, workaround now is to just not use it
in cycles and use pthreads instead.
2012-02-04 19:58:09 +00:00
Brecht Van Lommel
b023665551 Cycles: another fix for CUDA render passes, needed to align float4 passes. 2012-01-27 13:58:32 +00:00
Brecht Van Lommel
7e86c8fcdc Fix #29966: cycles elapsed time not resetting in viewport after changes. 2012-01-26 14:55:39 +00:00
Brecht Van Lommel
92764260d7 Cycles: add option to cache BVH's between subsequent renders, storing the BVH on
disk to be reused by the next render.

This is useful for rendering animations where only the camera or materials change.
Note that saving the BVH to disk only to be removed for the next frame is slower
if this is not the case and the meshes do actually change.

For a render, it will save bvh files to the cache user directory, and remove all
cache files from other renders. The files are named using a MD5 hash based on the
mesh, to verify if the meshes are still the same.
2012-01-16 13:13:37 +00:00
Brecht Van Lommel
47d9c6689b Cycles: show elapsed time for F12/background render. 2012-01-09 16:57:46 +00:00
Brecht Van Lommel
40259cfe7b Cycles: avoid using float3 in kernel constant memory, just so we're sure alignment
is working compatible between cpu and gpu.
2011-12-20 12:25:45 +00:00
Brecht Van Lommel
27df40f87f Fix #29653: fix wrong cycles depth of field distance when rendering with a
scaled camera.
2011-12-19 14:23:24 +00:00
Brecht Van Lommel
57a39c3a0c Fix #29594: cycles NaN values with window coordinates mapping. 2011-12-13 00:00:26 +00:00
Brecht Van Lommel
63ad25c30d Cycles:
Fix #29475: remove node from properties editor crash on windows. This was a bug
in the UI code, which code access removed data.
Fix OpenCL still being used in a case where Experimental was disabled.
Fix msvc debug warning in md5 code.
2011-12-05 19:54:59 +00:00
Brecht Van Lommel
6c6b0ecb27 Fix compile issue on windows, broke this trying to fix for mac. 2011-12-04 15:49:14 +00:00
Brecht Van Lommel
341aa730bd Fix cycles compile issue after last commit. 2011-12-03 21:27:19 +00:00
Brecht Van Lommel
f2ae6b1589 Fix #29444: cycles problem building BVH with NaN vertices. 2011-12-03 20:22:21 +00:00
Brecht Van Lommel
efe4ea284a Cycles:
* Fix broken compile of test app.
* Fix some warnings compiling with gcc for 32 bit.
* More tweaks to avoid extended precision issue from #29301.
2011-12-02 14:26:28 +00:00
Brecht Van Lommel
eb2baf9abc Fix #29274: problem compiling cycles opencl kernel from directory with spaces.
Some drivers don't support passing include paths with spaces in them, nor does
the opencl spec specify anything about how to quote/escape such paths, so for
now we just resolved #includes ourselves. Alternative would have been to use c
preprocessor, but this also resolves all #ifdefs, which we do not want.
2011-11-22 16:38:58 +00:00
Brecht Van Lommel
6f73e351ee Cycles:
* Fix #29354: crash on branch file. Note that for best compatibility, you need
  to save your files with one of the latest branch builds, since not all version
  patching code was moved to trunk.
* Rename "Cycles" to "Cycles Render" in info header menu.
* Code tweaks to try to fix #29301. It's not a real solution though, I'm thinking
  cause is extended precision for floats on some cpu's, used in one case but not
  in the other, leading to bounding box intersection issue...
2011-11-21 16:28:19 +00:00
Guillermo S. Romero
4f743dd0cc SVN maintenance. 2011-11-15 19:37:09 +00:00
Brecht Van Lommel
ef6eab3ce4 Cycles: move clew into cycles namespace to avoid conflicts, and fix mesh
displacement panel showing with blender internal.
2011-11-15 19:23:35 +00:00
Brecht Van Lommel
db8024f4b5 Fix #29259: cycles issues on certain processors. Now two versions of the kernel
are compiled, one SSE optimized and the other not, and it will choose between
them at runtime.
2011-11-15 15:13:38 +00:00
Brecht Van Lommel
fc42a6185d Cycles:
* Fix object scaling update issue with interactive rendering + static BVH.
* Fix negative scaling issue with static BVH.
* Fix #29217: excessive fireflies in first sample.
2011-11-12 14:29:52 +00:00
Joshua Leung
4e83c67baa Hack-fix for crash-by-assertion on mingw builds on startup if the CUDA driver on
the computer is too old (and probably can't be upgraded to a version that does)
to support the cuDriverGetVersion method.
2011-11-12 03:59:45 +00:00
Brecht Van Lommel
9dcf4bf0a6 Cycles: attempt to fix build issue with mingw. 2011-11-10 14:53:56 +00:00
Brecht Van Lommel
5b1a42cb17 Cycles:
* Fix excessive fireflies in Velvet BSDF (patch by David).
* Disable some unused SSE code
* Remove RTTI disabling flags for now, this is giving some compile issues and
  was only needed of OSL which we're not using yet.
2011-11-10 14:32:16 +00:00
Brecht Van Lommel
c42772fc95 Cycles:
* Add back option to bundle CUDA kernel binaries with builds.
* Disable runtime CUDA kernel compilation on Windows, couldn't get this working,
  since it seems to depend on visual studio being installed, even though for
  this particular case it shouldn't be needed. CMake only at the moment.
* Runtime compilation on linux/mac should now work if nvcc is not installed in
  the default location, but available in PATH.
2011-11-10 12:52:17 +00:00
Campbell Barton
cd9b51c1bf add some missing headers to cmake, also add some files as comments since it seems they should be added but evidently work fine without. 2011-11-10 06:05:22 +00:00
Campbell Barton
33814e0093 edits to cycles cmake files so cmake_consistency_check.py can parse them. 2011-11-08 20:27:37 +00:00
Brecht Van Lommel
a56c6e18a8 Cycles:
* Disable precompiled cuda binaries, always do at run time
* Change preview samples default to 10
* Hide volume panels since they don't do anything yet
2011-11-08 14:10:33 +00:00
Brecht Van Lommel
fb56dbc2af Cycles: procedural texture nodes reorganization. This will break existing files
using them, but rather do it now that I have the chance still. Highlights:

* Wood and Marble merged into a single Wave texture
* Clouds + Distorted Noise merged into new Noise node
* Blend renamed to Gradient
* Stucci removed, was mostly useful for old bump
* Noise removed, will come back later, didn't actually work yet
* Depth setting is now Detail socket, which accepts float values
* Scale socket instead of Size socket

http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/Textures
2011-11-06 21:05:58 +00:00
Brecht Van Lommel
238f3a7d34 Cycles: seed value to get different noise values from renders, there was a patch
for this but I've implemented it differently.
2011-10-29 14:27:24 +00:00
Brecht Van Lommel
da8f71bffb Cycles: some tweaks to silence msvc assertions in debug mode. 2011-10-03 15:31:45 +00:00
Brecht Van Lommel
cdee3435c6 Cycles: internal changes that should have no effect on user level yet, added
shader flags for various purposes, and some code for light types other than
points.
2011-09-27 20:37:24 +00:00
Brecht Van Lommel
f5b60afe4e Cycles: fix error in md5 hash computation for files in directories below
the first level.
2011-09-27 19:35:41 +00:00
Brecht Van Lommel
e9b967d05b Cycles: remove deprecated strict aliasing flag for opencl, fix missing update
modifying object layer in properties editor, and add memarena utility.
2011-09-19 11:57:31 +00:00
Brecht Van Lommel
66b1dfae89 Cycles: tweaks to properties and nodes
* Passes renamed to samples
* Camera lens radius renamed to aperature size/blades/rotation
* Glass and fresnel nodes input is now index of refraction
* Glossy and velvet fresnel socket removed
* Mix/add closure node renamed to mix/add shader node
* Blend weight node added for shader mixing weights

There is some version patching code for reading existing files, but it's not
perfect, so shaders may work a bit different.
2011-09-16 13:14:02 +00:00
Brecht Van Lommel
ebc653463d Cycles:
* Fix missing update when editing objects with emission materials.
* Fix preview pass rendering set to 1 not showing full resolution.
* Fix CUDA runtime compiling failing due to missing cache directory.
* Use settings from first render layer for visibility and material override.

And a bunch of incomplete and still disabled code mostly related to closure
sampling.
2011-09-12 13:13:56 +00:00
Brecht Van Lommel
71c9120d04 Cycles: fix windows build, some minor tweaks. 2011-09-09 16:38:15 +00:00
Brecht Van Lommel
cfbd6cf154 Cycles:
* OpenCL now only uses GPU/Accelerator devices, it's only confusing if CPU
  device is used, easy to enable in the code for debugging.
* OpenCL kernel binaries are now cached for faster startup after the first
  time compiling.
* CUDA kernels can now be compiled and cached at runtime if the CUDA toolkit
  is installed. This means that even if the build does not have CUDA enabled,
  it's still possible to use it as long as you install the toolkit.
2011-09-09 12:04:39 +00:00
Brecht Van Lommel
9b31cba74e Cycles: some warning fixes, cpu device task tweaks, avoid unnecessary
tonemap in non-viewport render, and some utility functions.
2011-09-08 18:58:07 +00:00
Brecht Van Lommel
7d9d9fa976 Cycles: use workgroup size from opencl, attempt to fix issue with apple opencl. 2011-09-05 12:24:28 +00:00
Antony Riakiotakis
6edb09fe93 Compile fixes for MinGW, checked with basic initial setup, no CUDA, gcc 4.5.2.
OpenImageIO still gives link-time errors, will try to make a lib for MinGW, see if it is fixed.
2011-09-04 15:39:09 +00:00
Brecht Van Lommel
db1664ed4c Cycles:
* Compute MD5 hash to deal with nvidia opencl compiler cache not recognizing
  changes in #included files, makes it possible to do kernel compile only
  once and remember it for the next time blender is started.
* Kernel tweak to compile with ATI/linux. Enabling any more functionality than
  simple clay render still chokes the compiler though, without a specific error
  message ..
2011-09-03 10:49:54 +00:00
Brecht Van Lommel
67030aaf84 Cycles: optimizations for instances in scene updates before render starts,
should load a non-trivial mesh instanced many times quite a bit faster now.
2011-09-02 16:15:18 +00:00
Brecht Van Lommel
1135875ab1 Cycles:
* Fix crash in light path node
* Fix struct alignment issue for cuda
* Fix issue with instances taking up too much memory
* Fix issue with ray visibility working incorrect on some objects
* Enable OpenCL always and remove option, it has no dependencies so may as well
* Refuse to load kernel if OpenCL version < 1.1, recent drivers are needed
* Better error handling for OpenCL device
* 3D views with rendered draw mode will now revert to wireframe on file load
2011-09-02 14:55:06 +00:00
Brecht Van Lommel
3c7dcd7a47 Cycles: compile opencl kernels in non-blocking thread, and don't crash on
build failure but show error message in status text.
2011-09-02 00:10:03 +00:00
Brecht Van Lommel
1f7ac51c36 Cycles: fix opencl device bug that crashed on windows. Now shows diffuse
meshes here on windows/nvidia.
2011-09-01 22:40:52 +00:00
Brecht Van Lommel
8ddef5163f Cycles: fix broken kernel compile after recent change, some tweaks
to UI to only show options when available, fix linux lib detection.
2011-09-01 19:43:57 +00:00
Brecht Van Lommel
27102bfec4 Cycles: OpenCL library is now dynamically loaded so that blender doesn't crash
if it's not installed on the system.

Code copied from clew.h/clew.c in CLCC:
http://clcc.sourceforge.net/
2011-09-01 19:00:23 +00:00
Brecht Van Lommel
bae896691a Cycles:
* Add alpha pass output, to use set Transparent option in Film panel.
* Add Holdout closure (OSL terminology), this is like the Sky option in the
  internal renderer, objects with this closure show the background / zero
  alpha.
* Add option to use Gaussian instead of Box pixel filter in the UI.
* Remove camera response curves for now, they don't really belong here in
  the pipeline, should be moved to compositor.

* Output full float values for rendering now, previously was only byte precision.
* Add a patch from Thomas to get a preview passes option, but still disabled
  because it isn't quite working right yet.
* CUDA: don't compile shader graph evaluation inline.
* Convert tabs to spaces in python files.
2011-08-28 13:55:59 +00:00
Brecht Van Lommel
360fcd73fe Cycles:
* add some (disabled) test code for using OpenImageIO in imbuf
* link cycles, openimageio and boost into blender instead of a shared library
* some cmakefile changes to simplify the code and follow conventions better
* this may solve running cycles problems on windows XP, or give a different
  and hopefully more useful error message
2011-08-16 16:15:34 +00:00
Brecht Van Lommel
18d709022e Cycles: clang build fixes. 2011-08-10 19:45:08 +00:00
Brecht Van Lommel
abc601d10e Cycles: opencl 1.1 compatibility tweaks. 2011-08-09 18:53:54 +00:00
Brecht Van Lommel
7adc3b6029 Cycles: compile error fix for ICC. 2011-06-17 11:33:57 +00:00
Brecht Van Lommel
966e004bbe Cycles: OSL build & image manager fixes. 2011-05-31 16:21:30 +00:00
Brecht Van Lommel
64c2d5e90e Cycles: more opencl fixes. 2011-05-31 11:31:00 +00:00
Brecht Van Lommel
89983a2187 Cycles: fix compile error for cycles_test. 2011-05-31 09:47:19 +00:00
Brecht Van Lommel
63d4bafff5 Cycles: some steps to getting OpenCL backend to compile. 2011-05-20 12:26:01 +00:00
Brecht Van Lommel
88b25b871d Cycles: fix mapping node rotation not working correct for Y/Z axes, patch by Sanne. 2011-05-12 11:34:16 +00:00
Brecht Van Lommel
31f44d8142 Cycles: fix color difference between render / 3d view with color management disabled. 2011-05-09 09:03:08 +00:00
Brecht Van Lommel
c18c6056ff Cycles: two 32 bit fixes with help from IRC user Agiofws. 2011-05-05 13:51:33 +00:00
Brecht Van Lommel
f56aa76752 Cycles: some more windows build fixes, based on patch by Francisco De La Cruz. 2011-05-04 09:58:02 +00:00
Brecht Van Lommel
2996f08f84 Cycles: first batch of windows build fixes, not quite there yet. 2011-05-03 18:29:11 +00:00
Brecht Van Lommel
170f8c8c41 Cycles: build without GLUT test app by default. 2011-05-01 10:00:21 +00:00
Brecht Van Lommel
774584d7e8 Cycles: hook up the CMake build system.
New build instructions for Ubuntu Linux in the wiki:
http://wiki.blender.org/index.php/Dev:2.5/Source/Cycles
2011-04-28 13:47:27 +00:00
Brecht Van Lommel
d263fee952 Cycles: fix for incompatible boost filesystem version, provided by "ornitorrincos" on IRC. 2011-04-28 11:53:29 +00:00