Commit Graph

90 Commits

Author SHA1 Message Date
22149c95ba Bugfix: the defocus node "no zbuffer" settings was automatically set
if there was no zbuffer input. However this means a user settings can
be permanently changed without a user knowing. Now it just runs as if
this option is set if there is no zbuffer, but doesn't change the
setting.
2008-04-01 11:08:48 +00:00
753a0e9746 Tweaks to labels on brightness/contrast node 2008-03-25 06:10:03 +00:00
f48c8dea16 Fix for bug #8582: compositor math node did not output any result
without input connections.
2008-03-16 20:04:41 +00:00
dae503187c == PyNodes ==
Ongoing updates to the Blender.Node Python API:

- Changed Blender.Node.node to Blender.Node.Scripted to be more specific and conform to bpython API.
- Added a Blender.Node.Socket type to be used to define node sockets in a PyNode script. Also, socket type is inferred from the value(s) passed in, instead of also being defined by the script author.
- Added attr access to input and output sockets in the __call__ method. Ex: an input socket called 'color' can be accessed as self.input.color now.

These changes break existing pynode scripts, which shouldn't be a problem yet, of course, since we're still finishing this feature for 2.46. The wiki page and sample .blends have already been updated:

http://wiki.blender.org/index.php/BlenderDev/PyNodes
http://wiki.blender.org/index.php/BlenderDev/PyNodes/API
2008-03-16 17:24:29 +00:00
Stephen Swaney
bb48a75c37 compiler warning cleanup 2008-03-15 14:41:47 +00:00
e625266162 Fix for bug #8385: vector inputs of texture node in the compositor did
not work correct, it should use bNodeStack inputs like other nodes.
2008-03-13 11:26:18 +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
274543627a Fix segfault with bad setting in the Image node.
The limit in the UI tooltips to set the amount of
images used in animation allow the zero value,
that cause a segfault.

This commit fix the UI, add a init value of 1 to
the node and also check in case that
node_composit_get_image return NULL.
2008-02-28 20:26:00 +00:00
6f78c1371d Bugfix: compositor Blur node Bokeh option gave wrong results at the
bottom pixels of the image.
2008-02-28 15:23:44 +00:00
Nathan Letwory
012f0a336c === PyNodes ===
* Make PyNodes work with threaded renderer. This patch is by Willian. He has worked hard on getting this sorted out - now you should be able to render with PyNodes AND multiple threads.
2008-02-23 12:05:28 +00:00
0e233b3213 =Reversion of premul bugfix=
Reversion of premul bugfix, as it was apparently not
working all that well.

Note that this brings back the bug where the erase alpha
paint tool won't display correctly, since the UV image
editor just draws images in key alpha now.
2008-02-22 22:23:58 +00:00
2283bdc09b Possible fix for bug #6922: crash in displace compositor node,
possibly because it didn't handle the vector input correct if
it was translated.
2008-02-19 20:35:19 +00:00
ccac67d3ea Further work on the premul option for ton. This option
(which basically tells the renderer and compositor to expect a
key image) is now done at the image user level.

This does have some caveats, as image users don't always work
the way I thought they would/should (for example, the same image user
structure is apparently used in the uv image editor for all images,
which is kindof odd).

The UV image editor also now smartly detects if the premul option is
set and draws the image using key alpha, instead of premul

The subversion level was upped to convert the old premul flag, which was at
the image level, to the new one, which is at the image user level.
2008-02-18 23:50:12 +00:00
331559d585 Bugfix for defocus node gamma correct. It applied gamma correct to
a premul image but that doesn't work correct. Now it depremuls and
premuls again around the gamma correction. Better solution might be
possible, but this gives compatible results.
2008-02-18 15:21:59 +00:00
0ef89331e2 Fix for theoretical memory leak. Oddly this leak didn't seem
to be happening, but might as well fix it anyway.
2008-02-15 09:42:25 +00:00
58046762f8 1) Revert previous commit, rendering negative won't work that simple...
Needs much more attention.
2) Fix for zcombine node: 
   - it skipped execution when no image rgba out was used
   - didnt work for FSA yet
2008-02-14 18:56:14 +00:00
4b784f4311 stupid me! if you move var declarations sometimes you have to add
assignments outside of the var declarations!
2008-02-14 15:14:01 +00:00
09cb8a9f42 in my tiredness I didn't declare some vars at the top of the block. 2008-02-14 14:57:41 +00:00
ac5d28a13c Added another 2 checks for if an image has the premul flag set, 1 in the image
compositor node, another in render_realtime_texture.  Note that multilayer images 
in the image compositor node do not respect the premul flag (though I did write 
commented out code for it).

As far as I can tell, the premul option never worked for multilayer images in the
image node, so I'm a little nervous about making it work properly there.

ton, any comments?
2008-02-14 13:36:59 +00:00
e26b5aa9c4 * fix for [#8085] Glare node crashes on inputs with < 4 colour channels
I had this assigned to Alfredo for a while, but he hasn't replied to the tracker at all, so I suspect he's not around. I'll commit this now to prevent crashes.

Some of the code in the glare node assumed that all buffers will be 4 channel RGBA, when in fact it was possible to give it a VEC3, such as a spec pass with no alpha, which would crash it. This fix just duplicates the input to a new temporary RGBA buffer to work on, if it's not already RGBA.
2008-02-13 13:36:35 +00:00
Nathan Letwory
df0d81f3c7 * fix provided by Stefan Birgmeier (qwequ777): int pos may lead to crashes on 64-bit systems. PyDict_Next takes a Py_ssize_t, not an int (tsk tsk). 2008-02-12 18:56:32 +00:00
66e69965b1 Bugfix: when defocus node had nothing to do and just passed on the buffer,
it didn't correctly deal with pointers, gave a crash in some circumstances.
2008-02-12 15:34:26 +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
a7702e3d94 * make CMake compile again (after pynodes addition). Patch provided by skejoe. 2008-02-10 20:50:50 +00:00
a4e27a689a added PyNode includes for Makefiles 2008-02-10 20:16:35 +00:00
Nathan Letwory
9d7ef684e3 * remove redundant define. 2008-02-10 18:48:29 +00:00
f46fcf7aab == PyNodes ==
1) Including the Add->Dynamic submenu in the Nodes window header. Previously pynodes could only be added via toolbox.
2) Disabling pynodes execution when using more than one thread for rendering. This prevents the crashes while a proper fix isn't implemented.
2008-02-10 03:40:24 +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
f11ea1eb8e Bugfix for recent alphaover premul commit, crashed existing files
and on adding a new node, maybe the commit was incomplete?
2008-02-04 21:17:15 +00:00
b018f64a50 AlphaOver node feature: "Premul" slider allows to mix between the
using alpha as premul or nonpremul. Quite useful for brightness
tweaks.

Todo: version-patch this so ConvertPremul button goes away
Todo: make entire compositer accept non-premul by default... or both
2008-02-04 18:37:40 +00:00
703f248ab4 New rendering option: FSA!
This completes the pipeline make-over, as started in 2006. With this
option, during rendering, each sample for every layer and pass is being
saved on disk (looks like non-antialiased images). Then the composite 
and color correction happens, then a clip to 0-1 range, and only in end 
all samples get combined - using sampling filters such as gauss/mitch/catmul.

This results in artefact-free antialiased images. Even Z-combine or
ID masks now work perfect for it! 

This is an unfinished commit btw; Brecht will finish this for strands.
Also Halo doesnt work yet.

To activate FSA: press "Save Buffers" and the new button next to it. :)
2008-01-28 16:33:59 +00:00
d11cd3108b * Fix for bilateral blur node
The 'Determinator' input didn't work at all - there was some quite weird code in there. I think the patch review process could have been quite a bit better on this one.
2008-01-22 06:27:27 +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
adc68be1a8 Blur Node to support Relative (percent) values
This commit makes it possible to use relative values when using a Blur node. There
is a new toggle in the node that can be used to enable the feature.

Thanks to David Millan Escriva for contribution!
2008-01-07 15:44:45 +00:00
011e0a93dd Black and White level inputs to RGB Curves compositing node
This commit adds possibility to define black and white level of the
mapping curve of the RGB Curves node. This functionality is exactly
the same found in the Curves tool of the UV/Image Editor. It can be
used to extract wanted color ranges out of the input easily.

Thanks to Björn C. Schaefer for contribution!
2008-01-07 13:55:48 +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
460dd7a7bb Render Instancing
=================

Big commit, but little user visible changes.

- Dupliverts and duplifaces are now rendered as instances, instead
  of storing all of the geometry for each dupli, now an instance is
  created with a matrix transform refering to the source object.
  This should allow us to render tree leaves more memory efficient.

- Radiosity and to some degree raytracing of such objects is not
  really efficient still. For radiosity this is fundamentally hard
  to solve, but raytracing an octree could be created for each object,
  but the current octree code with it's fixed size doesn't allow this
  efficiently.

- The regression tests survived, but with I expect that some bugs will
  pop up .. hopefully not too many :).

Implementation Notes
====================

- Dupligroups and linked meshes are not rendered as instances yet,
  since they can in fact be different due to various reasons,
  instancing of these types of duplis that are the same can be added
  for them at a later point.

- Each ObjectRen now stores it's own database, instead of there being
  one big databases of faces, verts, .. . Which objects that are actually
  rendered are defined by the list of ObjectRenInstances, which all refer
  to an ObjectRen.

- Homogeneous coordinatess and clipping is now not stored in vertices
  anymore, but instead computed on the fly. This couldn't work for
  instances. That does mean some extra computation has to be done, but
  memory lookups can be slow too, and this saves some memory. Overall
  I didn't find a significant speed impact.

- OSA rendering for solid and ztransp now is different. Instead of e.g.
  going 8 times over the databases times and rendering the z-buffer, it
  now goes over the database once and renders each polygon 8 times. That
  was necessary to keep instances efficient, and can also give some
  performance improvement without instances.

- There was already instancing support in the yafray export code, now it
  uses Blender's render instances for export.

- UV and color layer storage in the render was a bit messy before, now
  should be easier to understand.

- convertblender.c was reorganized somewhat. Regular render, speedvector
  and baking now use a single function to create the database, previously
  there was code duplicated for it.

- Some of these changes were done with future multithreading of scene
  and shadow buffer creation in mind, though especially for scene creation
  much work remains to be done to make it threadsafe, since it also involves
  a lot of code from blenkernel, and there is an ugly conflict with the way
  dupli groups work here .. though in the render code itself it's almost there.
2007-12-15 20:41:45 +00:00
7b2e348d4f This is a modified version of this patch:
[#7660] Solaris 10 x86 support (Makefiles)

Hopefully it will not mess up anything for anyone else.  I removed
some hardcoded static libs and made NAN_*_LIB definitions so they could be 
overridden, to allow greater flexability.

Let me know if there are any problems/questions.

Kent
2007-12-05 16:58:52 +00:00
ab2e2ec34b == MSVC 7.1 projectfiles ==
- update for new particle system
- made blenderplayer.exe compile again (DDS library missing)
- exchanged a few float math functions (logf, sinf, cosf, expf, powf) with their double counterparts in CMP_nodes 
  (MSVC chokes on them, because the compiler is not C99 compliant)
2007-11-27 21:48:14 +00:00
a1c5b3b51d * New feature on compo scale node: "Scene Size %"
This option sets the relative scaling factor to the amount set in the 
scene "100%/75%/50%/25%" buttons. It's useful when you've got a fixed 
background image, and want to do preview renders at a lesser 
percentage, so you don't have to go and change the scale node each 
time you change the %.

Also removed unnecessary use of a global from texture node.
2007-11-13 23:53:58 +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
ddb8120e03 fix for msvc 2007-10-26 22:11:08 +00:00
Ken Hughes
38e7c267a6 Replace ceilf()/floorf() with ceil()/floor() to fix VC7 compilation problems
reported by Stephane Soppera.
2007-10-26 20:04:04 +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
091d1e15a9 * Change/fix to texture comp node
Previously if the texture node was not connected directly as the 
second input to a node like Mix, the size of the generated image 
was initialised to 140x140, which is not that useful. It now is 
initialised to the size of the render result if it exists, and if 
not, the size of the scene render sizeX/sizeY.

This alleviates bug #7068, which is caused by the displace node 
trying to get pixels from a texture node, where the texture node 
doesn't contain pixels to cover the entire image (only 140x140) 
but it's not really a bulletproof solution...
2007-09-24 02:18:00 +00:00
0096d180b9 Dof Object - set the depth of field to an object - set in the camera edit panel but the distance is calculated on the camera object only so linked cameras work.
Alt+Period - sets active pivot

some tooltips didnt make much sense, edited a few.
2007-09-23 18:27:01 +00:00
f0995e87b5 fix svn properties for line endings
fix a few no newlines at end of file warnings
2007-09-05 17:55:44 +00:00
6cd6bf7d80 Updated the Makefiles removing some of the gcc specific stuff...
Basically I moved  -funsigned-char -fno-strict-aliasing
from individual Makefiles to nan_compile.mk defines for CFLAGS and CCFLAGS

Kent
2007-08-31 16:16:33 +00:00