Commit Graph

618 Commits

Author SHA1 Message Date
Thomas Dinges
cc7b2a0b04 Cycles / Fresnel Node:
* Add a "Normal" Input to the Fresnel node.
* Fix for the Fresnel GLSL code (normalize the Incoming vector).

Patch #37384 by Philipp Oeser (lichtwerk) , thanks!
2013-11-09 13:14:00 +00:00
Brecht Van Lommel
70e9191e15 Fix #37184: film exposure + transparency not working well in cycles viewport. 2013-10-28 19:01:01 +00:00
Lukas Toenne
89fc09b3be Fix for OSL bug reported on IRC by Pablo Vasquez: Clamp option of the math node in OSL produces bad results. Really stupid bug, OSL math node was assigning the clamped 1st input value instead of the
clamped result of the actual operation.
2013-10-23 11:30:18 +00:00
Thomas Dinges
c0295bd3d3 Code cleanup: Remove some more unused cycles SSS code, related to the lookup table. 2013-10-12 09:54:57 +00:00
Campbell Barton
8fd52b3433 style cleanup 2013-10-10 17:28:01 +00:00
Thomas Dinges
3d4bbd278a * Code cleanup for M_PI code. 2013-10-10 17:14:04 +00:00
Brecht Van Lommel
a200256451 Fix windows scons OSL build error, just use quotes now instead of array. 2013-10-09 20:11:18 +00:00
Brecht Van Lommel
bde4148375 Fix OSL shader build failing with spaces in the path to build directory,
patch by Campbell.
2013-10-09 18:48:32 +00:00
Thomas Dinges
e6ce07a5d4 Cycles / SSS:
* Remove the compatible falloff SSS implementation. We shouldn't support two implementations in the long term, and 2.7x is a good release number do break some compatibility as well. 

* Version patch added, so Files with Compatible falloff will automatically use Cubic now. 

It was already mentioned in the manual, that Compatible is deprecated. 
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/Shaders#BSSRDF
2013-10-08 17:07:18 +00:00
Thomas Dinges
b5a5773fa9 Cycles / CUDA:
* Remove support for  CUDA Toolkit 4.x, only Toolkit 5.0 and above are supported now.
* Remove support for sm_1x cards (< Fermi) for good. We didn't officially support those cards for a few releases already, now remove some special code that was still there.
2013-10-08 15:29:28 +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
cbb783f1d6 Fix cycles OpenCL compile error on AMD, and fix assert in debug builds. 2013-10-02 14:41:04 +00:00
Thomas Dinges
85cb0bc19d Fix [#36863] OSL clamp, min and max functions have wrong signature when arguments are integers
* This was fixed in OSL 1.3.2, but we used an outdated stdosl.h.
2013-09-29 23:24:45 +00:00
Brecht Van Lommel
fa352bb749 Fix #35684: cycles unable to use full 6GB of memory on NVidia Titan GPU. We now
use arrays instead of textures for general storage on this card (image textures
are still stored as texture). Textures were found to be faster on older cards,
but the limits on 1D texture size have not increased along with the memory size,
which meant that the full 6 GB could not be used.

The performance actually seems to be slightly better with arrays in some tests
on Titan. For older cards there seems to be a bit of a mix, some are better and
others not. We may change those to use arrays too, but more testing is needed,
only Titan and Tesla K20 (sm_35) is changed for now.

The fact that arrays are faster is a bit surprising, as others found textures
to be faster on Kepler. However even if they were, the memory limitation is
more important to solve anyway.
https://research.nvidia.com/publication/understanding-efficiency-ray-traversal-gpus-kepler-and-fermi-addendum
2013-09-27 19:09:31 +00:00
Thomas Dinges
9a348c354a * Style cleanup / Cycles. 2013-09-19 23:54:16 +00:00
Brecht Van Lommel
edde749850 Fix #36741: cycles AO pass giving values > 1.0 with transparency. 2013-09-17 13:22:42 +00:00
Brecht Van Lommel
2513886f43 Fix #36725: mismatch between viewport and render result when no world is linked
to the scene in cycles.
2013-09-16 21:05:42 +00:00
Stuart Broadfoot
3306afac87 Cycles Hair: Two basic bair shaders added
A new hair bsdf node, with two closure options, is added. These closures allow the generation of the reflective and transmission components of hair. The node allows control of the highlight colour, roughness and angular shift.

Llimitations include:
-No glint or fresnel adjustments.
-The 'offset' is un-used when triangle primitives are used.
2013-09-15 23:58:00 +00:00
Brecht Van Lommel
04316efc4a Cycles OSL: update to build with latest OSL master branch. 2013-09-09 21:52:26 +00:00
Brecht Van Lommel
6c5df7567b Fix OpenCL build error. 2013-09-09 12:15:16 +00:00
Thomas Dinges
5a6bcd1d42 Cycles:
* Refactor PathState struct and functions into its own file.
2013-09-08 18:59:39 +00:00
Thomas Dinges
3b9edee711 Cycles:
* Fix some compile errors, when building without Branched Path.
2013-09-08 17:20:47 +00:00
Campbell Barton
f6b37f34ec code cleanup:
- add missing headers from cmake (own omission)
- quiet rna_test.c unused define warnings.
- minor style edits
- spelling corrections and ignore all uppercase words with spell checking script.
2013-09-05 19:56:49 +00:00
Thomas Dinges
65f21d9b43 Code cleanup / Cycles:
* Avoid special code, when Subsurface is enabled.
Ideally we should only use the function, and get rid of the extra duplicate, but this is slower on CUDA.
2013-09-04 16:11:21 +00:00
Thomas Dinges
37e91d8965 Compile fix / Cycles:
* 'T' is now also used for the Subsurface closure.
2013-09-04 13:37:35 +00:00
Brecht Van Lommel
efe7793152 Fix cycles CUDA/OpenCL build error after recent change. 2013-09-04 01:04:14 +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
b314209356 Cycles: add a sharpness input to the Cubic SSS falloff. When set to 1 this will
give a result more similar to the Compatible falloff option. The scale is x2
though to keep the perceived scatter radius roughly the same while changing the
sharpness. Difference with compatible will be mainly on non-flat geometry.
2013-09-03 22:39:17 +00:00
Thomas Dinges
dace5b9b84 Cycles:
* Document the members of the Ray struct.
2013-09-02 15:43:28 +00:00
Brecht Van Lommel
f3252c261d Fix #36620: sss + indirect light rendering artifacts, due to wrong correlation in
the random numbers.
2013-09-01 14:10:40 +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
841fe45df9 Cycles: change Gaussian subsurface scattering falloff to be more similar to
the Cubic falloff, see here for details.
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/Shaders#Subsurface_Scattering
2013-08-28 19:22:46 +00:00
Thomas Dinges
7ba41a3c7c Cycles / OpenCL:
* Some fixes for OpenCL, was broken after recent changes.
2013-08-28 14:36:47 +00:00
Thomas Dinges
d539bd4672 Cycles / Sky Texture:
* Added a new sky model by Hosek and Wilkie: "An Analytic Model for Full Spectral Sky-Dome Radiance" http://cgg.mff.cuni.cz/projects/SkylightModelling/ 

Example render:
http://archive.dingto.org/2013/blender/code/new_sky_model.png
Documentation:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/Textures#Sky_Texture

Details:
* User can choose between the older Preetham and the new Hosek / Wilkie model via a dropdown. For older files, backwards compatibility is preserved. When we add a new Sky texture, it defaults to the new model though. 
* For the new model, you can specify the ground albedo (see documentation for details). 
* Turbidity now has a UI soft range between 1 and 10, higher values (up to 30) are still possible, but can result in weird colors or black. 
* Removed the limitation of 1 sky texture per SVM stack. (Patch by Lukas Tönne, thanks!)

Thanks to Brecht for code review and some help! 

This is part of my GSoC 2013 project, SVN merge of r59214, r59220, r59251 and r59601.
2013-08-28 14:11:28 +00:00
Brecht Van Lommel
60ca0558c0 Fix issue in last subsurface commit with branched path tracing, was rendering too bright. 2013-08-24 15:36:14 +00:00
Brecht Van Lommel
722d0d92ad Cycles: reduce noise using regular path tracing + subsurface scattering with
new cubic and gaussian falloff. Like the branched path tracer, this will now
shade all intersection points instead of using one at random.
2013-08-24 15:02:08 +00:00
Campbell Barton
b97334f992 add GPL header to treehash.c and add missing includes to cmake. 2013-08-24 03:17:28 +00:00
Thomas Dinges
8b20dfe60e Cycles:
* Fix Cycles using wrong AA sample values, after integrator renaming.
2013-08-24 00:27:20 +00:00
Brecht Van Lommel
e25ad0778f Fix #36545: crash with branched path tracing, correlated multi-jittered
sampling and subsurface scattering.
2013-08-23 23:04:50 +00:00
Brecht Van Lommel
01e22d1b9f Cycles: more code refactoring to rename things internally as well. Also change
property name back so we keep compatibility.
2013-08-23 14:34:34 +00:00
Thomas Dinges
f560d25666 Code cleanup / Cycles:
* Some style tweaks for hair code.
2013-08-23 12:19:35 +00:00
Brecht Van Lommel
0b42f14079 Fix #36526: SSS + hair crash after recent changes. 2013-08-21 12:20:38 +00:00
Brecht Van Lommel
5d97c93c08 Fix compiler warning due to undefined BVH_FUNCTION_FEATURES with patch by Campbell,
and a coverity warning about use of uninitialized variables with OSL.
2013-08-20 18:25:59 +00:00
Thomas Dinges
676b019846 Cycles:
* Fix 16 byte alignment for constant hair kernel data.
2013-08-18 22:25:37 +00:00
Thomas Dinges
8080c10c32 Cycles / SSS:
* OSL rendered Black with Compatible Fallof option, fixed. 

Note: OSL uses compatible scattering when "Compatible" or "Bicubic" is selected. I guess compatible will be removed later? If not we need to fix this properly.
2013-08-18 20:49:58 +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
Stuart Broadfoot
2fd11a6617 Updates for the Cycle Hair UI. With the following changes
- Removed the cycles subdivision and interpolation of hairkeys.
- Removed the parent settings.
- Removed all of the advanced settings and presets.
- This simplifies the UI to a few settings for the primitive type and a shape mode.
2013-08-18 13:41:53 +00:00
Thomas Dinges
8b955e9b19 Cycles / Sky Model:
* Replaced the Preetham model with the newer Hosek / Wilkie model:
"An Analytic Model for Full Spectral Sky-Dome Radiance" http://cgg.mff.cuni.cz/projects/SkylightModelling/ 

* We use the sample code data, which comes with the paper, but removed some unnecessary parts, we only need the xyz version.
* New "Albedo" UI paraemeter, to control the ground albedo (between 0 and 1). 
* Works with SVM only atm (CPU and CUDA). 

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

ToDo / Open Questions:
* OSL still uses the old model, will be done later. In the meantime it's useful to compare the two models this way.
* The new model needs a much weaker Strength value (0.01), otherwise it's white. Can this be fixed? 
* Code cleanup.
2013-08-17 16:08:03 +00:00
Thomas Dinges
0786eebd11 Merged revision(s) 59108-59184 from trunk/blender into soc-2013-dingto. 2013-08-16 12:50:13 +00:00