Commit Graph

202 Commits

Author SHA1 Message Date
c1e9ad9c80 Hue Saturation Value node - port to material node system
This commit ports Hue Saturation Value node to the material node system.
Unlike in composite version, each value is an input. Composite node version
will be updated later to use the same scheme.
2007-08-31 07:42:06 +00:00
c3b1877b4f "Combine RGB" and "Separate RGB" material nodes:
These nodes allow the user to separate and combine RGB color channels
as in the composite node editor. However they don't contain Alpha
channel as it is treated separately in case of material nodes.
"Combine RGB" allows the user to use values beyond standard float range 
([0.0, 1.0]) if value input node is used to feed the value to it.
2007-08-20 11:05:14 +00:00
9a07d9cd98 Fixed typo. Ooops. 2007-07-10 02:33:00 +00:00
b89ba8636c Added normalize compositing node. 2007-07-10 02:27:37 +00:00
17a219e3c0 == Shader nodes ==
* Geometry node: Front/back output
This is used as a mask for determining whether you're looking at the front side or back side of a mesh, useful for blending materials, my practical need was giving different materials to the pages of a magazine: http://mke3.net/blender/etc/frontback-h264.mov

Give 1.0 if it's the front side, and 0.0 if it's the back side.

* Extended material node
This is the same as the material node, but gives more available inputs and outputs, (basically just connecting up more of ShadeInput and ShadeResult to the node). I didn't want to add it to the normal simple Material node since you don't always need all that stuff, and it would make the node huge, but when you do need it, it's nice to have it.

== Comp nodes ==

* Invert node
Inverting is something that happens all the time in a node setup, and this makes it easier. It's been possible to invert previously by adding a mix node and subtracting the input from 1.0, but it's not the best way of doing it. This node:
 - makes it a lot faster to set up, rather than all the clicking required with the mix node
 - is a lot more usable amidst a complex comp setup, when you're looking at a node tree, it's very helpful to be able to see at a glance what's going on. Using subtract for inverting is easily mixed up with other nodes in which you are actually subtracting, not inverting, and looks very similar to all the other mix nodes that usually litter a comp tree.
 - has options to invert the RGB channels, the Alpha channel, or both. This saves adding lots of extra nodes (separate RGBA, subtract, set alpha) when you want to do something simple like invert an alpha channel. I'd like to add this option to other nodes too.

There's also a shader node version too.


* Also a few fixes that I committed ages ago, but seems to have been overwritten in Bob's node refactor:
 - adding new compbufs to the set alpha and alphaover nodes when you have only one noodle connected to the lower input
 - making the fac value on RGB curves still work when there's nothing connected to it
2007-05-31 06:55:02 +00:00
26735a6670 Added gamma, fixed typos in brightness 2007-04-13 04:22:32 +00:00
f7738575c9 Added brightness/contrast node 2007-04-13 03:23:39 +00:00
1b04ee899b Plumiferos report:
Compositor. New ESC feature did not work Ok for groups
2007-04-12 17:22:08 +00:00
7f2abaa80c Plumiferos report (2.43 release bug):
Compsitor:
Making groups from Image nodes accidentally reveiled the hidden output
sockets (for when image has passes)
2007-04-11 17:49:08 +00:00
Nathan Letwory
fb0f61c0b0 === Node editor ===
* refactor copying and freeing of node->storage by handlerizing them.
  - freestoragefunc
  - copystoragefunc
  - node_util.c/h have generic handlers for these.
2007-04-04 13:58:12 +00:00
f5b919e12e Long wanted feature; decent ESC processing in composite nodes.
Works simple; just check for

		if(node->exec & NODE_BREAK)
			break;

The main process (node processor) sets such a flag, checking for esc
20 times per second. That means you can check for ESC while doing image
processing without much cpu overhead.

Currently only added in blur nodes and defocus. Needs to be added all over,
nice for others... needs careful tests too.

What we now could do is even calling ESC on editing commands or mouseclicks
in composite editor? Could give user feeling of interactive app :) Further,
finished nodes are kept in memory anyway.
2007-03-28 13:48:01 +00:00
39ef0f4eba moved node_shader_lamp_loop to node.c and put an extern declaration in BKE_node.h to prevent multiple definition link errors. 2007-03-28 13:07:59 +00:00
5c760e4811 Changed node type definitions to use a dynamic list.
This will allow python or plugin defined nodes to work as well.
(And fixes compile issues with MSVC in yesterdays commit for nodes)

Code provided by Nathan L.
Fixes in his code:
- free_nodesystem() was called too late (after guarded alloc was closed)
- free_nodesystem() was freeing nodes that were not malloced even
- free_nodesystem was using free, not freeN :)
- the typedefs needed to be malloced yes, to allow duplicate nodes like
  group but also for dynamic nodes.
2007-03-26 15:07:38 +00:00
c1e9018118 All UI code reverted to drawnode.c 2007-03-25 23:54:39 +00:00
808a5fc05a Scons build system. MSVC 7.1 in a moment. 2007-03-24 18:41:54 +00:00
37308c01ca Compositor/assorted nodes fixes:
* Auto-create compbufs for first socket of alphaover and set alpha nodes.
This allows you to eg. plug something into the second socket of an
alphaover node, and choose a solid colour in the first empty socket for
the image to be superimposed over.

Previously I had to create a bunch of extra nodes to (for example) mix
100% black over my render, just to get a black compbuf of the right size
that I could plug in. Not nice.

The Mix node already works this way, and these two should have, but
didn't.

* Allow the 'Fac' value to be used on RGB curves when there is no input
image. This lets you easily fade the changes in and out to check it
against the original, or to tone down the effect of the colour correction.
2007-03-07 11:09:03 +00:00
d1e40bc6be Bugfix (own collection)
Composite: some cases gave memory errors (not freed mem).
The code that tried to be smart in finding nodes to skip, caused that
stack buffers were not freed propertly.
2007-01-26 19:17:20 +00:00
d2cb060d6f Bugfix:
Compositing, depenency fix, so nodes execute only when really changed.
(Error was in nodes that don't get buffers as input, but only values. These
nodes flooded "execute" events through the node tree.)
2007-01-18 09:09:16 +00:00
878d9f9c68 Fix for bug #5680:
Vertex color node worked only if VCol Paint/Light was enabled. Fixed
that, and removed the vertex color node making it part of the geometry
node instead.

Also, preview.blend had black vertex colors for the sphere, so set them
to white like the other primitives.
2007-01-14 15:19:27 +00:00
8903169218 Corrected initialization values for the chroma key node when it is created. 2007-01-14 03:52:55 +00:00
4d56baa8da After reviewing the channel keyer algorithm, I found that the chroma keyer algorithm was fundamentally the same. Took the opportunity to implement
a different chroma keying algorithm.  This also solves the problem of the poor UI I had on the chroma key node.
2007-01-14 03:42:55 +00:00
611b583acc Re-added the Luma keyer after realizing channeldid not exactly same capability and could not without sgnificant change. 2007-01-13 22:56:26 +00:00
4d28796b61 Updated luminance node to work in all color spaces. Also made it work for any channel, not just luminance. 2007-01-06 01:25:59 +00:00
aa030ba90b == Compositor ==
* Added patch 5251 X/Y Offset to Split Viewer node, by Juho
(with some modifications from the patch version).

Also various small tweaks to compositor drawing & buttons.
2007-01-02 14:15:41 +00:00
822a88959b === Code Fixes ===
Adding missing define for displace node (Matt can change the number when he gets back, this is just to fix compilation)

Removing "#pragma mark" from node.c. IIRC, that's XCode leaving crap around, so be sure to remove them when you commit (it outputs warnings on other compilers).
2006-12-30 16:35:46 +00:00
058ceb0b94 Added Vertex Color material node, making render engine support for multiple
vertex color layers actually useful.
2006-12-22 08:10:29 +00:00
e61dec0767 Defocus Composite Node, by Alfredo de Greef
Log:
http://www.blender3d.org/cms/Composite__Defocus.836.0.html

An incredible quality composite effect, might be slow but worth waiting
for!
2006-12-21 18:11:07 +00:00
47bc3d1208 Added names to UV and vertex color layers, and display them as a list.
Added support for multiple UVs in the render engine. This also involved
changing the way faces are stored, to allow data to be added optionally
per 256 faces, same as the existing system for vertices.

A UV layer can be specified in the Map Input panel and the Geometry node
by name. Leaving this field blank will default to the active UV layer.

Also added sharing of face selection and hiding between UV layers, and at
the same time improved syncing with editmode selection and hiding.

Still to do:
- Multi UV support for fastshade.
- Multires and NMesh preservation of multiple UV sets.
2006-12-21 13:47:27 +00:00
253432bfc7 The Big Image refactor!
Please read:
http://www.blender3d.org/cms/Imaging.834.0.html

Or in short:

- adding MultiLayer Image support
- recoded entire Image API
- better integration of movie/sequence Images

Was a whole load of work... went down for a week to do this. So, will need
a lot of testing! Will be in irc all evening.
2006-12-20 17:57:56 +00:00
4595bef2b4 Three-fixes-in-one:
#5417: Only Shadow material gave shadow outside of Spot bundle
#5414: Material Nodes: sockets without input were always treated as single
       value inputs, ignoring color or vector. (Caused by commit to do
       automatic conversions of socket links).
#5420: When reading with old Blender a new file that has a new window type,
       saving it over, and read back in current Blender, the window type
       should be reset to EMPTY, because all its data got lost.
2006-12-12 11:13:43 +00:00
7f1e3874f9 Node editing usablity!
- Removed stupid idea to insert convertor nodes in Node Shaders, when a
  link is created by non-matching sockets. Now it works like Compositor,
  doing a default conversion. Works like this:

1 from 3 or 4 values: take average
3 from 1: copy to all
3 from 4: copy 3
4 from 1: copy to 3, set alpha to 1
4 from 3: copy 3, set alpha to 1

- Added select-linked in Nodes. Lkey or Shift+L. Also in pulldown menus
2006-12-08 21:20:36 +00:00
2c816da097 Two fixes:
- Shaded view was black, needed to tell it to use 'combined' pass :)
- Crash when deleting in compositor all nodes with an output.
2006-12-05 18:02:43 +00:00
8c6fe1bb1f Material Nodes and Composite now also supports unlimited threads.
Maybe we should add for Composite a seperate "Max threads" button though...
having 8 nodes allocating temp buffers at the same time might give issues.
2006-11-29 18:11:59 +00:00
20e6dc7f57 Bugfix, own collection:
Random seeding is still not perfect in render, especially lack of good
thread support still.

- VectorBlur node was calling seed for each exec, causing other nodes to
  get fixed random too.
- added seed in non-OSA main loop for render
- use BLI_srandom, is better than BLI_srand
2006-11-21 15:52:45 +00:00
a667b79b35 Small usability tweaks in Compositor:
- After making a Group, internal socket values are now copied to the
  group node, so an execute will give identical results
- After ungrouping, the cyclic dependency tagging didn't work well in
  all cases, showing a red noodle line and giving composite errors.
  For time being solved by calling the NodeSort twice.
- Viewer nodes now get previews updated always (used to be only the active)
  Note: this is not for previews inside of groups!
2006-11-20 09:37:01 +00:00
f89b052262 New Compo node: the Split-Viewer, showing two images halves to compare.
Works internally already with masks, so we can have several builtin
types.
2006-11-16 21:50:35 +00:00
5d8efc9756 Patch #2307, by Bob Holcomb
Loadsa new compo nodes, most added in new menu "Mattes".

- Seperate into YCC
- Combine YCC
- Seperate into YUV
- Combine YUV

- (Chroma) Difference Matte
- Chroma Key
- Luminance Key

- Color Spill correction

Main problem is missing docs still... Bob is working on it, he'll also
make tooltips for all buttons.
Some UI things might change too, like more clear names.
2006-11-15 14:41:04 +00:00
b771cd9ca8 Two tiny compositor annoyances;
- Image Node: after loading new file it didn't update the header name
- File-out Node: header color suggested there was only 1 'active', which
  it isn't.
2006-11-13 16:43:45 +00:00
cd097a0e3c Bugfix #5147
Compositor: added a fixed (frame # based) seed in random, to ensure the
Texture node will give different results per frame.
2006-11-02 10:30:35 +00:00
b693662ba6 Removed a initialize check for NodeTrees.
Apparently being so scroogish for cpu cycles makes crashes in Linux. I'll
add it on todo for later checks, but I need a windows or linux coder for
it!

For users: it might fix crashes when you have NodeTrees in Libraries.
2006-11-01 20:41:39 +00:00
9f77785d7c Coding work while on the trip to london (based on Plumiferos wishlist);
- Icon previews for Images were created always for old files, which made
  browsing (menus) incredible slow. Added a minor change in the flow, so
  icons only get created when the user invokes loading images.
  Andrea; you might check this, probably not al cases are covered yet?

- Compositor: the 'File Output' node now has a min/max frame for which it
  writes files

- Compositor: fixed a very bad bug (even in 2.42a release) that made the
  depsgraph for nodes not work... while editing, only the nodes that change
  should be recalculated, but accidentally all of them were done each time.
2006-10-26 10:13:16 +00:00
72c8d7c313 Bugfix #4806
Reports came in that Elephants Dream files crash on quit or loading other
files. Was caused by freeing Material Nodes, which was accessing memory
that potentially was just freed before (node->id). Apparently only Windows
really gives issues then, which is actually a good thing :)
2006-08-15 08:56:48 +00:00
7440aba482 Compositor: finished work on node "File Output".
- It saves a file with indicated type on each change, with number
  appended denoting the current frame (like ANIM saving).
- Output filename button supports relative paths ("//")
- Shows optional preview image too
- For now, added a print on each file save as feedback

To make this option work nicely, changed the BKE_makepicstring() function
to have less globals inside, so it is more generic. Todo: allow amount of
digits in filenames to be set (to support files like tmp_123456.jpg)
2006-08-10 10:38:50 +00:00
6e2e7ad1b7 renamed struct bNode->new to struct bNode->new_node
so it doesn't conflict with c++
(Needed for SkyGen coded)

Kent
2006-08-02 17:29:34 +00:00
3650abf328 A couple of compositing nodes:
* Combine RGBA
Basically the opposite of separate RGBA, brings 4 value channels into a single
RGBA image). Has interesting possibilities for reordering channels, when used
with separate RGBA!

* Dilate/Erode
Originally written by Brecht van Lommel, with some minor modifications and
tweaking by myself. Positive distances dilate, negative distances erode.

* I also added the 'value' field to the hue/saturation node. Minimal extra cost,
and can be handy.
2006-07-31 02:24:35 +00:00
cf313f867d Bugfix #4647
The raytracer wasn't calling node shaders yet, so results showed only
shading for the base material.
This now works, but there's a conflict in the internal Blender shader that
makes recursive raytracing with nodes unpredictable. Basicaly the conflict
is that when a ray wants to shade a point, it should be able to check the
material for mirror properties, but this is undefined for node trees...

Probably we need to separate raytrace entirely from material shading. Is
a good topic for NodeShader 2.0, when we really split up materials in
shading components.

I'll add a note in the release log about this. Best results you get now
when you don't include mirror/ray-transp insde a node tree, in that case
a regular material mirror can render that material perfectly.
2006-07-09 11:54:41 +00:00
71de727f3e Bugfix #4583
Shader Group nodes crashed on render... it was accidentally calling
composite free-buffer option.
2006-07-03 12:08:08 +00:00
7e081266a9 Bugfix #4460
Compositor:
The option to re-render a single node, didn't free memory if nodes were in
use showing exactly same RenderLayer.
2006-06-25 12:00:34 +00:00
4506e65902 More preview fixes, after irc reports:
- Ztransp looked weird in Node previews, only showing the backfacing pixels
- previous change in preview.blend accidentally set camera clipping too low
  for correct display of lamp preview
- refresh issue solved in preview when using Node shaders with ray-mirror
2006-06-20 14:32:42 +00:00
e384f4d6f6 Fix #4358
Was on the todo as well; previews in Shader Nodes didn't get cleared on
re-renders, noticable when you switch preview type (i.e. sphere -> cube).
2006-06-19 17:29:44 +00:00