Commit Graph

42 Commits

Author SHA1 Message Date
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
Thomas Dinges
02ec0b9431 Cycles:
* Forgot to rename some SSS pass strings.
* Some typo fixes.
2013-08-03 21:45:57 +00:00
Thomas Dinges
271ffb43e5 * Fix a typo in code. 2013-07-17 21:25:44 +00:00
Brecht Van Lommel
58a290234b Cycles: ray visibility options now work for lamps and mesh lights, with and without
multiple importance sampling, so you can disable them for diffuse/glossy/transmission.

The Light Path node here is still weak and does not give this info. To make that
work we'd need to evaluate the shader multiple times which is slow and we can't
detect well enough when it is actually needed.
2013-06-07 18:59:23 +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
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
693f687ebf Fix cycles CUDA error with world multiple importance sampling, after recent OpenCL fixes. 2013-05-15 19:02:30 +00:00
Thomas Dinges
1f3bf34ccd Cycles :
* Use is_zero(a) rather than dot(a, a) == 0, saves some calculations.
2013-05-14 18:31:55 +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
168bcfb46b Cycles OpenCL: fix other build issues when enabling more features. 2013-05-09 15:28:38 +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
Brecht Van Lommel
9307565269 Attempted fix for issue with latest CUDA kernel for 32 bit windows/linux/mac,
there seems to be some sort of compiler bug in CUDA toolkit 4.2, uninlining a
few functions seems to avoid it.
2013-02-11 22:41:11 +00:00
Brecht Van Lommel
736d7810a0 Fix an issue with the new cycles lamp MIS option not working correct with
multiple lamps.
2013-02-01 18:54:24 +00:00
Brecht Van Lommel
dc0f4b5618 Cycles: make multiple importance sampling for lamps an option per lamp now,
disabled by default for backwards compatibility.
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Integrator
2013-01-30 15:57:15 +00:00
Brecht Van Lommel
6cdbd1b1aa Fix #33868: cycles sample as lamp for world background not rendering with the
correct intensity on the GPU.
2013-01-14 16:24:47 +00:00
Brecht Van Lommel
057f0a63d4 Fix #33821: cycles background intensity fix had uninitialized memory usage
for area lights.
2013-01-10 17:37:26 +00:00
Brecht Van Lommel
04754cc112 Fix too bright result in background multiple importance after recent changes. 2013-01-10 12:35:09 +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
e1004eb139 Fix CUDA build error after last commit, and remove some comments. 2013-01-03 13:18:35 +00:00
Brecht Van Lommel
bf25f1ea96 Cycles Hair: refactoring to store curves with the index of the first key and the
number of keys in the curve, rather than curve segments with the indices of two
keys. ShaderData.segment now stores the segment number in the curve.
2013-01-03 12:09:09 +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
58ee2bdfc0 Fix: cycles light sampling crash, happens on rare occasions due to float
rounding errors.
2012-11-26 11:05:22 +00:00
Brecht Van Lommel
6915394a3b Attempts to fix CUDA issues on sm 2.0 cards, still no luck getting motion blur
working, but this should make it not crash.

Also fix for wrong shutter time, should have been shorter.
2012-10-17 22:48:29 +00:00
Brecht Van Lommel
fe16b26206 Cycles: fix some update issues with camera motion blur, and do some more work
for getting object motion blur ready.
2012-10-15 21:12:58 +00:00
Brecht Van Lommel
4ba456d175 Cycles: first step for implementation of non-progressive sampler that handles
direct and indirect lighting differently. Rather than picking one light for each
point on the path, it now loops over all lights for direct lighting. For indirect
lighting it still picks a random light each time.

It gives control over the number of AA samples, and the number of Diffuse, Glossy,
Transmission, AO, Mesh Light, Background and Lamp samples for each AA sample.

This helps tuning render performance/noise and tends to give less noise for renders
dominated by direct lighting.

This sampling mode only works on the CPU, and still needs proper tile rendering
to show progress (will follow tommorrow or so), because each AA sample can be quite
slow now and so the delay between each update wil be too long.
2012-06-13 11:44:48 +00:00
Campbell Barton
0fbb6bff27 style cleanup: block comments 2012-06-09 17:22:52 +00:00
Brecht Van Lommel
5ebc88266e Cycles: small code fix for disabled code. 2012-06-06 23:27:38 +00:00
Brecht Van Lommel
d9589bf0dd Cycles: fix spot lamp emitting light in two directions. 2012-06-04 19:38:10 +00:00
Brecht Van Lommel
6548f7efef Cycles: spot lamp support. 2012-06-04 17:17:10 +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
c8cbe63947 Cycles: fix issues with texture coordinates and object scale. Auto texture
space size and location were outdated often, and already computed on demand
by blender internal, now do that through RNA as well.
2012-05-08 23:39:31 +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
4a90339519 Cycles: support for camera rendering an environment map with equirectangular
environment map, by enabling the Panorama option in the camera.

http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Camera#Panorama

The focal length or sensor settings are not used, the UI can be tweaked still to
communicate this, also panorama should probably become a proper camera type like
perspective or ortho.
2012-02-28 16:44:54 +00:00
Brecht Van Lommel
4fe00cd4f9 Cycles: disable environment importance sampling code for CUDA cards with
compute model < 2.x, to avoid running out of memory in the compiler.
2012-01-26 19:45:59 +00:00
Brecht Van Lommel
5873301257 Sample as Lamp option for world shaders, to enable multiple importance sampling.
By default lighting from the world is computed solely with indirect light
sampling. However for more complex environment maps this can be too noisy, as
sampling the BSDF may not easily find the highlights in the environment map
image. By enabling this option, the world background will be sampled as a lamp,
with lighter parts automatically given more samples.

Map Resolution specifies the size of the importance map (res x res). Before
rendering starts, an importance map is generated by "baking" a grayscale image
from the world shader. This will then be used to determine which parts of the
background are light and so should receive more samples than darker parts.
Higher resolutions will result in more accurate sampling but take more setup
time and memory.

Patch by Mike Farnsworth, thanks!
2012-01-20 17:49:17 +00:00
Brecht Van Lommel
d5b679253a Cycles:
* Sun, area and point lights with size now supported
* Cast shadow option to disable shadow casting for lamps
* Emission strength of materials tweaked such that setting strength to 1.0
  basically makes the material "shadeless" in that the value of the color
  input will be the resulting color in the image.
2011-10-15 23:49:01 +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
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
63d4bafff5 Cycles: some steps to getting OpenCL backend to compile. 2011-05-20 12:26:01 +00:00
Ton Roosendaal
da376e0237 Cycles render engine, initial commit. This is the engine itself, blender modifications and build instructions will follow later.
Cycles uses code from some great open source projects, many thanks them:

* BVH building and traversal code from NVidia's "Understanding the Efficiency of Ray Traversal on GPUs":
http://code.google.com/p/understanding-the-efficiency-of-ray-traversal-on-gpus/
* Open Shading Language for a large part of the shading system:
http://code.google.com/p/openshadinglanguage/
* Blender for procedural textures and a few other nodes.
* Approximate Catmull Clark subdivision from NVidia Mesh tools:
http://code.google.com/p/nvidia-mesh-tools/
* Sobol direction vectors from:
http://web.maths.unsw.edu.au/~fkuo/sobol/
* Film response functions from:
http://www.cs.columbia.edu/CAVE/software/softlib/dorf.php
2011-04-27 11:58:34 +00:00