Commit Graph

18 Commits

Author SHA1 Message Date
Brecht Van Lommel
9fba458a7f Cycles: float texture support. Due to GPU limitations there are now 95 byte,
and 5 float image textures. For CPU render this limit will be lifted later
on with image cache support. Patch by Mike Farnsworth.

Also changed color space option in image/environment texture node, to show
options Color and Non-Color Data, instead of sRGB and Linear, this is more
descriptive, and it was not really correct to equate Non-Color Data with
Linear.
2012-03-07 12:27:18 +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
8bfa48384d Cycles: checker texture node, patch by Thomas. 2012-01-08 14:55:43 +00:00
Lukas Toenne
5f6bd44c82 Generalized node groups for Cycles.
This allows group nodes inside other group nodes in cycles and makes the
code more generic for all possible cases, like direct group
input-to-output links and unused group sockets.

Previous code tried to connect external nodes and internal group sockets
by following links until a "real" node input/output. This quickly
becomes complicated in corner cases as described above and can lead to
unexpected behavior when the group socket is of a different type than
the internal/external sockets, but that conversion is skipped.

The new code uses the concept of "proxy nodes" similar to what the new
compositor does. Each group socket is replaced with a proxy node with a
single input and output, to which other nodes in the same tree and
internal nodes can link to. After all groups have been expanded in the
graph, these proxy nodes are removed again, adding converter nodes if
necessary.
2011-12-18 15:34:06 +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
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
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
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
72929172dd Cycles: add location/rotate/scale and XYZ mapping options for all texture nodes,
to reduce the amount of nodes needed to set up a simple texture.

These are currently editable in the texture properties tab, still need to make
them available in the node editor. Projection and color modification options will
be added later, they're not implemented yet but allocated already to avoid
version patches later.

Also an issue with the XYZ mapping is that when you set one to None, texture and
material draw mode doesn't draw the image texture well, OpenGL doesn't seem to
like the degenerate texture matrix?
2011-11-04 20:58:00 +00:00
Brecht Van Lommel
310b25c388 Cycles: code refactoring to split out code from mapping node. 2011-10-12 22:42:13 +00:00
Brecht Van Lommel
136d27b350 Cycles: add some volume nodes, they don't actually do anything, this is just
to give other developers who may want to work on this to get a starting point.
2011-09-27 20:03:16 +00:00
Brecht Van Lommel
66b1dfae89 Cycles: tweaks to properties and nodes
* Passes renamed to samples
* Camera lens radius renamed to aperature size/blades/rotation
* Glass and fresnel nodes input is now index of refraction
* Glossy and velvet fresnel socket removed
* Mix/add closure node renamed to mix/add shader node
* Blend weight node added for shader mixing weights

There is some version patching code for reading existing files, but it's not
perfect, so shaders may work a bit different.
2011-09-16 13:14:02 +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
922bb24865 Cycles: color space control for image/environment texture nodes. Ideally would
be automated but need to think about how to do this, not so simply in a node
system. But guideline for now is, for color textures set to sRGB, for things like
bump or roughness map, set to Linear.
2011-05-13 14:32:08 +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