Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2014-04-17Style cleanupCampbell Barton
2014-04-16Fix for half pixel offset rasterizing masksCampbell Barton
2014-04-15Building with C++ guarded alloc works againCampbell Barton
2014-04-15Structural cleanup and improvements for the compositor.Lukas Tönne
Many parts of the compositor are unnecessarily complicated. This patch aims at reducing the complexity of writing nodes and making the code more transparent. == Separating Nodes and Operations == Currently these are both mixed in the same graph, even though they have very different purposes and are used at distinct stages in the compositing process. The patch introduces dedicated graph classes for nodes and for operations. This removes the need for a lot of special case checks (isOperation etc.) and explicit type casts. It simplifies the code since it becomes clear at every stage what type of node we are dealing with. The compiler can use static typing to avoid common bugs from mixing up these types and fewer runtime sanity checks are needed. == Simplified Node Conversion == Converting nodes to operations was previously based on "relinking", i.e. nodes would start with by mirroring links in the Blender DNA node trees, then add operations and redirect these links to them. This was very hard to follow in many cases and required a lot of attention to avoid invalid states. Now there is a helper class called the NodeConverter, which is passed to nodes and implements a much simpler API for this process. Nodes can add operations and explicit connections as before, but defining "external" links to the inputs/outputs of the original node now uses mapping instead of directly modifying link data. Input data (node graph) and result (operations graph) are cleanly separated. == Removed Redundant Data Structures == A few redundant data structures have been removed, notably the SocketConnection. These are only needed temporarily during graph construction. For executing the compositor operations it is perfectly sufficient to store only the direct input link pointers. A common pointer indirection is avoided this way (which might also give a little performance improvement). == Avoid virtual recursive functions == Recursive virtual functions are evil. They are very hard to follow during debugging. At least in the parts this patch is concerned with these functions have been replaced by a non-virtual recursive core function (which might then call virtual non-recursive functions if needed). See for example NodeOperationBuilder::group_operations.
2014-04-14Fix T39700: Plane deform still works foreverSergey Sharybin
Clamped the EWA sampling region to buffer size now. Solves the issue, but needs more tests to be sure weights are correct.
2014-04-11Fix T39206: Plane deform works incredibly slowSergey Sharybin
The issue was caused by the readEWA spending loads of time trying to sample regions outside of the buffer.Solved by adding an early exit check. We could also clamp the sampling region to the rect, but it's not so much clear whether weight will be correct in such case so left it for the future.
2014-04-05Fix issue for OPENCL problem on Macosx 10.9.2Monique Dewanchand
2014-04-01Code cleanup: remove TRUE/FALSE & WITH_BOOL_COMPAT defineCampbell Barton
2014-03-27T39307: The fast gaussian blur is not an accurate formula. When decidingJeroen Bakker
which tiles are selected for input there was always a constant for correcting the accuracy. It seems that the constant was not enough and has been adjusted. (2 => 3).
2014-03-19Code cleanup: double/floatCampbell Barton
2014-03-18Code cleanup: jitter, use 2d float arrayCampbell Barton
2014-03-15Fix T39189: Node editor Map Uv requires an scale node to work.Lukas Tönne
This is a regression caused by rB67134a7bf689279785e2e40b29cd24243813998b The UV coordinates read from the UV input must be scaled by the Image input size instead of the UV input size. Also now this node uses the UV input resolution instead of the Image resolution, since this is what determines the available resolution. The image is EWA-sampled anyway, it's resolution does not have a direct impact.
2014-03-12Code cleanup: de-duplicate switch statement, style editsCampbell Barton
2014-03-11New Corner Pin node: uses explicit corner values for a plane warp ↵Lukas Tönne
transformation. This was suggested by Christopher Barrett (terrachild). Corner pin is a common feature in compositing. The corners for the plane warping can be defined by using vector node inputs to allow using perspective plane transformations without having to go via the MovieClip editor tracking data. Uses the same math as the PlaneTrack node, but without the link to MovieClip and Object. {F78199} The code for PlaneTrack operations has been restructured a bit to share it with the CornerPin node. * PlaneDistortCommonOperation.h/.cpp: Shared generic code for warping images based on 4 plane corners and a perspective matrix generated from these. Contains operation base classes for both the WarpImage and Mask operations. * PlaneTrackOperation.h/.cpp: Current plane track node operations, based on the common code above. These add pointers to MovieClip and Object which define the track data from wich to read the corners. * PlaneCornerPinOperation.h/.cpp: New corner pin variant, using explicit input sockets for the plane corners. One downside of the current compositor design is that there is no concept of invariables (constants) that don't vary over the image space. This has already been an issue for Blur nodes (size input is usually constant except when "variable size" is enabled) and a few others. For the corner pin node it is necessary that the corner input sockets are also invariant. They have to be evaluated for each tile now, otherwise the data is not available. This in turn makes it necessary to make the operation "complex" and request full input buffers, which adds unnecessary overhead.
2014-03-07Fix for displace node regression (reported on IRC by Sebastian Koenig):Lukas Tönne
Was adding a (0.5, 0.5) offset, even for zero displacement.
2014-02-24Fix T38794: ScaleFixedSizeOperation was not taking offset into accountLukas Tönne
when calculating depending-area-of-interest.
2014-02-20Fix for bad imbuf creation by compositor viewers if resolution is (0,0).Lukas Tönne
This can happen if no image buffers are used to define a sensible resolution. Then the viewer will stiff create a float buffer in the output imbuf, which defies the usual ibuf->rect_float check and leads to invalid memory access. Float buffer should not be created in this case.
2014-02-19Code cleanup: styleCampbell Barton
2014-02-18Fix T38488: Single pixel line artifact with Rotate and Wrapped TranslateLukas Tönne
nodes. The Rotate node was calculating the center with a 1 pixel offset, which effectively shifts the image by 1 pixel on one or both axis for right-angle (90 degree) rotations. Note that the wrapping feature for translate nodes can still produce undesirable results for non-quadratic images. This is because of how the resolution calculation works atm: the Rotate node will keep the resolution of the input image, even if the resulting image is then cropped or leaves empty margins. There is no easy way to fix that without redesign.
2014-02-18Fix T38506: Bokeh blur node - size bugs with OpenCL.Lukas Tönne
The underlying cause for these issues is the insufficient sampling of the bokeh image. For smaller blur radius there will be very few samples taken, and with 1-pixel radius it boils down to just 4 samples: 2 on the left border (black), 1 in the center (black) and 1 at the top border (blue) ... For now have added the workarounds implemented in the CPU version of that node, which hide these artifacts. Ultimately would be better to have mipmap levels for the bokeh image input instead.
2014-02-17Fix T38487: Wrapped translate node in combination with other bufferedLukas Tönne
nodes (Blur) causes crash due to chained read/write buffer operations. The way read/write buffer operations are created for both the wrapped translate node and then the "complex" blur node creates a chain of buffers in the same ExecutionGroup. This leaves the later write buffer operations without a proper "executor" group and fails on assert. Solution for now is to check for existing output buffer operations like it already happens for inputs. This is extremely ugly code, but should become a lot more transparent after compositor cleanup ({D309}).
2014-02-13Fix T38529, Blur node size 0 doesn't work.Lukas Tönne
The blur operations were clamping the filter size to 1, which prevents no-op blur nodes. Further any value < 1 would also be ignored and in many combinations the filter scale setting ("Size") would only work in integer steps. Now most blur settings will work with smooth Size value scaling as well, meaning you can choose a reasonably large filter size (e.g. 10) and then use the Size factor to scale the actual blur radius smoothly. Note that non-integer filter sizes also depend on the filter type selected in the Blur node, e.g. "Flat" filtering will still ignore smooth filter sizes. Gaussian filters work best for this purpose.
2014-02-13Code cleanup: styleCampbell Barton
2014-02-05Fix T38340 and T38473: fixed Scene pointers in Composite and Defocus nodes ↵Lukas Tönne
don't get updated based on context. As discussed in T38340 the solution is to use the current scene from context whenever feasible. Composite does not use node->id at all now, the scene which owns the compositing node tree is retrieved from context instead. Defocus node->id is made editable by the user. By default it is not set, which also will make it use the contextual scene and camera info. The node->id pointer in Defocus is **not** cleared in older blend files. This is done for backward compatibility: the node will then behave as before in untouched scenes. File Output nodes also don't store scene in node->id. This is only needed when creating a new node for initializing the file format. Reviewers: brecht, jbakker, mdewanchand Reviewed By: brecht Differential Revision: https://developer.blender.org/D290
2014-02-03Code cleanup: white space and cmake was broken on all platformsCampbell Barton
2014-01-27Code cleanup: use booleans where appropriateCampbell Barton
2014-01-26Code Cleanup: style and correct API class refCampbell Barton
2014-01-22Fix T38011 and cleanup of Lens Distortion node code.Lukas Tönne
The area-of-interest calculation for that node didn't work reliably. It tries to estimate the distorted rectangular area based on min/max distortion and dispersion values, but this fails in some cases and leaves uninitialized buffer chunks. So now simply use the full input rect as the area, even though it may not be as efficient - at least it works ... Also cleaned up the code somewhat to make it understandable, using separate functions for common stuff instead of cryptic walls of math.
2014-01-16Code Cleanup: style and redundant castsCampbell Barton
2014-01-12Style Cleanup: whitespaceCampbell Barton
2014-01-09Code Cleanup: styleCampbell Barton
2014-01-01Fix deadlock happening when using Save Buffers for renderSergey Sharybin
Summary: Issue was caused by the same tile being written twice to the EXR file. This was happening because of partial update of work-in-progress tiles was merging result to the final render result in order to make color management pipeline happy. We need to avoid such a merges and keep memory usage as low as possible when Save Buffers is enabled. Now render pipeline will allocate special display buffer in render layer which will contain combined pass in the display space. This keeps memory usage as low as we can do at this moment. There's one weak thing which is changing color management settings during rendering would lead to lossy conversion. This is because render result's display buffer uses color space from the time when rendering was invoked. This is actually what was happening in previous release already actually so not a big issue. Reviewers: brecht Reviewed By: brecht Differential Revision: https://developer.blender.org/D162
2013-12-22Style Cleanup: remove preprocessor indentation (updated wiki style guide too)Campbell Barton
2013-12-20Fix T37890: compositor did not take number of thread setting into account.Brecht Van Lommel
2013-12-18Color management: get rid of original byte buffer partial updateSergey Sharybin
It was only used by opengl render and in fact it needed just to set DISPLAY_BUFFER_INVALID flag for the image buffer. In theory it wouldn't make any change to opengl render speed (because this change just moved rect_from_float from color management code to image save code). And could not see any speed changes on my laptop.
2013-12-10Style CleanupCampbell Barton
2013-12-04Fix for EWA (elliptical weighted average) sampling in the compositor.Lukas Tönne
EWA sampling is designed for downsampling images, i.e. scaling down the size of input image pixels, which happens regularly in compositing. While the standard sampling methods (linear, cubic) work reasonably well for linear transformations, they don't yield good results in non-linear cases like perspective projection or arbitrary displacement. EWA sampling is comparable to mipmapping, but avoids problems with discontinuities. To work correctly the EWA algorithm needs partial derivatives of the mapping functions which convert output pixel coordinates back into the input image space (2x2 Jacobian matrix). With these derivatives the EWA algorithm projects ellipses into the input space and accumulates colors over their area. This calculation was not done correctly in the compositor, only the derivatives du/dx and dv/dy were calculation, basically this means it only worked for non-rotated input images. The patch introduces full derivative calculations du/dx, du/dy, dv/dx, dv/dy for the 3 nodes which use EWA sampling currently: PlaneTrackWarp, MapUV and Displace. In addition the calculation of ellipsis area and axis-aligned bounding boxes has been fixed. For the MapUV and Displace nodes the derivatives have to be estimated by evaluating the UV/displacement inputs with 1-pixel offsets, which can still have problems on discontinuities and sub-pixel variations. These potential problems can only be alleviated by more radical design changes in the compositor functions, which are out of scope for now. Basically the values passed to the UV/Displacement inputs would need to be associated with their 1st order derivatives, which requires a general approach to derivatives in all nodes.
2013-12-04Fix for interpolation errors on lower-left borders in compositor imageLukas Tönne
inputs. http://wiki.blender.org/uploads/4/4c/Compo_image_interpolation_borders.png Problem is that all image buffer reader nodes (RenderLayer, Image, MovieClip) were clipping pixel coordinates to 0..N range (N being width or height respectively). Bilinear interpolation works ok then on the upper-right borders (x, N) and (N, y), since the last (N-1) pixel fades out to N (background). But the lower-left (x, 0) and (0, y) borders are not correctly interpolated because the nodes cut off the negative pixels before the interpolation function can calculate their value. To fix this, the interpolation functions are now entirely responsible for handling "out of range" cases, i.e. setting (0,0,0,0) results for invalid pixels, while also handling interpolation for borders. Callers should not do pixel range checks themselves, which also makes the code simpler. Should not have any real performance penalty, the interpolation functions do this check anyway, so is probably even slightly faster.
2013-12-03Cleanup: Internal degrees removal.Bastien Montagne
This patch changes most of the reamining degrees usage in internal code into radians. I let a few which I know off asside, for reasons explained below - and I'm not sure to have found out all of them. WARNING: this introduces forward incompatibility, which means files saved from this version won't open 100% correctly in previous versions (a few angle properties would use radians values as degrees...). Details: - Data: -- Lamp.spotsize: Game engine exposed this setting in degrees, to not break the API here I kept it as such (using getter/setter functions), still using radians internally. -- Mesh.smoothresh: Didn't touch to this one, as we will hopefully replace it completely by loop normals currently in dev. - Modifiers: -- EdgeSplitModifierData.split_angle, BevelModifierData.bevel_angle: Done. - Postprocessing: -- WipeVars.angle (sequencer's effect), NodeBokehImage.angle, NodeBoxMask.rotation, NodeEllipseMask.rotation: Done. - BGE: -- bConstraintActuator: Orientation type done (the minloc[0] & maxloc[0] cases). Did not touch to 'limit location' type, it can also limit rotation, but it exposes through RNA the same limit_min/limit_max, which hence can be either distance or angle values, depending on the mode. Will leave this to BGE team. -- bSoundActuator.cone_outer_angle_3d, bSoundActuator.cone_inner_angle_3d: Done (note I kept degrees in BGE itself, as it seems this is the expected value here...). -- bRadarSensor.angle: Done. Reviewers: brecht, campbellbarton, sergey, gaiaclary, dfelinto, moguri, jbakker, lukastoenne, howardt Reviewed By: brecht, campbellbarton, sergey, gaiaclary, moguri, jbakker, lukastoenne, howardt Thanks to all! Differential Revision: http://developer.blender.org/D59
2013-11-30Woo Hoo. First git commit.Alexandr Kuznetsov
Changes for VC2013 Now, I can build Blender with VC2013 with Cycles, Collada, OpenExr,OpenImageIO disabled. Also, you need VC2008 sp1 installed to make old libs compatible.
2013-11-22Code Cleanup: warningsCampbell Barton
2013-11-20Fix T37172: Plane Tracker Deform - No perspectiveSergey Sharybin
Previous wrap implementation was based on inverse bilinear mapping, which doesn't give perspective. Now plane track wrap estimates perspective transform matrix as a homography estimation between frame coordinates and plane corners. Uses Libmv's implementation for this, which means plane track wouldn't work properly with Libmv disabled. Not a deal for official builds at all, just folks who keeps things disabled need to be aware of this.
2013-11-19Cleanup: Renamed compositor executePixel functions and their 'read' wrappers ↵Lukas Tönne
in SocketReader. Distinguish the 3 different methods for acquiring pixel color values (executePixel, executePixelSampled, executePixelFiltered). This makes it easier to keep track of the different sampling methods (and works nicer with IDEs that do code parsing). Differential Revision: http://developer.blender.org/D7
2013-11-19Potential fix for T37525: Viewer node causes crashSergey Sharybin
LOCK_DRAW_IMAGE used to be unlocked twice. Now made it so all the thread-unsafe code is inside a single lock/ unlock section.
2013-11-16Fix T37493: Defocus node with angle = 90° rotates bokeh only for ~1.5°Sv. Lockal
2013-11-06Fix #37333: Bad default value in Color Balance. Use independent ↵Lukas Toenne
offset/power/slope variables for the CDL mode in color balance node. This avoids stupid default values in particular for offset, which would be 1 when just using the lift value for it.
2013-11-06Removed the DNA storage for LGG lift and inverse gamma in the color balance ↵Lukas Toenne
node. These values were always calculated at execution time, so there is no need to keep them around in DNA data and no forward compatibility break either. Only reason they were stored in DNA before is that the old compositor had no other means of keeping precomputed values around for every pixel than storing the DNA node data, with new compositor this is no longer necessary (values are stored in operations).
2013-11-04code cleanup: typo in function nameCampbell Barton
2013-10-31code cleanup: spellingCampbell Barton
2013-10-29Code cleanup: use bool instead of int in mask moduleSergey Sharybin