Commit Graph

326 Commits

Author SHA1 Message Date
402fbd95cc 2 things:
* Patch #17998
* tex_input_vec now takes 3-vector as first argument (was 4-vector).
2008-11-26 13:07:24 +00:00
b3c238e8bc 2.5: merge with trunk, previous merge was only up to yesterday.
svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r17416:HEAD
2008-11-12 22:03:11 +00:00
bdfe7d89e2 Merge of trunk into blender 2.5:
svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r12987:17416

Issues:
* GHOST/X11 had conflicting changes. Some code was added in 2.5, which was
  later added in trunk also, but reverted partially, specifically revision
  16683. I have left out this reversion in the 2.5 branch since I think it is
  needed there.
  http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16683
* Scons had various conflicting changes, I decided to go with trunk version
  for everything except priorities and some library renaming.
* In creator.c, there were various fixes and fixes for fixes related to the -w
  -W and -p options. In 2.5 -w and -W is not coded yet, and -p is done
  differently. Since this is changed so much, and I don't think those fixes
  would be needed in 2.5, I've left them out.
* Also in creator.c: there was code for a python bugfix where the screen was not
  initialized when running with -P. The code that initializes the screen there
  I had to disable, that can't work in 2.5 anymore but left it commented as a
  reminder.

Further I had to disable some new function calls. using src/ and python/, as
was done already in this branch, disabled function calls:
* bpath.c: error reporting
* BME_conversions.c: editmesh conversion functions.
* SHD_dynamic: disabled almost completely, there is no python/.
* KX_PythonInit.cpp and Ketsji/ build files: Mathutils is not there, disabled.
* text.c: clipboard copy call.
* object.c: OB_SUPPORT_MATERIAL.
* DerivedMesh.c and subsurf_ccg, stipple_quarttone.

Still to be done:
* Go over files and functions that were moved to a different location but could
  still use changes that were done in trunk.
2008-11-12 21:16:53 +00:00
8030cb03fd Patch #7897 Texture Nodes!
Robin (Frrr) Allen did a decent job on this, so we can also welcome him
as a member in the svn committers team to maintain it!

I do the first commit with some minor fixes:
- get Makefiles work
- fix rounding issue with tiles on unit faces
- removed UI includes from tex node

A nice doc in wiki is here:
http://wiki.blender.org/index.php/User:Frr/TexnodeManual

On the todo for Robin is:
- When using one or more Texture-input nodes, you cannot edit them by activating
  (as works now for Material nodes).
- The new "output node" option fails on the default case, when only one
  output node is active. It then shows often a blank menu. Will get fixed asap.
- When using a NodeTree-Texture as input node, the menu for 'active output'
  should not show. NodeTree should ignore other nodetrees to keep things sane
  for now.
- On a future todo is proper usage of "Dxt" and "Dyt" texture vectors for
  superior antialising of checkers/bricks.

General note; I know people are dying to get a full integrated shader system
with nodes. In theory we could merge this with Material Nodetrees... but I 
rather wait for a solid and very well thought out design proposal for this, 
also including design ideas for unifying with a shader language (GPU, CPU).
For the time being this is a nice extension of current textures. :)
2008-11-12 19:03:50 +00:00
22bcbc5742 fix for more disable python defines,
FTOCHAR didnt have brackets around the value. FTOCHAR(a+b) didnt work, FTOCHAR((a+b)) did.
2008-10-29 16:49:51 +00:00
5eb1d5e3dc Fix for bug #17593: glsl crash using a texture node without a
texture assigned.
2008-09-11 10:17:17 +00:00
cb89decfdc Merge of first part of changes from the apricot branch, especially
the features that are needed to run the game. Compile tested with
scons, make, but not cmake, that seems to have an issue not related
to these changes. The changes include:

* GLSL support in the viewport and game engine, enable in the game
  menu in textured draw mode.
* Synced and merged part of the duplicated blender and gameengine/
  gameplayer drawing code.
* Further refactoring of game engine drawing code, especially mesh
  storage changed a lot.
* Optimizations in game engine armatures to avoid recomputations.
* A python function to get the framerate estimate in game.

* An option take object color into account in materials.
* An option to restrict shadow casters to a lamp's layers.
* Increase from 10 to 18 texture slots for materials, lamps, word.
  An extra texture slot shows up once the last slot is used.

* Memory limit for undo, not enabled by default yet because it
  needs the .B.blend to be changed.
* Multiple undo for image painting.

* An offset for dupligroups, so not all objects in a group have to
  be at the origin.
2008-09-04 20:51:28 +00:00
bbe32118ef == Nodes ==
- "Memoryblock free: attempt to free NULL pointer" messages related to the Material node (Add->Input->Material). Deleting it and quitting Blender would bring 2 or 3 of these warnings. Trivial fix (check if NULL) in blenkernel/intern/node.c, though Nodes devs may be interested. Found while testing to fix the following bug:

== PyNodes ==

- Bug #11715 reported by Alexanter Feterman:

http://projects.blender.org/tracker/?func=detail&atid=125&aid=11715&group_id=9

Adding a Dynamic node and setting it to a pynode script would crash Blender if no Material Node (MatNode) was present.

Thanks Alexander for reporting and Brecht for assigning it to me.
2008-05-16 20:57:06 +00:00
9ea5788c37 == PyNodes ==
Bug #10104 reported by bebraw: missing check for how many node sockets were being created by a pynode script. Too many (more than MAX_SOCKET == 64) would crash Blender.

http://projects.blender.org/tracker/?func=detail&atid=125&aid=10104&group_id=9

Notes: moved the MAX_SOCKET define from node.c to BKE_node.h so I could use it in Node.c. Also improved error reporting in pynodes when errors occur in the init stage.

Thanks Juho (bebraw), Tom (assigned the bug to me) and Brecht (mentioned the MAX_SOCKET define).
2008-05-01 22:28:18 +00:00
db7457a6bb Fix for bug #6758: material nodes were not working correct with
ray mirror and transparency, was using the same stack for all
recursion depths, now creates new stacks as needed.

Fix for bug #8592: crash saving non-float image as 16bit tiff.
2008-03-17 20:57:16 +00:00
a748c244a2 Fix for bug #8560: grouping nodes could lead to multiple links to the
same input, if the nodes had been grouped separately before.
2008-03-16 20:49:10 +00:00
fcdf2d694f Fix for bug #8555: geometry node front/bake was broken.
Fix for bug #7418: texture ipo's didn't show for textures in node materials.
Fix for part of bug #6758: node materials in other node materials could
miss texture coordinates.
2008-03-14 18:08:27 +00:00
3c561ec216 Added an Alpha Convert compositor node, to convert between
premultiplied and key alpha.
2008-03-11 14:40:27 +00:00
d7ef04a519 Long on the wishlist, quite simple even, and there it finally is:
Compositor:
  Muting option to temporary disable/enable nodes.
  Hotkey: press M on selection. It toggles.

Note: no menu entry yet, and drawing style could be tweakered...
2008-03-08 19:02:08 +00:00
ed7156a258 Fix for bug #6747: make single button for node groups didn't work,
functionality was not implemented.
2008-02-24 22:27:40 +00:00
9615532ccb == Pynodes ==
1) Trying to bring back compatibility with Python2.3.
2) Adding some stubs to compile blender player again on linux.

Please tell me if Blender still doesn't compile with py 2.3 or if the player isn't compiling. There was a binreloc related stub I needed to add, so probably the player wasn't compiling before the pynodes commit.

Thanks PanzerMKZ for reporting and testing part of the fix to py 2.3.
2008-02-10 21:12:44 +00:00
Nathan Letwory
16514e3ddb * Merge of PyNodes to trunk. Finally!
See http://wiki.blender.org/index.php/BlenderDev/PyNodes and
  http://wiki.blender.org/index.php/BlenderDev/PyNodes/API
  For current documentation.

  Very very big thanks go to William Germano for fixing the memory issues left
  and for improving on the code.

  In the coming time documentation will be finalised and further stabilising
  of PyNodes is to be expected.
2008-02-09 23:17:15 +00:00
c8841a7f2f Added new render pass: "Mist".
This is actually just the alpha value as currently being calculated
by the mist code. It is in many cases not very useful to have this as
alpha in shading result, also for postprocess and composite.

Note: this pass also works with "Mist" not set in World, of course.
2008-01-19 11:17:12 +00:00
372ee054c0 Some notes for those who try to follow this :)
- first work on getting area/screen handling back
- added structure for where to put stuff, is still under
  review, wait a bit for docs?

Campbell is working on removing every bad level include from
sources, so we can safely rebuild the src/ directory.
2008-01-01 18:29:19 +00:00
f4015d9fce Bilateral Blur Node
Bilateral Blur node allows the user to blur images while retaining their
sharp edges. Blurring can be controlled by following controls:
*Iterations
*Color Sigma
*Space Sigma

Also image input to blur and a determinator image is provided. The node produces
a blurred image as its output.

The more iterations are provided, the smoother the result. Use color and space
sigmas to control the amount of blur. One way to use the determinator input is
to feed a mix (add) of Z and normal passes to it.

Examples of usage:
Ambient Occlusion smoothing - http://wiki.blender.org/index.php/Image:Bilateral_blur_example_01.blend
Blurry Refraction - http://wiki.blender.org/index.php/Image:Bilateral_blur_example_02.blend
Smoothed shadows and smoothed Ambient Occlusion combined - http://wiki.blender.org/index.php/Image:Bilateral_blur_example_03.blend

If you check out the examples, render the image and alter the values to see how 
they affect.

More information about the algorithm can be found at 
http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/MANDUCHI1/Bilateral_Filtering.html .

Thanks to Vilem Novak for contributing the patch.
2007-12-27 20:36:17 +00:00
8ddc48d32f Directional Blur Node
Directional Blur node allows the users to do various blur operations on the input 
image. It essentially offers three different kind of ways of blurring in one node.
It is possible to blur using a certain direction, spin and zoom. These three ways 
can be used in conjunction.

The node contains following controls:
*Iterations, Wrap
*Center: X, Y
*Distance, Angle
*Spin
*Zoom

Iterations is used to determine the smoothness of the result. The more iterations,
the smoother result. Low values are good for preview.

Wrap means that the image is wrapped as if it was tiled on both x and y directions.
To see better what this means, try it with spin for instance.

Center values (X and Y) determine the location which is used as a pivot point for
the operations. It is center (0.5) of the image by default.

Distance and angle are used to adjust directional blur. The result can be described
as a sweep that varies based on given distance (bigger distance, longer sweep) and
angle. Angle is given in degrees.

Spin produces rotating blur based on given angle. Yet again it is in degrees. Also
negative values work.

Zoom causes the image to be zoomed towards set center point (Center values).

Thanks to Alfredo de Greef (eeshlo) for contribution.

Possible development ideas:
*Make an algorithm to extend image in case spin is used. Extend would temporarily
change the size of the canvas of the input image. Canvas would be filled based on
colors on the edges of the input image. After the blur operation has been done,
the image would be cropped back to normal size. The advantage of this would be nicer
result of spin (no problems with image size) on a computational cost.
*Make values animatable. This is something that is better solved on more general
level. ("everything is animatable" paradigm)
*Provide an option to calculate automatic value for iterations. A good value that
produces a smooth result could be calculated based on direction deltas. This would be
useful in conjuction of animatable values.
2007-12-27 14:19:11 +00:00
d06dc00af9 Toggle links tool for Node Editor
This commit adds a new tool, Toggle Links, to the node editor. This tool
allows the user to toggle the status (linked/not linked) between desired
sockets. The tool can be used either by using the f key or the menus.

This functionality is analogue to one found in object editing modes except
for its additional toggle functionality.

To use this tool, the user has to first select an input and an output socket.
Selecting is done by clicking with right mouse button on a socket. After the 
tool has been invoked, the link between those two sockets is toggled. The 
result may vary based on existing linkage.

There can be only one input and one output selected at maximum in a node 
tree. This means that if the user selects a socket while one of the same 
type is already selected, the old one will be deselected.

The tool complements the current way of connecting nodes. One possible use
for it is to use it to review output of nodes by using a viewer node. Just
select wanted input socket of a viewer node, set it visible and use selection 
of an output socket in conjuction with f key to show the output in the viewer
node. Select another output and hit f to see its output and so on.
2007-12-27 10:17:33 +00:00
d6db819a83 Crop Compositing Node:
This commit adds a new node, crop, to the compositor. This node can be used to
crop input image. It has two modes of operation. It can either crop image
size (Crop Image Size option) or crop while retaining original size of the
image. This latter mode can be used to preview the crop.

Use X1, Y1, X2, Y2 controls to manage the area to be cropped.

Note that I added a check for image preview min and max values to node_update.
This is because it could give inappropriate values in certain cases when
Crop Image Size option was toggled (values such as x1=0, y1=0, x2=60, y2=0 would
result in eternal loop due to bad min and max (min bigger than max!)). The check 
makes sure that min and max values are always valid.
2007-10-29 14:37:19 +00:00
2a2453d3e2 nodes from eechlo
* glare
* tonemap
* lense distort
* fast gauss blur

http://projects.blender.org/tracker/?func=detail&atid=127&aid=7505&group_id=9

made fast gauss blur an option for the blur node rather then a separate node.
2007-10-26 15:32:36 +00:00
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