Commit Graph

77 Commits

Author SHA1 Message Date
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