Commit Graph

95 Commits

Author SHA1 Message Date
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
803286dde8 Cycles: render passes for CUDA cards with compute model >= 2.x. 2012-01-26 19:07:01 +00:00
Brecht Van Lommel
de5d5ded7b Cycles: fixes for OpenCL build after pass changes, patch by Daniel Genrich. 2012-01-26 15:37:33 +00:00
Brecht Van Lommel
f8bddbd347 Cycles: fix issues rendering second render layer passes, and avoid unnecessary
clear of buffer.
2012-01-26 14:55:25 +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
Dalai Felinto
335ffb0ff3 Brightness/Contrast Node for Cycles
Contrast helps to adjust IBL (HDR images used for background lighting).
Note: In the UI we are caling it Bright instead of Brightness. This copy what Blender composite is doing.
Note2: the algorithm we are using produces pure black when contrast is 100. I'm not a fan of that, but it's a division by zero. I would like to look at other algorithms (what gimp does for example). But that would be only after 2.62.
2012-01-24 16:32:31 +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
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
b20a56b2ca Fix #29860: cycles musgrave scale input not working correct. 2012-01-12 17:13:56 +00:00
Brecht Van Lommel
8f37c143ed Cycles: small tweak to checker texture, scale rather than add with epsilon,
looks a bit better on all sides of a mesh.
2012-01-09 16:57:26 +00:00
Brecht Van Lommel
8bfa48384d Cycles: checker texture node, patch by Thomas. 2012-01-08 14:55:43 +00:00
Brecht Van Lommel
b5595298d3 Cycles code refactoring: change displace kernel into more generic shader
evaluate kernel, added background shader evaluate.
2011-12-31 15:18:13 +00:00
Dalai Felinto
b4c95833ab bugfix: [#29711] Cycles - HSV Node - Hue Change Bug
* Adding hue instead of removing it.

fmod doesn't work as % when it comes to negative numbers:
fmod( 1.3, 1) ==  1.3 % 1 == 0.3
fmod(-0.3, 1) != -0.3 % 1
2011-12-29 05:40:48 +00:00
Brecht Van Lommel
9d3f5ea334 Fix #29715: cycles and glsl normal node not working correct. 2011-12-28 19:42:22 +00:00
Brecht Van Lommel
b65061e2ae Cycles: code refactoring, to do render layer visibility test a bit different,
replacing the camera visibility flag with object layer flags.
2011-12-21 20:51:43 +00:00
Brecht Van Lommel
690de79580 Cycles: some tweaks for apple opencl with ATI cards, to get it working up to
the level of ambient occlusion render, shaders still fail. Fixes found with
much help from Jens and Dalai.
2011-12-20 17:36:56 +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
72d2d05770 Cycles: border rendering support, includes some refactoring in how pixels are
accessed on devices.
2011-12-20 12:25:37 +00:00
Dalai Felinto
2a6fdbcccd Cycles Gamma Node
Node specially useful for Texture correction.

This is also a nice example of a simple node made from scratch in case someone wants to create their custom nodes.
Review by Brecht.
2011-12-16 20:35:06 +00:00
Dalai Felinto
3c8ab559a5 Normal Node - Cycles
reviewed by Brecht, with help from Lukas.

Note: dot is reversed compared to Blender.
In Blender Normals point outside, while in Cycles they point inside.
If you use your own custom vector with the Normal Node you will see a difference.
If you feed it with object normals it should work just as good.
2011-12-16 18:15:07 +00:00
Thomas Dinges
7c630aac80 Scons/CUDA
* Added missing bitness info to the nvcc_flags. 
This makes sure that the nvcc compiler builds the correct cubins.
2011-12-08 19:16:43 +00:00
Campbell Barton
c292bf18be correct missing argument error if CYCLES_OPTIMIZED_KERNEL_FLAGS isnt set 2011-12-07 08:03:52 +00:00
Thomas Dinges
b7649ea757 Cycles / CUDA Kernel compile:
* Added option "WITH_BF_CYCLES_CUDA_THREADED_COMPILE" for the people who have much RAM (8 or more) and can compile several kernels at the same time. If enabled, it uses the general BF_NUMJOBS flag.
* The option is off per default.
2011-12-06 16:00:57 +00:00
Brecht Van Lommel
cd1e78f1b7 Cycles: scons cuda kernel compile now does one kernel at a time, to reduce memory
usage.
2011-12-06 12:29:54 +00:00
Dalai Felinto
d15c5e51a1 Invert Color Cycles Node
as with the HSV node the OSL code is relying on the (yet to be implemented) autorename.

Also the svm code could use mix (svm_lerp) instead:
 32 . float3 color_inv = make_float3(1.0f, 1.0f, 1.0f) - color;
 35 . . stack_store_float3(stack, out_color, svm_lerp(color_inv, color, factor));

I have a feeling that each node 'program' should have the least program as possible. I'll see with Brecht later.
But overall I don't know if that's any fast. And apart from that I think we will need this kind of function to move to a library if multiple functions linked in are not a problem.
2011-12-03 23:05:35 +00:00
Dalai Felinto
78495ddf32 CameraData Input Cycles Node
----------------------------
reviewed and approved by Brecht 

Important note:
the camera Z is reverted compared to Blender render.
Now it goes from zero (camera) to positive (in front of the camera)
2011-12-02 20:36:13 +00:00
Dalai Felinto
4fd2736487 HSV Color Node for Cycles
.........................
note, the OSL code has a problem.
In the original node the input and output nodes have the same name (Color).
So this will be fixed here once Brecht come up with a nice autorenaming (or we do a doversion patch) for that.
2011-12-02 16:57:37 +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
Dalai Felinto
1da758ffff cycles separateRGB: fix for cuda kernel building.
Array indexing doesn't work there.

I'm yet to setup my CUDA computer, in the meantime this proved to work (tested by Daniel Salazar).
If I found other ways of doing it I get back to that.
2011-12-02 07:13:48 +00:00
Dalai Felinto
4db4a0933f SeparateRGB and CombineRGB nodes for Cycles materials
reviewed and approved by Brecht

my first OpenCL code \o/
2011-12-01 21:46:10 +00:00
Brecht Van Lommel
45de380771 Cycles
* Compile all of cycles with -ffast-math again
* Add scons compilation of cuda binaries, tested on mac/linux.
* Add UI option for supported/experimental features, to make it
  more clear what is supported, opencl/subdivision is experimental.
* Remove cycles xml exporter, was just for testing.
2011-12-01 16:33:21 +00:00
Brecht Van Lommel
b6021462a8 Another possible fix for #29301: issue with BVH intersection, reorder code a
bit so that it's more symmetric and resulting float ops are compiled the same
way. Otherwise extended float precision being used in one place and not the
other can make comparisons fail.
2011-11-30 16:29:26 +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
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
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
Brecht Van Lommel
02ce6fd59c Cycles: try to avoid NaN pixels with oren nayar. Also small cmake code cleanup. 2011-11-18 15:39:40 +00:00
Brecht Van Lommel
63ff37c6d4 Fix #29278: cycles crash with displacement method both. 2011-11-15 22:09:30 +00:00
Brecht Van Lommel
e78cad5540 Fix build issue on windows, M_PI => M_PI_F. 2011-11-15 18:01:52 +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
2ab2423b06 Cycles:
* Fix #29257: nan-pixels with zero roughness for glass/glossy.
* Fix #29239: crash with border rendering, this is not working yet, but should
  no longer crash now.
* Show object name in 3d view rendered draw type.
* Attempt to improve Sample as Light option description.
2011-11-14 19:45:21 +00:00
Brecht Van Lommel
e731ffb648 Cycles: Oren-Nayar BSDF support. This is not a separate shader node, rather it
is available through the Roughness input on the Diffuse BSDF.
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/Shaders#Diffuse

Patch by Yasuhiro Fujii, thanks!
2011-11-14 17:31:47 +00:00
Thomas Dinges
b1019a56b5 Cycles:
* Typo fix, patch by David on the mailing list.
2011-11-13 11:40:35 +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
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