Age | Commit message (Collapse) | Author |
|
Apply clang format as proposed in T53211.
For details on usage and instructions for migrating branches
without conflicts, see:
https://wiki.blender.org/wiki/Tools/ClangFormat
|
|
Also remove doxy comments for licenses and add missing GPL header.
|
|
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.
|
|
|
|
Strip unindented comment blocks - mainly headers to avoid conflicts.
|
|
|
|
|
|
Basically filtering was happening twice, first time by applying weights of EWA
filter itself and then by applying subpixel offset while reading pixel values.
|
|
|
|
|
|
|
|
The compostor used a fixed size of 4 floats to hold pixel data. this
patch will select size of a pixel based on its type.
It uses 1 float for Value, 3 float for vector and 4 floats for color
data types.
When benchmarking on shots (opening shot of caminandes) we get a
reduction of memory of 30% and a tiny speedup as less data
transformations needs to take place (but these are negligable.
More information of the patch can be found on
https://developer.blender.org/D627 and
http://wiki.blender.org/index.php/Dev:Ref/Proposals/Compositor2014_p1.1_TD
Developers: jbakker & mdewanchand
Thanks for Sergey for his indept review.
|
|
The title says it all, move the EWA filter to BLI (currently it's
math_interp.c) and use the function from both BI renderer and the
compositor.
This makes more central place of the algorithm, allowing to have
fixes and optimizaitons synchronized across the two usages.
This also fixes T41440: Displacement in compositing creates holes
Reviewers: campbellbarton, lukastoenne
Reviewed By: lukastoenne
Maniphest Tasks: T41440
Differential Revision: https://developer.blender.org/D748
|
|
This gives around 30% of speedup for gaussian blur node.
Pretty much straightforward implementation inside the node
itself, but needed to implement some additional things:
- Aligned malloc. It's needed to load data onto SSE registers
faster. based on the aligned_malloc() from Libmv with
some additional trickery going on to support arbitrary
alignment (this magic is needed because of MemHead).
In the practice only 16bit alignment is supported because
of the lack of aligned malloc with arbitrary alignment
for OSX. Not a bit deal for now because we need 16 bytes
alignment at this moment only. Could be tweaked further
later.
- Memory buffers in compositor are now aligned to 16 bytes.
Should be harmless for non-SSE cases too. just mentioning.
Reviewers: campbellbarton, lukastoenne, jbakker
Reviewed By: campbellbarton
CC: lockal
Differential Revision: https://developer.blender.org/D564
|
|
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.
|
|
Clamped the EWA sampling region to buffer size now. Solves the issue,
but needs more tests to be sure weights are correct.
|
|
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.
|
|
|
|
|
|
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.
|
|
|
|
It was caused by wrong copy-paste thing, which replaced check
"whether alpha channel is enabled" with "whether alpha channel
is not zero" (which is always zero in accumulator).
Compositor always works with RGBA, so no need to do any special
checks here.
TODO: Maybe MapUV ode shall ignore alpha channel?
|
|
|
|
|
|
Experimenting here and 0.765625f is too sharp, but 1.0 wont blur with 0 distorted pixels but gives nice interpolation otherwise.
|
|
|
|
displace node to blur the image when no displacement was applied, making images fuzzy, the original C code has an interpolation option.
Added this option back and use for displace and UV composite nodes.
|
|
|
|
not to be blurred.
was in fact a bug in MemoryBuffer::getMaximumValue
|
|
added some maxblur optimizations. Per tile the max blur is calcualted,
will save some unneeded CPU/GPU loops
GPU: 1:09 => 0:21
CPU: 1:50 => 0:35
|
|
Most of them are not noticeable.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
members multiple times
|
|
- should increase speed with large node setups
- enables caching of buffers in the node editor (in the future)
- OpenCL part still needs some work
|
|
|
|
|
|
`````|````` | | | ..''''
| | | |______ .''
| | | | ..'
| | |_______ |___________ ....''
merge to TRUNK!
* The old compositor is still available (Debug Menu: 200)
This commit was brought to you by:
Developers:
* Monique Dewanchand
* Jeroen Bakker
* Dalai Felinto
* Lukas Tönne
Review:
* Brecht van Lommel
Testers:
* Nate Wiebe
* Wolfgang Faehnle
* Carlo Andreacchio
* Daniel Salazar
* Artur Mag
* Christian Krupa
* Francesco Siddi
* Dan McGrath
* Bassam Kurdali
But mostly by the community:
Gold:
Joshua Faulkner
Michael Tiemann
Francesco Paglia
Blender Guru
Blender Developers Fund
Silver:
Pablo Vazquez
Joel Heethaar
Amrein Olivier
Ilias Karasavvidis
Thomas Kumlehn
Sebastian Koenig
Hannu Hoffrén
Benjamin Dansie
Fred M'ule
Michel Vilain
Bradley Cathey
Gianmichele Mariani
Gottfried Hofmann
Bjørnar Frøyse
Valentijn Bruning
Paul Holmes
Clemens Rudolph
Juris Graphix
David Strebel
Ronan Zeegers
François Tarlier
Felipe Andres Esquivel Reed
Olaf Beckman
Jesus Alberto Olmos Linares
Kajimba
Maria Figueiredo
Alexandr Galperin
Francesco Siddi
Julio Iglesias Lopez
Kjartan Tysdal
Thomas Torfs
Film Works
Teruyuki Nakamura
Roger Luethi
Benoit Bolsee
Stefan Abrahamsen
Andreas Mattijat
Xavier Bouchoux
Blender 3D Graphics and Animation
Henk Vostermans
Daniel Blanco Delgado
BlenderDay/2011
Bradley Cathey
Matthieu Dupont de Dinechin
Gianmichele Mariani
Jérôme Scaillet
Bronze (Ivo Grigull, Dylan Urquidi, Philippe Derungs, Phil Beauchamp, Bruce Parrott, Mathieu Quiblier, Daniel Martinez, Leandro Inocencio, Lluc Romaní Brasó,
Jonathan Williamson, Michael Ehlen, Karlis Stigis, Dreamsteep, Martin Lindelöf, Filippo Saracino, Douwe van der Veen, Olli Äkräs, Bruno D'Arcangeli,
Francisco Sedrez Warmling, Watchmike.ca, peter lener, Matteo Novellino, Martin Kirsch, Austars Schnore, KC Elliott, Massimiliano Puliero, Karl Stein,
Wood Design Studios, Omer Khan, Jyrki Kanto, Michał Krupa, Lars Brubaker, Neil Richmond, Adam Kalisz, Robert Garlington, Ian Wilson, Carlo Andreacchio,
Jeremias Boos, Robert Holcomb, Gabriel Zöller, Robert Cude, Natibel de Leon, Nathan Turnage, Nicolas Vergnes, Philipp Kleinhenz, Norman Hartig, Louis Kreusel,
Christopher Taylor, Giovanni Remondini, Daniel Rentzsch, Nico Partipilo, Thomas Ventresco, Johannes Schwarz, Александр Коротеев, Brendon Harvey,
Marcelo G. Malheiros, Marius Giurgi, Richard Burns, Perttu Iso-Metsälä, Steve Bazin, Radoslav Borisov, Yoshiyuki Shida, Julien Guigner, Andrew Hunter,
Philipp Oeser, Daniel Thul, Thobias Johansson, Mauro Bonecchi, Georg Piorczynski, Sebastian Michailidis, L M Weedy, Gen X, Stefan Hinze, Nicolò Zubbini,
Erik Pusch, Rob Scott, Florian Koch, Charles Razack, Adrian Baker, Oliver Villar Diz, David Revoy, Julio Iglesias Lopez, Coen Spoor, Carlos Folch,
Joseph Christie, Victor Hernández García, David Mcsween, James Finnerty, Cory Kruckenberg, Giacomo Graziosi, Olivier Saraja, Lars Brubaker, Eric Hudson,
Johannes Schwarz, David Elguea, Marcus Schulderinsky, Karel De Bruijn, Lucas van Wijngaarden, Stefano Ciarrocchi, Mehmet Eribol, Thomas Berglund, Zuofei Song,
Dylan Urquidi )
|