Commit Graph

36 Commits

Author SHA1 Message Date
Brecht Van Lommel
9a1c1f132d Cycles OSL: most closure code is now shared between OSL and SVM. Also fix
transmission pass and filter glossy option.

The BSDF closure class is now more similar to the SVM closures, and includes
some flags and labels that are needed to properly categorize the BSDF's for
render passes. Phong closure is gone for the moment, needs to be adapated to
the new structure still.
2012-10-20 12:18:00 +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
afb75ad2af Cycles: add Tangent input for Anisotropic BSDF.
Also refactor SVM BSDF code, preparing it to be shared with OSL.
2012-10-17 12:17:17 +00:00
Brecht Van Lommel
7680f88f18 Fix object motion blur crash with lamp sampling(?), missed a check.
Motion blur documentation is here:
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.65/Cycles#Motion_Blur
2012-10-16 13:20:57 +00:00
Brecht Van Lommel
7521ce083d Cycles: object motion blur enabled, so in addition to camera motion, moving
objects in the scene will also cause motion blur.

This change does come with a bit of a slow down to the CPU rendering kernel even
with motion blur disabled, due to extra overhead in handling of object matrices.
It's a few percentages on simpler scenes, not so noticeable on more complex ones.
With motion blur enabled rendering is of course also slower as would be expected,
though from testing especially GPU rendering handles it quite well.

This does not support motion blur from deforming objects yet, only translation,
scale and rotation. Deformation blur is probably for another release.
2012-10-16 10:48:19 +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
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
94f869a256 Cycles: camera motion blur enabled.
Still more work needed to get object motion blur ready.
2012-10-09 18:37:14 +00:00
Lukas Toenne
f3a91f461c Fix for OSL memory leak. The context creation for OSL is now done in the shader_setup_* functions, since it should specific to the sample being worked on. The the context release then happens in the kernel_shader functions after shader evaluation is done. Care has to be taken to ensure the shader_release function is also called in cases where the path integration is cancelled early, this was the main cause for unreleased contexts and subsequent new allocations. 2012-09-05 08:12:22 +00:00
Lukas Toenne
95b85a8c37 Revert "Use one context per OSL thread. Not sure if this actually works, but the simple renderer example in OSL does it this way."
This does not actually work: The context must not be shared between threads, but using the same context between different samples actually seems to prevent OSL from switching between shaders. The proper solution would be to ensure memory pooling works correctly.

This reverts commit 69f87e69258d6266dcb20f09f7e3d4021e663432.
2012-09-04 17:28:36 +00:00
Lukas Toenne
6805db676d Use one context per OSL thread. Not sure if this actually works, but the simple renderer example in OSL does it this way. 2012-09-04 08:53:47 +00:00
Lukas Toenne
ad551c1ec6 Enable compilation of the SVM backend for Cycles even when OSL is enabled. The switch between SVM/OSL is decided at runtime, so the SVM code cannot simply be ignored when OSL is enabled.
Currently all shader functions check the OSL/SVM flag to dispatch to the appropriate backend. If this turns out to be a significant overhead (unlikely) this test should be moved out of the inner loop.
2012-09-03 13:56:40 +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
Thomas Dinges
510f98576a Cycles / OSL:
* Compile fixes, missing ShaderClosure argument for eval functions. (r40163)
2012-06-04 19:53: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
f87682f631 Fix #31247: cycles crash after recent bugfix. 2012-05-02 18:14:59 +00:00
Brecht Van Lommel
d64661b507 Cycles: add Ray Length output to Light Path node. This gives the distance travelled
by the last light ray. One use case for this might be to do absorption.

Patch #31232 by Agustin benavidez, see this blog post for details:
http://agus3d.blogspot.com.ar/2012/05/blender-cycles-ray-length-node-output.html
2012-05-02 17:03:46 +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
4a427a441b Fix #30049: cycles noise texture producing nan values with some
texture coordinates, due to int overflow.

Also minor tweak in shader code to avoid copying uninitialized
values, should have no effect though because they were not used.
2012-02-07 17:32:01 +00:00
Brecht Van Lommel
21554f2df5 Fix #30011 & #30027: cycles division by zero evaluating BSDF with zero weights,
showed up as NaN on GPU render.
2012-01-31 15:59:30 +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
f99343d3b8 Cycles: Render Passes
Currently supported passes:
* Combined, Z, Normal, Object Index, Material Index, Emission, Environment,
  Diffuse/Glossy/Transmission x Direct/Indirect/Color

Not supported yet:
* UV, Vector, Mist

Only enabled for CPU devices at the moment, will do GPU tweaks tommorrow,
also for environment importance sampling.

Documentation:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Passes
2012-01-25 17:23:52 +00:00
Brecht Van Lommel
3ce32c3fec Fix small code issue pointed out by nico_ga, was doing negation on unsigned type,
didn't seem to break anything though.
2012-01-18 22:36:12 +00:00
Brecht Van Lommel
47853bf6f6 Cycles: OpenCL tweaks
* Reduce kernel arguments size, helps compile for apple nvidia.
* Fix use of unitialized variable in displace kernel.
* Use build flags in opencl kernel md5 hash.
* Reorganize code for kernel feature #defines a bit.
2011-11-22 13:15:19 +00:00
Brecht Van Lommel
63ff37c6d4 Fix #29278: cycles crash with displacement method both. 2011-11-15 22:09:30 +00:00
Thomas Dinges
60b72a7a41 Cycles:
* World background was emitting light, even after removal of World shader nodes.
2011-10-16 14:11:53 +00:00
Brecht Van Lommel
9ebfcea8f3 Cycles: revert commit that joined surface/volume socket into a single shader socket,
on second thought this makes it a bit too difficult to understand what's going on.
2011-10-12 23:03:12 +00:00
Brecht Van Lommel
7503a7edfb Cycles: replace surface/volume sockets in output nodes with a single shader socket,
decided it's better to render objects as either surface or volume.

This may break the volume rendering patch, but shaders with volume closures still
get tagged as having volume closures, so it should be fixable without too many
changes.
2011-10-12 15:42:35 +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
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
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
b98ccf6998 Cycles: amd opencl compatibility fixes. 2011-08-10 14:26:51 +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