Commit Graph

191 Commits

Author SHA1 Message Date
Thomas Dinges
20f6a0f2d7 Cleanup: Remove unused Voronoi texture code.
Let's finally delete this code, after 4 years of being unused,
there really is no excuse anymore.

If we decide to extend the procedural textures in SVM, we can do this anytime in the future.
2015-05-28 00:36:33 +02:00
Campbell Barton
b82d571c85 Cleanup: style 2015-04-21 15:53:32 +10:00
Thomas Dinges
97422ea64f Cleanup: Simplify brick texture code a bit. 2015-02-23 16:49:50 +01:00
Sergey Sharybin
578cc2143d Cycles: Add note about autodiff in OSL wireframe shader 2015-02-21 17:31:41 +05:00
Sergey Sharybin
a97bc1bedf Fix T43755: Wireframe attribute doesn't work with displace
This attribute missed derivatives calculation.

Not totally sure what's the proper approach for algebraic derivative
calculation, so calculating them by definition. This isn't fastest
way to do it in this case and could be replaced with some smarter magic
in the wireframe calculation loop.

At least currently implemented approach is better than nothing.
2015-02-21 17:30:29 +05:00
Sergey Sharybin
de4dcda545 Fix T43651: New pointiness attribute doesn't work with displacement
Simple fix: just make pointiness aware of bump offset.
2015-02-20 17:20:24 +05:00
Sergey Sharybin
227a94077f Cycles: implement pointiness geometry attribute
This attribute means how "pointy" the geometry surface is, which allows to do
effects like dirt maps and wear-off effects on render geometry. This means the
attribute is calculated for the final mesh which means no baking (which implies
UV unwrap) is needed. Apart from this the behavior is quite close to how vertex
dirty colors works.

The new attribute is available as an output socket of Geometry node.

There's no penalty for the render time, only some delay on scene preparation
(the delay is linear of the mesh complexity).

Reviewers: brecht, juicyfruit

Subscribers: eyecandy, venomgfx

Differential Revision: https://developer.blender.org/D1086
2015-02-10 20:33:41 +05:00
Sergey Sharybin
df07a25d28 Cycles: Support texture coordinate from another object
This is the same as blender internal's texture mapping from another object,
so this way it's possible to control texture space of one object by another.

Quite straightforward change apart from the workaround for the stupidness of
the dependency graph. Now shader has flag telling that it depends on object
transform. This is the simplest way to know which shaders needs to be tagged
for update when object changes. This might give some false-positive tags now
but reducing them should not be priority for Cycles and rather be a priority
to bring new dependency graph.

Also GLSL preview does not support using other object for mapping.

This is actually correct for BI shading as well and to be addressed as
a part of general GLSL viewport improvements since it's not really clear
how to support this in GLSL.

Reviewers: brecht, juicyfruit

Subscribers: eyecandy, venomgfx

Differential Revision: https://developer.blender.org/D1021
2015-01-27 13:36:30 +05:00
Sergey Sharybin
dda355442d Cycles: Support tube projection for images
This way Cycles finally becomes feature-full on image projections
compared to Blender Internal and Gooseberry Project Team could
finally finish the movie.
2015-01-22 00:41:42 +05:00
Sergey Sharybin
12ccac657f Cycles: Support sphere mapping for the image texture 2015-01-22 00:41:42 +05:00
Sergey Sharybin
c5927cd977 Revert "Fix T42888: Separate and Combine HSV distorts the hue value"
This reverts commit 1549fea9995c348bc14a9105df5e460644e2b33a.

After some further discussion with other developers in the team it becomes
clear there's no correct solution here. It is just more matter of what's
more convenient in particular case.

We're just going back to old code to avoid possible frustration with the
older files in newer blenders. This also means all HSV/HSL is considered
to be "linear" in the shading nodes.

Would be ported to 2.73 final.
2014-12-29 18:14:08 +05:00
Thomas Dinges
ee36e75b85 Cleanup: Fix Cycles Apache header.
This was already mixed a bit, but the dot belongs there.
2014-12-25 02:50:24 +01:00
Sergey Sharybin
1549fea999 Fix T42888: Separate and Combine HSV distorts the hue value
These nodes were assuming sRGB input/output which is for sure wrong for the
shader pipeline which works in the linear space.

So now conversion to/from linear space happens in these nodes which makes them
making sence in the shader context but which might change look and feel of
existing scenes.
2014-12-16 20:06:25 +05:00
Sergey Sharybin
d68521df7b Cycles: Fix difference between SVM and OSL implementation of Normal node
SVM was normalizing the input normal, OSL did not. This lead to render
result differences across this shading systems.
2014-12-10 19:07:50 +05:00
Sergey Sharybin
f9688d88ff Fix T42391: HSV correction shader node gives negative values
This mainly happens when over-saturating already saturated color.
After some discussion with Campbell and loads of tests we decided
to clamp the result RGB color. As an alternative we might want to
clamp corrected HSV values instead, but that would lead to some
larger changes in the render results.

TODO: The same is to be done for compositor nodes.
2014-10-31 14:58:00 +01:00
Thomas Dinges
d5ed153760 Cycles / OSL: Support microfacet() closure color function from OSL 1.5
This is basically just a wrapper class, which maps the generic call from the OSL spec to our closures.

Example usage:

shader microfacet_osl(
    color Color = color(0.8),
    int Distribution = 0,
    normal Normal = N,
    vector Tangent = normalize(dPdu),
    float RoughnessU = 0.0,
    float RoughnessV = 0.0,
    float IOR = 1.4,
    int Refract = 0,
    output closure color BSDF = 0)
{
    if (Distribution == 0)
        BSDF = Color * microfacet("ggx", Normal, Tangent, RoughnessU, RoughnessV, IOR, Refract);
    else
        BSDF = Color * microfacet("beckmann", Normal, Tangent, RoughnessU, RoughnessV, IOR, Refract);
}
2014-10-30 11:33:27 +01:00
Sergey Sharybin
409b3c9c9c Fix T42106: Box image mapping shows black triangles if they point to a corner and blend is 0
After discussion with cambo here we decided it's better to choose arbitrary side of the box
(in this case it's X-axis) and use image from it. That's better than doing a blackness.

P.S. This is literally a corner case anyway.
2014-10-07 15:48:39 +02:00
Thomas Dinges
3aa65574f5 Cycles / OSL: Make the signed/unsigned Perlin parameter more self explaining. 2014-10-03 17:51:21 +02:00
Thomas Dinges
4b2fadeaba Cycles: Remove Westin closure.
Was hooked up last year for testing purposes, as we already had some code for it, but the closure itself is not really good nor really useful, so let's remove it.
2014-10-03 16:03:49 +02:00
Campbell Barton
927099ceb8 Cleanup: style 2014-09-30 02:04:34 +10:00
Thomas Dinges
aa8d25bf09 Cycles / OSL: Add a conductive fresnel shader template.
This adds a fresnel conductive OSL preset to the Text Editor. Based on a patch by Lukas Stockner.
Differential revision: https://developer.blender.org/D145

See the differential for details.
2014-09-07 18:28:59 +02:00
Thomas Dinges
59f4ba854b Cycles: Update stdosl.h for OSL 1.5. 2014-08-01 15:23:58 +02:00
Thomas Dinges
6cff19a0bf Cycles: Drop old OSL closure compatibility code.
This was added to keep custom OSL scripts with Toon and SSS closure calls working. 1 year after the change, we can drop the compatibility code now.
2014-07-25 11:42:01 +02:00
Thomas Dinges
ead83a48f1 Fix T40692, Checker Texture derivation on very large scales (1k).
It might still have a derivation on larger scales (10k or more), but we need some offset to avoid precision issues on unit coordinates.
2014-06-20 09:03:22 +02:00
b12151eceb Cycles: glossy and anisotropic BSDF changes
* Anisotropic BSDF now supports GGX and Beckmann distributions, Ward has been
  removed because other distributions are superior.
* GGX is now the default distribution for all glossy and anisotropic nodes,
  since it looks good, has low noise and is fast to evaluate.
* Ashikhmin-Shirley is now available in the Glossy BSDF.
2014-06-14 13:49:57 +02:00
Karsten Schwenk
8ce1090d4e Cycles: Ashikhmin-Shirley anisotropic BSDF
* Ashikhmin-Shirley anisotropic BSDF was added as closure
* Anisotropic BSDF node now has two distributions

Reviewers: brecht, dingto

Differential Revision: https://developer.blender.org/D549
2014-06-14 13:49:57 +02:00
Thomas Dinges
3de3987ea1 Cycles: Add dedicated nodes to split/combine vectors.
This was already possible via the RGB nodes, but that seems weird.
2014-06-13 21:59:14 +02:00
Thomas Dinges
2c69f1e574 Cleanup: Remove unused total power Emission code in Cycles, that was never exposed in the UI.
Differential Revision: https://developer.blender.org/D562
2014-05-30 14:32:59 +02:00
4d1ec4d9c7 Fix T40386: cycles anisotropic BSDF difference between SVM and OSL. 2014-05-28 16:41:48 +02:00
Matt Heimlich
3fbc984b06 Nodes: add absolute value operation to all math nodes
Reviewed By: dingto, brecht

Differential Revision: https://developer.blender.org/D507
2014-05-07 16:43:59 +02:00
Kevin Dietrich
1dcf956849 Fix for wrong behavior of 'darken' blend mode with factor.
The formula was not consistent across Blender and behaved strangely, now it is
a simple linear blend between color1 and min(color1, color2).

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D489
2014-04-29 14:03:09 +02:00
Campbell Barton
a2489e29f6 Code cleanup: style, unused import 2014-04-28 00:19:15 +10:00
Carlo Andreacchio
7765b73f6d Cycles: add Transparent Depth output to Light Path node.
This can for example be useful if you want to manually terminate the path at
some point and use a color other than black.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D454
2014-04-21 14:44:36 +02:00
Kevin Dietrich
83988b6cdd Fix new Cycles UV Map node not working correct for bump mapping.
Reviewed By: brecht

Differential Revision: https://developer.blender.org/D475
2014-04-21 14:44:36 +02:00
72308669ce Fix T39284: clamp cycles volume density to be >= 0, to avoid accidental strange shading. 2014-04-15 15:19:23 +02:00
Kevin Dietrich
cb7cfd3ab6 Cycles: add dedicated UV Map node, easier to find and has convenient auto complete.
Fixes T37954.

Reviewed By: brecht, dingto

Differential Revision: https://developer.blender.org/D230
2014-04-02 11:53:44 +02:00
Martijn Berger
dd2dca2f7e Add support for multiple interpolation modes on cycles image textures
All textures are sampled bi-linear currently with the exception of OSL there texture sampling is fixed and set to smart bi-cubic.

This patch adds user control to this setting.

Added:
- bits to DNA / RNA in the form of an enum for supporting multiple interpolations types
- changes to the image texture node drawing code ( add enum)
- to ImageManager (this needs to know to allocate second texture when interpolation type is different)
- to node compiler (pass on interpolation type)
- to device tex_alloc this also needs to get the concept of multiple interpolation types
- implementation for doing non interpolated lookup for cuda and cpu
- implementation where we pass this along to osl ( this makes OSL also do linear untill I add smartcubic to the interface / DNA/ RNA)

Reviewers: brecht, dingto

Reviewed By: brecht

CC: dingto, venomgfx

Differential Revision: https://developer.blender.org/D317
2014-03-07 23:16:33 +01:00
eff3bd4e98 Fix T38439: allow IOR in range [0, inf] instead of [1, inf] in Cycles.
The same can be achieved by flipping normals on the mesh, but it can be
convenient to do this in the shader.
2014-02-03 17:08:34 +01:00
Thomas Dinges
e9984653a8 Cycles: Fix Wave texture difference between OSL and SVM, OSL wasn't using the "Scale" properly for distortion. 2014-01-13 22:01:39 +01:00
Campbell Barton
64fc94e93f Code Cleanup: osl style 2014-01-06 13:58:33 +11:00
9cd2b19999 Cycles Volume Render: generated texture coordinates for volume render.
This does not support staying fixed while the surface deforms, but for static
meshes it should match up with the surface texture coordinates. Implemented
as a matrix transform from objects space to mesh texture space.

Making this work for deforming surfaces would be quite complicated, you might
need something like harmonic coordinates as used in the mesh deform modifier,
probably will not be possible anytime soon.
2013-12-31 17:38:26 +01:00
a35db17cee Cycles Volume Render: work on nodes and closures.
* Henyey-Greenstein scattering closure implementation.
* Rename transparent to absorption node and isotropic to scatter node.
* Volume density is folded into the closure weights.
* OSL support for volume closures and nodes.
* This commit has no user visible changes, there is no volume render code yet.

This is work by "storm", Stuart Broadfoot, Thomas Dinges and myself.
2013-12-28 16:57:02 +01:00
Thomas Dinges
28d5f2ab60 Cycles: Update stdosl.h to OSL 1.4.0. (includes new aastep functions). 2013-12-08 12:20:15 +01: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
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
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
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
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
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
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
Thomas Dinges
9dfd2823c4 Code cleanup / Cycles:
* Remove unused "PathThroughput" variable.
* Don't compile unused voronoi code, we only use Distance Squared atm. 
* Various typo and comment fixes.
2013-08-11 16:55:24 +00:00
Thomas Dinges
30f279be26 Code cleanup / Cycles:
* Remove code for the unused Wave texture variations. 

We have quite some unused code in the texture area, I guess it doesn't harm to clean a bit up here. 
We can always get the code back from SVN if we need something.
2013-08-10 00:52:57 +00:00
Thomas Dinges
2a2f0319bc Cycles / HSV Separator and Combine node:
* Added nodes to separate and combine hsv colors.

Part of my GSoC 2013 project, SVN merge of r57981.
2013-07-31 21:27:48 +00:00
Thomas Dinges
34009da32e Cycles / Vector Transform node:
* Add a note to convert a Vector, Point or Normal between World <=> Camera <=> Object coordinate space. 

Documentation: http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/More#Vector_Transform

Part of my GSoC 2013 project, SVN merge of r57599, r57670, r57918, r57919, r58245 and r58775.
2013-07-31 21:18:23 +00:00
Thomas Dinges
6d9720ef63 Cycles / Blackbody to RGB node:
* Added a node to convert a temperature in Kelvin to an RGB color. This can be used e.g. for lights, to easily find the right color temperature. 
= Some common temperatures =
Candle light: 1500 Kelvin
Sunset/Sunrise: 1850 Kelvin
Studio lamps: 3200 Kelvin
Horizon daylight: 5000 Kelvin

Documentation: http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/More#Blackbody

Thanks to Philipp Oeser (lichtwerk), who essentially contributed to this with a patch! :)

This is part of my GSoC 2013 project. SVN merge of r57424, r57487, r57507, r57525, r58253 and r58774
2013-07-31 20:56:32 +00:00
Thomas Dinges
3840e0b234 Cycles / Ray Depth:
* Added a Ray Depth output to the Light Path node, which gives the user access to the current bounce.
This can be used to limit the maximum ray bounce on a per shader basis. Another use case is to restrict light influence with this, to have a lamp only contribute to the direct lighting. 

http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/More#Light_Path

This is part of my GSoC 2013 project. SVN merge of r58091 and r58772 from soc-2013-dingto.
2013-07-31 20:30:37 +00:00
Thomas Dinges
285ef99931 Cycles:
* Added 2 new nodes to combine and separate HSV colors. 

Screenshot:
http://www.pasteall.org/pic/show.php?id=54828
2013-07-03 23:46:56 +00:00
Thomas Dinges
4a113cab0a Merged revision(s) 57768-57827 from trunk/blender into soc-2013-dingto 2013-06-27 16:16:54 +00:00
Brecht Van Lommel
7902fa57b6 Code cleanup: cycles
* Reshuffle SSE #ifdefs to try to avoid compilation errors enabling SSE on 32 bit.
* Remove CUDA kernel launch size exception on Mac, is not needed.
* Make OSL file compilation quiet like c/cpp files.
2013-06-26 23:29:33 +00:00
Thomas Dinges
ce06d6d795 Cycles / Brick texture:
* Avoid some unneeded int castings, they were only needed in the original Texture Nodes implementation as custom1 and custom2 were shorts.
2013-06-26 23:08:18 +00:00
Thomas Dinges
00234dab2f Merged revision(s) 57587-57670 from trunk/blender into soc-2013-dingto 2013-06-23 18:04:13 +00:00
Thomas Dinges
e4ef608020 Cycles / Vector Transform Node:
* Implementation of Vector Transform Node into Cycles.
* OSL backend is done, SVM needs the matrices still.
2013-06-23 17:51:08 +00:00
Campbell Barton
dfbbac9b94 style cleanup 2013-06-22 10:59:30 +00:00
Brecht Van Lommel
86c7bf7331 Fix #35812: cycles image texture node not doing proper alpha handling of PNG
images with open shading language enabled.
2013-06-21 13:05:10 +00:00
Thomas Dinges
0429595440 Merged revision(s) 57423-57498 from trunk/blender into soc-2013-dingto 2013-06-16 12:05:39 +00:00
Thomas Dinges
9e16c5a9e4 Cycles / Blackbody node:
* First (brute force) implementation for SVM. This works and delivers the same result as OSL, but it's slow. 
* Code inside svm_blackbody.h inspired by a patch by Philipp Oeser (#35698), thanks. 

Ideas:
* Use a lookup table to perform the calculations on render/ level.
* Implement it as a RNA property only, and do the calculation like Sun/Sky precompute.
2013-06-15 23:47:09 +00:00
Brecht Van Lommel
f9b06060c2 Fix #35729: cycles normal maps not showing properly in preview render. 2013-06-13 13:55:05 +00:00
Thomas Dinges
d523d27e62 Cycles / Blackbody node:
* First step towards a Blackbody to RGB converter. You can specify a color in Kelvin inside the node.
* Only implemented for OSL atm, SVM will follow.
2013-06-13 08:55:51 +00:00
Thomas Dinges
9020df976c Cycles / Wavelength to RGB node:
* Added a node to convert wavelength (in nanometers, from 380nm to 780nm) to RGB values. This can be useful to match real world colors easier.

* Code cleanup:
** Moved color functions (xyz and hsv) into dedicated utility files.
** Remove svm_lerp(), use interp() instead. 

Documentation:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/More#Wavelength

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

This is part of my GSoC 2013. (revisions 57322, 57326, 57335 and 57367 from soc-2013-dingto).
2013-06-10 21:55:41 +00:00
Thomas Dinges
cae7c6da53 SVN merge r57320-57365 into soc-2013-dingto 2013-06-10 21:16:29 +00:00
Brecht Van Lommel
d16a608f6d Fix cycles backwards compatibility for specular_toon shader this actually needs
to be done in cycles itself to keep compatibility for bytecode too.

Also fix broken button to compile OSL from the text editors, this got broken after
recent change to disable editing of library linked nodes.
2013-06-10 20:10:03 +00:00
Brecht Van Lommel
183629b451 Fix cycles OSL backwards compatibility for specular_toon, it got renamed to glossy_toon
but we can keep the old name working too.
2013-06-10 13:06:10 +00:00
Thomas Dinges
0dfc5fc342 Cycles / Code cleanup:
* Move hsv and xyz color functions into the dedicated util files (util_color.h and node_color.h).
* svm_lerp moved into util_math.h and renamed to lerp_interp, as it's used for the wavelength node now as well.
2013-06-10 00:01:52 +00:00
Thomas Dinges
cf359f6c7f Cycles / Wavelength to RGB node:
* Added a node to convert wavelength (in nanometer, from 380nm to 780nm) to RGB values. This can be useful to match real world colors easier.

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

ToDo:
* Move some functions into an util file, maybe a common util_color.h or so.
* Test GPU, unfortunately sm_21 doesn't work for me yet.
2013-06-09 20:46:22 +00:00
Brecht Van Lommel
c53b20b683 Cycles: window texture coordinates now work with orthographic cameras, this
was an old issue since the first version.
2013-06-08 10:51:33 +00:00
Brecht Van Lommel
33d609144e Cycles: normal maps are now backwards compatible again after recent fix, with
a separate Blender Object/World Space that is compatible with Blender render
baking and uses the YZ flipping convention.
2013-05-28 14:24:03 +00:00
Brecht Van Lommel
601b8c1041 Fix #35505: cycles object space normal mapping did not match blender internal.
Now it uses the same (strange) YZ flipping convention.
2013-05-27 17:48:02 +00:00
Thomas Dinges
2efe0f6733 Cycles / OSL:
* Rename fresnel_dielectric() to fresnel_dielectric_cos() to match SVM, easier when searching code. 
* Also remove an old code comment in bsdf_reflection.h from Cycles branch days.
2013-05-26 17:10:22 +00:00
Thomas Dinges
99b325cebf Cycles / Toon BSDF:
* Added a toon bsdf node to Cycles. This was already available as OSL only closure, but is now available inside the SVM backed as well, for CPU and GPU rendering. 
* There are 2 variations available, diffuse and glossy toon, selectable via a menu inside the node. 

Documentation:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/Shaders#Toon

Example render & blend file:
http://www.pasteall.org/pic/show.php?id=51970
http://www.pasteall.org/blend/21579
2013-05-23 17:45:20 +00:00
Thomas Dinges
6b7d2ed8b6 Code cleanup / Cycles:
* Use M_2PI_F in more places and do multiplication instead of division in gradient texture.
2013-05-21 13:22:11 +00:00
Thomas Dinges
3758193c18 Cycles / Wireframe node:
* Added a wireframe node (Input category) to get access to Mesh wireframe data. 
The thickness can be controlled via a "Size" parameter, and is available in world units (default) and screen pixel size. 
* Only the triangulated mesh is available now, quads is for later. 

Documentation:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/More#Wireframe

Render and Example file:
http://www.pasteall.org/pic/show.php?id=51731
http://www.pasteall.org/blend/21510
2013-05-20 15:58:37 +00:00
Thomas Dinges
38dc85f296 Math Node:
* Added a Modulo operation to the math node, available in Compositor, Shader and Texture Nodes.
2013-05-20 14:38:47 +00:00
Thomas Dinges
eaf493d323 Cycles / OSL:
* Added Westin Sheen and Westin Backscatter closures for testing, useful for Cloth like effects. 

Only available via OSL, added an example OSL shader to the Templates (Text Editor).
2013-05-18 14:36:03 +00:00
Brecht Van Lommel
561cf26c2f Fix #35306: cycles normal mapping not working with flat shading. 2013-05-11 09:31:58 +00:00
Brecht Van Lommel
eaa6479ae3 Cycles: bump node changes to add a Distance input that controls the overall displacement
distance, and an Invert option to invert the bump effect.
2013-05-10 16:57:17 +00:00
Brecht Van Lommel
34d7392297 Fix #35282: cycles color ramp set to constant interpolation did not work well. 2013-05-10 11:44:24 +00:00
Brecht Van Lommel
d236b4d60f Cycles bump node: change the Strength value to work better, previously it would
give results that were either too weak or too strong, this makes it give more
predictable results. The downside is that it breaks backwards compatibility but
the previous behavior was almost broken.
2013-05-09 14:05:37 +00:00
Brecht Van Lommel
3e763d7e4d Fix #35246: cycles has no simple way to combine bump and normal mapping. Now
the Bump node has a Normal input, so you can chain it after a Normal Map node.
Note that normal mapping always has to be done first because it is tied to the
particular mesh surface and tangents.
2013-05-08 13:23:13 +00:00
Brecht Van Lommel
cf0e457e52 Fix #35004: fireflies with .tif image in cycles, try to avoid extreme values when
openimageio can't detect premul/straight alpha correct.
2013-04-17 14:47:58 +00:00
Brecht Van Lommel
3863e72c73 Fix #34679: cycles image texture alpha fringes. New rule is now that color output
will not give straight RGB values if the alpha output is used, so that mixing with
a transparent BSDF gives the correct result.
2013-04-05 16:43:53 +00:00
Brecht Van Lommel
de9dffc61e Cycles: initial subsurface multiple scattering support. It's not working as
well as I would like, but it works, just add a subsurface scattering node and
you can use it like any other BSDF.

It is using fully raytraced sampling compatible with progressive rendering
and other more advanced rendering algorithms we might used in the future, and
it uses no extra memory so it's suitable for complex scenes.

Disadvantage is that it can be quite noisy and slow. Two limitations that will
be solved are that it does not work with bump mapping yet, and that the falloff
function used is a simple cubic function, it's not using the real BSSRDF
falloff function yet.

The node has a color input, along with a scattering radius for each RGB color
channel along with an overall scale factor for the radii.

There is also no GPU support yet, will test if I can get that working later.

Node Documentation:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/Shaders#BSSRDF

Implementation notes:
http://wiki.blender.org/index.php/Dev:2.6/Source/Render/Cycles/Subsurface_Scattering
2013-04-01 20:26:52 +00:00
Campbell Barton
d15d78a33a style cleanup: osl and NULL pointer use, also correct sequencer gap operator id's 2013-03-27 20:27:07 +00:00
Thomas Dinges
535253cad0 Cycles / SunSky:
* Use already calculated theta^2 for theta^3 calculation.
2013-03-27 19:44:25 +00:00
Thomas Dinges
bf2c46f5bd Code cleanup / Cycles:
* Remove unused variable from noise_wave().
2013-03-27 19:08:29 +00:00
Thomas Dinges
56538ea685 Cycles / OSL:
* More small improvements: return immediately, and use "else if".
2013-03-10 00:42:47 +00:00