Commit Graph

61 Commits

Author SHA1 Message Date
3316853323 Cleanup: conform headers to have license first
Also remove doxy comments for licenses and add missing GPL header.
2019-02-18 08:22:11 +11:00
65ec7ec524 Cleanup: remove redundant, invalid info from headers
BF-admins agree to remove header information that isn't useful,
to reduce noise.

- BEGIN/END license blocks

  Developers should add non license comments as separate comment blocks.
  No need for separator text.

- Contributors

  This is often invalid, outdated or misleading
  especially when splitting files.

  It's more useful to git-blame to find out who has developed the code.

See P901 for script to perform these edits.
2019-02-02 01:36:28 +11:00
d7f55c4ff5 Cleanup: comment block tabs 2018-11-14 17:10:56 +11:00
0cff044d84 Spelling fixes in comments and descriptions, patch by luzpaz.
Differential Revision: https://developer.blender.org/D3719
2018-09-24 17:28:40 +02:00
44d4a61ed0 Cleanup: replace doxy @ with backslash
The rest of Blender uses backslashes.
2018-09-05 14:56:29 +10:00
a262ea8c47 Cleanup: trailing space for compositor 2018-06-17 17:05:29 +02:00
75fc1c3507 Cleanup: trailing whitespace (comment blocks)
Strip unindented comment blocks - mainly headers to avoid conflicts.
2018-06-01 18:19:39 +02:00
4ee08e9533 Atomics: Make naming more obvious about which value is being returned 2016-11-15 12:16:26 +01:00
3666ee9132 More from T47045: Add i18n translations to render status from compo.
Also fix inconsistency for freestyle translation - we use IFACE_ everywhere
(TIP_ may be more suited, but let's be consistent first!).
2015-12-29 12:42:12 +01:00
0499c5a623 Cleanup: headers 2015-10-08 11:11:48 +11:00
3ce4a58aa9 Cleanup: duplicate includes 2015-06-18 06:32:01 +10:00
bd5ea70a75 Compositor: Fix stupid type in incrementing number of finished tiles 2015-06-17 16:32:07 +02:00
6f36e1f872 Fix compilation error on Windows
The issue was caused by conflicting declaration of HKEY
happening in our WM code and somewhere deeper in atomic
operations headers hierarchy.
2015-06-12 17:32:09 +05:00
a6803bf564 Compositor: Use atomics to update finished tiles progress
Integer is not safe for incremental by multiple threads and if one is unlucky
enough that could cause progress re[reports to go totally nuts.
2015-06-11 14:53:15 +02:00
c448196bb4 Cleanup: warnings 2015-04-14 10:34:32 +10:00
2ada3512a2 Compositor: Code cleanup, prepare for strict C++ flags 2015-03-27 18:23:31 +05:00
e7afba4b29 Compositor: Cleanup, don't pollute namepace with all symbols from std 2015-03-27 14:41:20 +05:00
408a2a8420 Compositor: Improve reports to the interface about what's going on
The functionality was got lost when new compositor system was landed
and it wasn't always clear what's causing the hicucps. Now it's nicely
reported to the stats line.
2015-03-27 14:38:02 +05:00
cf01f2c760 Building with C++ guarded alloc works again 2014-04-16 02:24:21 +10:00
09874df135 Structural cleanup and improvements for the compositor.
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-15 16:28:10 +02:00
e47a41e3fc Code Cleanup: style 2014-01-09 11:44:59 +11:00
Lukas Toenne
eac7c19b04 Fix for #36720 and #36721.
This was own error in r60049 which fixed chunk number calculation. This was mixing int and unsigned int values from ExecutionGroup, which leads to huge chunk numbers which are then skipped.
2013-09-13 16:01:41 +00:00
Lukas Toenne
fdd8897172 Cleanup and improvements of the compositor debug output.
Debug code for graphviz output moved to a dedicated file COM_Debug.h/cpp.

The DebugInfo class has only static functions, which are called from a number of places to keep track of what is happening in the compositor. If debugging is disabled these are just inline stubs, so we
don't need #ifdefs everywhere and don't get any overhead.

The graphviz output is much more useful now. DebugInfo keeps track of node names in a static string map for meaningful names. It uses a number of colors for various special operation classes.
ExecutionGroups are indicated in graphviz with clusters.

Currently the graphviz .dot files are stored in the BLI_temporary_dir() folder. A separate dot file is generated for each stage of the ExecutionGroup scheduling, this is intended to give some idea of the
compositor progress, but could still be improved.
2013-09-13 13:36:47 +00:00
Lukas Toenne
ba68fea78b Fix #36700, z-depth not rendering properly at (n*256)+1 dimensions.
The chunk indices for scheduling chunks based on a given area were calculated incorrectly. This caused chunks at the very border of the render (pixels 256..257) to be omitted, leading to incorrect values
in the Z buffer of the test file, which in turn caused wrong normalization range and the resulting almost-white image.
Also added a dedicated executePixel function for Z buffer to avoid any interpolation of Z values.
2013-09-11 17:34:32 +00:00
b438c2840c SplitViewer node:
- fix thumbnail preview (previously it showed only one input)
- make SplitViewer node update even if the second input is not connected
- now it works when the first socket is connected to a zero-sized node tree (e. g. Color Input node)
- SplitViewer node is now based on 2 operations: SplitOperation and ViewerOperation.
- ViewerBaseOperation was removed as a redundant one. Any future viewer style node can use the same principle and prepare the output before passing to an actual ViewerOperation.

Thanks Lukas Toenne for reviewing this patch and giving me get few pieces of advice.
2013-08-05 19:16:52 +00:00
397da50002 style cleanup: switch statements, include break statements within braces & indent.
also indent case's within the switch (we already did both of these almost everywhere)
2013-07-19 15:23:42 +00:00
27baa34ba4 Fix #35369: Crop node or FileOutput node bug.
Issue was caused by file output node actually,

The thing here is, compositor output does have fixed
resolution and we could predict how to map coordinates
for border and cropping in that case.

But viewers and file output nodes are currently totally
depending on an input resolution. Could not see how
border could be applied reliably in this cases.

Disabling border option for file output node, so
now it shall behave the same way as it was before.

Discovered issues when using cropping to render border,
namely there's an offset in viewer nodes and previews,
but this is separate issue i guess (file output seems
to work fine). Will revisit this issue in next days.
2013-05-17 13:02:03 +00:00
1777a69818 misc minor edits.
- pass string size to BLI_timestr() to avoid possible buffer overrun.
- quiet warning for mingw.
- include guards for windows utf conversion funcs.
- fix for mistage in edge-angle-selection check.
- some style cleanup.
2013-03-29 06:25:22 +00:00
1b9e17fb9a When using border rendering, use the same border for compositor
This makes compositing as fast as it's possible in this case.

The only thing is border render+crop will still give funcy
results. This is the next thing to be solved in compositor.
2013-03-20 18:01:41 +00:00
f530adf73d Report timing compositor statistics when running in background mode.
This would help figuring out time spent on compositing, helpful for
render farms.
2013-03-13 14:50:36 +00:00
984bd7ffa8 Print compositor execution statistics when in background mode
This will print memory usage, mapped memory usage, memory peak,
compositing tree name and number of finished tiles to stdout
when blender is rendering in background mode.

This makes compositor a less blackbox and should help trouble
shooting issues happening during 4K ToS project.
2013-03-12 14:28:52 +00:00
964cead5b1 Fix for recent compo border commit
Viewer operations shall be aware of border as well, otherwise
CPU would be busy for a while full compo isn't done for just
a small preview image in a node.
2013-03-09 13:44:09 +00:00
557b893dfd Border for compositor viewer node feature
This adds border option to compositor, which affects on
a backdrop and viewer nodes, which is useful for faster
previews and tweaks.

Final compositing still happens for the whole frame, but
if it'll be needed it's not so difficult to support it
as well.

To use border there's Ctrl-B shortcut in the compositor
editor, which i used to define region you want to restrict
compositing to. There's also "Viewer Border" option in
the N-panel in case you'll want to disable border
compositing.

Some areas could be cleaned a bit, like ideally it shall
not be viewer image clearing in viewer_border_update RNA
callback, but currently it's not so much clear how to
make it the same fast as simple memset and glue it
somehow to compositor. Will think of nicer solution a
bit later.
2013-03-07 17:47:30 +00:00
1db677a51c Final render wouldn't set compositor's update_draw callback, so added NULL check
Seems no extra notifiers should be added here.
2012-11-30 11:26:57 +00:00
323e86694e Compositor should never add notifiers by himself, notifiers should be added
from main thread using job update callback.

Added new execution-time callback to bNodeTree which marks job to be updated.

The code here could be a bit not so obvious because in some cases job update
callback need to merge local tree, but it's only needed for old compositor
system which is gonna to be removed soon, so decided not to bother with
cleanup now. Removing old compositor system will also allow to drop stats_draw
callback from bNodeTree.

This should fix following bugs:
2012-11-30 09:12:10 +00:00
a32d134dc7 Solve unresolved call of min(int&, unsigned int&)
Alternative could be using unsigned ints for min/max chunks.
2012-10-23 16:46:13 +00:00
fec81d9b56 use min_ max_ functions in more places.
also fix minor error in MOD decimate when the modifier did nothing the reported face count would be wrong.
2012-10-23 16:21:55 +00:00
f3ece5a108 style cleanup: trailing tabs & expand some non prefix tabs into spaces. 2012-10-21 05:46:41 +00:00
9e742ffc2b style cleanup: also correct some doxy comments 2012-08-18 13:07:48 +00:00
3bc16fd60d compositor: replace C++ new/delete with guardedalloc. 2012-08-16 12:32:48 +00:00
9fd6c535ca fix [#32324] regression: node group with missing ID crashes new tile node system.
node groups with no ID now output magenta so it doesnt silently fail.
2012-08-14 11:05:26 +00:00
e877247789 use define for bokeh blur size, also define size of determineResolution args. 2012-08-10 13:23:31 +00:00
993dfd7d2a add bli rect funcs BLI_rctf_init_minmax, BLI_rcti_init_minmax 2012-07-12 08:31:23 +00:00
c25240ad54 Compositor read buffers work directly on the memory buffer.
This way we can remove the memoryBuffers parameter in the executePixels,
and (de)initializeTileData methods
2012-07-11 10:45:56 +00:00
3818a47e4a Change order of inclusion to stop MinGW from complaining 2012-07-04 22:55:40 +00:00
33e12a2983 Highlight nodes that are being processed 2012-07-04 10:01:45 +00:00
ea5e0d0212 Limit out of screen tiles to be scheduled. 2012-07-02 15:26:47 +00:00
d4cfdc69ef quiet all -Wshadow warnings in the compositor. 2012-06-26 07:32:24 +00:00
69ab13a7db rename remaining class members with m_ prefix. 2012-06-26 07:09:49 +00:00
b5b8306685 code cleanup: includes, also correct some py example typos 2012-06-16 20:20:07 +00:00