Commit Graph

137 Commits

Author SHA1 Message Date
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
ec26abd2db Cycles: svn merge -r37957:39132 https://svn.blender.org/svnroot/bf-blender/trunk/blender 2011-08-07 13:21:04 +00:00
Jeroen Bakker
830fe8af84 Updated the indent, sorry! 2011-07-04 19:22:37 +00:00
Jeroen Bakker
e814f2c71d ====== Proposal: Nodes property windows enhancement ======
===== Situation before this patch =====

in the current situation inside the node editor there is a properties panel (press 'n'-key). This pabel displays some information about the node, backdrop and grease pencil. The UI of the property panel is typically vertical oriented. Nodes in the other hand are not oriented in a direction. Both area's are draw via the same draw function.

With some nodes this will create not user-friendly UI. Try the color-balance for instance). The 3 color circles are drawn next to each other, it would be better to draw them below each other.

When creating more complex nodes you don't want to display all handles in the node-panel and in the properties panel. For instance fine-tuning handles you only want to appear in the property panel to reduce place in the node itself.

===== Situation after this patch  =====

This patch separates the draw functions of the property panel and the node panel.
When no special draw function is created for the property panel, the draw function of the node will be used as 'fallback'

===== Impact =====

==== BKE_node.h ====

add a new uifunc (called uifuncbut) to the bNodeType struct. The definition is the same as the uifunc.

==== node_buttons.c ====

if the uifuncbut is set, call it. currently calls the uifunc method

==== drawnode.c ====

static void node_composit_set_butfunc(bNodeType *ntype). set the uifuncbut function where needed. When at the end of the method uifuncbut is still empty, set uifuncbut to the uifunc. 

===== Final note =====

! PS. this is not limited to the compositor it also works for Materials and Textures !
! PPS. For other branching creating their own node-tree. Please make sure that your uifuncbut is set NULL or a valid draw function !
2011-07-04 18:48:36 +00:00
Jeroen Bakker
c4491f558b Current situation
A mesh can consist out of multiple material. Take a character with clothing's. the skin can be a different material as the different clothing's. During compositing it is a common use-case to only do a part of the composit on only a specific material. Currently this can not be done.

In blender movies this feature is known to be implemented, but until now it never got integrated into trunk.
Proposal

With material index the Blender internal renderer will be capable of creating a buffer containing the material indexes of the first pixel-hit. This will be implemented in the same manner as the object index.

In the compositor the ID Mask node can be used to extract the information out of the Render pass.
Impact
User interface

On the properties-space the next changes will be done

    Scene⇒Render layer⇒Passes⇒Material index will be added
    Material⇒Options⇒Pass index will be added

DNA

    Material struct will get an new field called “index”. this will be a short-type.
    Material struct the field pad will be removed.
    A new Render-layer pass will be added (bit 1«18)

RNA

    Material RNA is updated (based on “pass index” from object)
    Render layer RNA is updated (based on IndexOB)

Blender internal renderer

The Blender internal renderer will process the render pass as a copy of the Object index.
Blender compositor

The render layer input will get a new output socket called “IndexMA”
Usage

An example on how to use material index can be found at:

https://svn.blender.org/svnroot/bf-blender/trunk/lib/tests/compositing/composite_materialindex.blend

This is also example of a commit message longer than the commit itself :)
2011-07-04 18:14:41 +00:00
Brecht Van Lommel
1cf0af703d Cycles: working towards texture workflow design
http://wiki.blender.org/index.php/Dev:2.5/Source/Render/TextureWorkflow

* Added "active texture node" in shading node trees.
* Texture draw mode draw active texture node now, and new Material draw
  mode shows GLSL material.
* GLSL materials now match solid draw mode lighting better.
* Texture properties can now texture nodes from material/world/lamp.
2011-06-27 17:10:50 +00:00
Brecht Van Lommel
a5c6f3d53b Cycles: more work on texturing UI, now texture nodes use same nodes as shading,
only rough implementation for design proposal.
2011-06-14 16:05:21 +00:00
Brecht Van Lommel
4e235c184b Blender modifications for Cycles integration.
Some notes about code status:

* The Blender modifications were fairly quickly put together, much more code
  polish and work is needed to get this to a state where it can be committed
  to trunk. Files created with this version may not work in future versions.

* Only simple path tracing is supported currently, but we intend to provide
  finer control, and more options where it makes sense.

* For GPU rendering, only CUDA works currently. The intention is to have the
  same kernel code compile for C++/OpenCL/CUDA, some more work is needed to
  get OpenCL functional.

* There are two shading backends: GPU compatible and Open Shading Language.
  Unfortunately, OSL only runs on the CPU currently, getting this to run on
  the GPU would be a major undertaking, and is unlikely to be supported soon.
  Additionally, it's not possible yet to write custom OSL shaders.

* There is some code for adaptive subdivision and displacement, but it's far
  from finished. The intention is to eventually have a nice unified bump and
  displacement system.

* The code currently has a number of fairly heavy dependencies: Boost,
  OpenImageIO, GLEW, GLUT, and optionally OSL, Partio. This makes it difficult
  to compile, we'll try to eliminate some, it may take a while before it
  becomes easy to compile this.
2011-04-27 14:36:02 +00:00
Ton Roosendaal
daff7a447e Bugfix #26388
Actually a todo item I forgot:

Material nodes previews now follow the scene "color managenent"
setting.
2011-03-07 11:51:09 +00:00
Lukas Toenne
e7750aa6ed Convenience fix: Exposing internal sockets now copies the default input value to the group sockets. The "expose" function on group inputs/outputs has an optional parameter "add_link", which can be used to prevent the automatic linking. 2011-02-22 20:49:34 +00:00
Lukas Toenne
b3c60ef3ea Added RNA functions to group tree inputs/outputs for exposing internal sockets or adding custom sockets by name and type (fixes #26171). Changed a few function names for groups for consistency. 2011-02-22 20:24:06 +00:00
Lukas Toenne
1c7a422f78 Big node groups improvement patch. Node group trees now have their own lists of input/output sockets. Those can be linked to internal nodes just like links between regular nodes. In addition group sockets can be renamed and have a defined order, which can be modified, and they can be removed again.
More details can be found in the patch tracker description (#24883) and on the code.blender.org development blog.
2011-02-21 13:47:49 +00:00
Nathan Letwory
22638e22ea doxygen: blenkernel under core as module. 2011-02-18 13:05:18 +00:00
Lukas Toenne
69e72ea427 Removed the internal_select parameter from ntreeCopyTree. This was used just in one place when duplicating nodes, which is not an actual copying of the tree. The node duplicate operator now copies selected nodes itself. 2011-02-11 09:37:58 +00:00
Lukas Toenne
24db3d17aa Per-type node labels and customizable names. The label displayed in the node header is now by default the node type string. A custom label callback can be implemented to display more detailed information. This is currently used by group nodes, which display their internal tree name, and math, vector math, mix and filter nodes, which use their internal operation sub-type. Also the node tree selection/naming box for groups is now displayed only on open groups, to make it clearer that this is the internal type of the group and get a cleaner main tree. 2011-02-08 12:54:32 +00:00
Lukas Toenne
37f55ec194 Group node type info is now also initialized with helper functions. 2011-02-08 09:14:18 +00:00
Lukas Toenne
803c7fb4d4 Finished the node type definition cleanup started in r34682. All static node types should now use the node_type_* definition helpers to initialize their bNodeType structs. 2011-02-08 09:02:16 +00:00
Ton Roosendaal
5c421c328e Todo/feature request
When using masks or other simple 3D elements in composites, doing
a layer re-rendering on a node is a bit clumsy all the time.

This commit does two things to help:
- new hotkey "Z" in node editor automatically finds render layer
  that changed and re-renders it + composites
- option "Auto Render" does same, but then after every transform
  edit in 3D window

The latter is experimental; real & proper system for this requires
full threaded render support (like previews). But it works!

Demo file:
http://download.blender.org/demo/test/auto_composite.blend

Important fix:
After any render, all the render layers were tagged "changed", which
caused any edit to first totally recomposte everthing. Now it only
composites changes.

Implementation notes

- DAG scene flush now sets 'changed' flags in render layer nodes
- Added notifier for 'transform finished' to trigger the update,
  this is temporarily.
2011-02-07 16:41:57 +00:00
Lukas Toenne
2070356a32 A simplified way of defining bNodeType structs. Instead of doing full struct member initialization for each node, this uses a couple of helper functions now. This will make it easier to change and extend the bNodeSocket interface in the future. Two examples (normal and mapping shader nodes) included, the rest should be converted too. 2011-02-07 09:33:36 +00:00
Campbell Barton
fa4bbbb249 Maintenance,
- remove some redundant declarations
- changed VertexTangent and Path structs to avoid compiler alignment padding.
2010-12-04 13:00:28 +00:00
Campbell Barton
263830f000 Enabled GCC -Wwrite-strings warning for CMake and replaced many 'char's for 'const char's,.
Only one functional change where Transform orientations passed "" to BIF_createTransformOrientation() which could then have the value written into.
2010-12-03 17:05:21 +00:00
Campbell Barton
cfc1b133f6 updates to patch from Dan Eicher, allow adding a NodeGroup through bpy.data.node_groups.new(name, type)
made some minor changes.
2010-12-03 03:44:39 +00:00
Campbell Barton
bd5a62cfcb bugfix [#23068] Image editor: Update Automatically not updating the compositor.
[#23637] Replacing an image used in the compositor crashes
       [#23343] changes in images doesn't update compositor image nodes
2010-09-13 06:08:26 +00:00
Campbell Barton
8c75853bb6 bugfix [#23164] Copied Scene Nodes!
copying a scene would still have nodes point back to the old scene which would crash (in some cases) or break rendering.
2010-08-05 10:50:38 +00:00
Campbell Barton
708ef64663 include cleanup, no functional changes
- removed DNA_brush_types.h from DNA_scene_types.h (and some other similar cases)
- removed DNA_wave_types.h (never used)
- removed Main.wave
2010-08-04 04:01:27 +00:00
Diego Borghetti
24f63b2081 New option for Scale node.
This is because problem reported by venomgfx on the irc.
If you have a render of 2k with a render size of 25% (and this
problem is for any resolution/size) and you try to use a image
of 1k in the compo, the first thing you do is put a scale node.

Here come the problem, if you set the option "Scene Size" in the
node scale, the buffer output is not the same size that the render.

This is because the "Scene size" work with the image size and
not the render size, so in this case is the 25% of 1k.. not
the 25% 2k.

So this new option "Render Size" scale the output buffer to the
render resolution, taking into account the render size (percentage) too.
2010-07-08 20:58:34 +00:00
Brecht Van Lommel
353a078d4c Fix #21211: new indirect/environment/emit passes weren't showing up
in compositor and outliner yet.
2010-03-12 12:29:12 +00:00
Brecht Van Lommel
bd638da9a0 Texture Nodes:
* Remove the manual OSA method but rather pass on derivatives to the
  textures. This means that at the moment e.g. the bricks node is not
  antialiased, but that image textures are now using mipmaps. Doing
  oversampling on the whole nodetree is convenient but it is really
  the individual textures that can do filtering best and quickest.
* Image textures in a texture node tree were not color corrected and
  did not support 2d mapping, now it's passing along shadeinput to
  make this possible. Would like to avoid this but not sure how.
* Fix preview not filling in all pixels when scaling or rotating in
  the texture nodes.
2010-02-16 15:45:19 +00:00
Campbell Barton
081c1205a3 correct fsf address 2010-02-12 13:34:04 +00:00
Matt Ebb
3e1783c715 New Compositor node: Hue Control
Was very quick to do, now re-aquainted with node editor.

http://mke3.net/blender/devel/2.5/hue_correct_node.jpg

Todo: modes for affecting hue and value on the vertical axis as well as just saturation - or if an enterprising coder wants to give it a go, let me know and 
I can help :)
2010-01-21 00:00:45 +00:00
Matt Ebb
1d3186cbcf Durian request: Added 'Color Balance' node to compositor. uses Lift/Gamma/Gain
similar to sequence editor.

--> http://mke3.net/blender/devel/2.5/color_balance_node.jpg

Also added 0 key (zero key) shortcut when mouse is over a button, to reset it to its default value.
Same as the RMB menu ->Reset to Default, except for color wheels, it only resets the hue/sat/value
components that that widget affects.

Peter/Xavier: The existing color balance code can generate NaNs (fractional power of a negative),
which causes havoc along the image pipeline. I added a check in the node code to prevent this.

Still plenty of potential for lots of better colour correction tools in the compositor, just needs time...
2010-01-20 04:19:55 +00:00
Matt Ebb
7a67b662bd * Tweaks for node editor Make Links (F key)
Testing a new method that hopefully will be faster to use than finicky socket 
selection - now just select multiple nodes and press F - available output sockets 
on the selected nodes will get automatically connected to the active node.

It works for one socket type each time, to avoid getting lots of extra connections 
when you join up, but as a shortcut you can easily press F again to connect up 
other socket types. For example, to connect a render layer node (with vector pass) 
to a vector blur node, select the render layer then the vector blur, and press F 
three times to connect up the Image, Z and Vector sockets. It now also 
preferences sockets with the same name to connect up first.

There's also another option (ctrl F) which will replace existing input links, rather 
than only connecting up links to available input sockets.


* Also changed socket link knife cut to a more convenient shortcut - Ctrl LMB tweak
2010-01-04 04:26:28 +00:00
Matt Ebb
fac65a3f4d Durian request:
Extend the 'only selected' property in the graph editor to only show curves
from selected sequence strips and nodes as well.
2009-12-17 04:55:15 +00:00
Matt Ebb
c0fae59c99 * Fixed nodetree animation by giving nodes unique names
Now the rna path to nodes happens via the node name, which is ensured to be unique via RNA.
As part of this, the node->username string has been removed, upon renaming the node itself it takes care of making sure it's unique (like bones, constraints, etc). There's currently no interactive rename tool, but you can do it via the datablocks editor.

- plus a few notifier tweaks, using the newer NC_NODE notifier to refresh graph editor etc.
2009-11-11 09:11:21 +00:00
Matt Ebb
bc006655ba * Finished (well, almost ;) RNA wrapping and layout-engine-ing all the nodes.
Still a few quirks, including redraw issues on multilayer image input nodes, but it's pretty much there.
Would also be good to wrap the input/output sockets, too, will check on it.

This fixes bug [#19740] INPUT NODE: Cannot load images / motion pictures
2009-11-10 04:01:44 +00:00
Campbell Barton
8d54982f37 Material buttons now view the active node material shading settings.
Selecting a material in the node tree sets this as the active material and the buttons view redraws.

Added rna prop material.active_node_material

Currently its not clear what settings are used by the node material and the base material (needs some tedious research) so I made most panels use the node material with the exceptions of volumetrics, physics and halo settings.

We'll probably need to split the panels up to do this properly.
2009-10-06 15:31:25 +00:00
Brecht Van Lommel
15d07720e5 Sorry, three commits in one, became difficult to untangle..
Editors Modules

* render/ module added in editors, moved the preview render code there and
  also shading related operators.
* physics/ module made more consistent with other modules. renaming files,
  making a single physics_ops.c for operators and keymaps. Also move all
  particle related operators here now.
* space_buttons/ now should have only operators relevant to the buttons
  specificially.

Updates & Notifiers

* Material/Texture/World/Lamp can now be passed to DAG_id_flush_update,
  which will go back to a callback in editors. Eventually these should
  be in the depsgraph itself, but for now this gives a unified call for
  doing updates.
* GLSL materials are now refreshed on changes. There's still various
  cases missing, 
* Preview icons now hook into this system, solving various update cases
  that were missed before.
* Also fixes issue in my last commit, where some preview would not render,
  problem is avoided in the new system.

Icon Rendering

* On systems with support for non-power of two textures, an OpenGL texture
  is now used instead of glDrawPixels. This avoids problems with icons get
  clipped on region borders. On my Linux desktop, this gives an 1.1x speedup,
  and on my Mac laptop a 2.3x speedup overall in redrawing the full window,
  with the default setup. The glDrawPixels implementation on Mac seems to
  have a lot of overhread.
* Preview icons are now drawn using proper premul alpha, and never faded so
  you can see them clearly.
* Also tried to fix issue with texture node preview rendering, globals can't
  be used with threads reliably.
2009-09-29 19:12:12 +00:00
Brecht Van Lommel
5129b08064 UI
* Node buttons can now use the layout engine. a few simple
  ones are converted. We'll keep this code in C for now,
  python wouldn't help much here.
* For node buttons not using the layout engine, manually
  computing the button height is not longer needed.
* Node inputs are still not RNA wrapped, would be good to
  have these available as well for keying, but makesrna does
  not have access to the bNodeTypes.
2009-09-16 18:59:13 +00:00
Robert Holcomb
fa4ee2be84 Added Levels Node (histogram, with mean/std deviation outputs)
Added RGB space distance matte Node
Added HSV color matte Node

Fixed Image difference matte Node to use image differences instead of RGB space distance
Fixed luminance node for low end values being read wrong
Fixed CMP_util copy/swap functions not accounting for all channels
Fixed UI for difference matte Node 

Added RNA for new nodes
2009-09-10 04:12:22 +00:00
Robin Allen
792d526489 More texnode preview fixes. Previews now have correct aspect ratio and are drawn by the renderer. 2009-08-19 15:45:16 +00:00
Robin Allen
f9ceeeede6 Slight refactor of texture nodes.
Delegates now receive a TexParams* instead of float *coords. This gives texture nodes access to dxt, dyt, cfra as well as coords. This fixes the time node and allows nice sampling to be implemented.
2009-08-17 20:30:11 +00:00
Brecht Van Lommel
9059639df4 2.5: Screen/Scene New/Delete operators.
Implementation Note:
* Moved the scene copy/unlink code back into blenkernel, with
  the exception of the copy single user stuff which is still in
  object_edit.c.
* Uses SCREENDELETE notifier like SCREENBROWSE, seems only clean
  way to do this now.
2009-08-15 16:43:03 +00:00
Campbell Barton
a1cf7988c1 svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r20855:20928
Sequencer changes from source/blender/src coming next
2009-06-16 14:21:58 +00:00
Robin Allen
c4ad2ed253 Omission of a texture node to specify coordinates was regarded as a bug by some users. I rather agree :) 2009-06-13 14:22:40 +00:00
Robin Allen
5d48e04307 Renumbered the texture nodes because they were clashing with the other nodes.
This will break compatibility with previous texnode testing builds (but not
with any released versions)
2009-03-24 18:51:21 +00:00
Robin Allen
51ce279300 Started wrapping nodes in RNA. Only shader nodes have all their options wrapped;
TEX and CMP to follow.

Also, renumbered the texture nodes because when I first wrote them I thought
they could share ID numbers with the SH and CMP nodes. D'oh!
2009-03-24 17:40:58 +00:00
Brecht Van Lommel
d52400bfbd 2.50: svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r18677:19317
Notes:
* Sequence transform strip uses G.scene global, this is commented
  out now, should be fixed.
* Etch-a-ton code was most difficult to merge. The files already in
  2.5 got merged, but no new files were added. Calls to these files
  are commented out with "XXX etch-a-ton". editarmature.c and
  transform_snap.c were complex to merge. Martin, please check?
* Game engine compiles and links again here for scons/make/cmake
  (player still fails to link).
2009-03-17 21:44:58 +00:00
Robin Allen
09099111e3 Added Scale, fixed bugs incl. patch #18037 2009-02-06 18:09:35 +00:00
Ton Roosendaal
14f180fa04 2.5
Node editor: 

- Linking sockets back.
- Removed obsolete code 
- Add node gives correct pointers for Render stuff
2009-02-06 16:34:05 +00:00
Robin Allen
6a669d00b2 Patch #18015, adds "Value to Normal" node 2009-02-06 01:21:38 +00:00