Commit Graph
195 Commits
Author SHA1 Message Date
itsmattkc c32a1c8be2 removed last of the NodeOutput dependencies
Since all Nodes have an output that provides all output values now, we now
never need to add an output from a Node derivative. These changes remove the
last of them and disable the ability to add more outputs from a derivative.
2019-12-06 04:21:55 +11:00
itsmattkc d6247078b4 improved various functions to support nodeinputarrays 2019-12-06 03:42:53 +11:00
itsmattkc 50f7fac156 fixed signal/slot connections which had been renamed and weren't resolving 2019-12-06 00:43:51 +11:00
itsmattkc d25dda5275 removed all dependence on NodeOutputs
If Nodes only have the one output, we don't need to do so much differentiation
between them. Previous iteration used outputs as like a distinct function
within a Node (e.g. length output would return one result, buffer output would
produce a different result - each run different code to produce their results).
Now in this iteration, it's more accurate to say a Node is just one function
(which seems more appropriate for a node system anyway).
2019-12-06 00:23:26 +11:00
itsmattkc f424d8b44e rewrote renderers where necessary for new node structure
Largely conforming renderers to new NodeValue system. Code seems a lot cleaner
this way which is a nice advantage. Likely non-functional as this won't
compile just yet and still needs probably another day or two of testing to get
it back to where it was before.
2019-12-05 03:53:52 +11:00
itsmattkc 88c3bd44a5 rewrote node data types as or flags
The data types can now be or'd to match broader data types.
2019-12-04 20:26:43 +11:00
itsmattkc bae448fc32 adjusted tracklist class for new node value structure
We use references to the node directly rather than references supplied by the
object. This should be more robust anyway and will fit better in the new node
structure.
2019-12-04 20:14:49 +11:00
itsmattkc 6e49eaef9e removed data storage from input/output parameters
These will be held in the renderer structure from now on, not in the nodes
themselves. The nodes will serve more as a blueprint.
2019-12-04 20:12:31 +11:00
itsmattkc 0ad003a7f6 added new nodevalue types to cmake 2019-12-04 20:11:55 +11:00
itsmattkc bc0f01d9a3 make nodes more const friendly and prepare their functions for stateless work
Since the nodes won't be holding any rendering data themselves in this system,
we may as well enforce some level of non-write access by setting all the
functions to const. They were already const-friendly, they just weren't
labelled as such.
2019-12-04 20:10:42 +11:00
itsmattkc 9aa50175ac use existing IsTrack() function for checking type instead of dynamic_cast 2019-12-02 01:39:45 +11:00
itsmattkc 7503542286 use existing IsBlock() function for checking type rather than dynamic_cast 2019-12-02 01:37:54 +11:00
itsmattkc 07cb0bc44a disconnect input signals when destroying
Fixes a "pure virtual method" crash. The inputs will try to send invalidate
cache signals through the node while it's being destroyed if these are left
connected. There's no purpose to sending invalidate cache signals since any
nodes affected by this one will automatically invalidate the cache from its
outputs being disconnected and the node being destroyed so this shouldn't
cause issues.
2019-12-02 01:32:16 +11:00
itsmattkc 49ba65917f removed decoder and frame from Media node
The Media node hasn't been responsible for decoding in quite some time so
these objects were pointless.
2019-12-02 00:44:55 +11:00
itsmattkc 79ee3bc3df implemented new block system
Fixes recurring design issue that the Blocks were a frequent exception to the
DAG concept. The Blocks connecting to each others inputs/outputs while not
necessarily being "dependent" on each other to produce an image continually
causes issues while trying to create a rendering code path. This redesign
should provide a more "directed" approach to the directed acyclic graph.
2019-12-02 00:37:03 +11:00
itsmattkc 6314c80cbc deleted unused files
Old files that are never referenced or used anymore.
2019-12-02 00:16:08 +11:00
itsmattkc 24091f9810 explicitly destroy NodeParams in Node destructor
NodeParams used to be destroyed automatically through the QObject system, but
now that NodeParams perform actions that access the parent Node object in
their destructor, the NodeParam destructor needs to be called before the Node
has been fully destroyed. By destroying explicitly in the Node destructor we
accomplish this.
2019-12-02 00:14:33 +11:00
itsmattkc 87ac4dc357 Automatically disconnect all edges when a NodeParam is destroyed
If a NodeParam is destroyed (presumably as the result of its parent Node being
destroyed), any edge objects connecting to another param should be destroyed
or else the edge will be floating referencing a now destroyed object.
2019-12-02 00:12:45 +11:00
itsmattkc e3fdb96281 added convenience functions for working with NodeInputArray
NodeInputArray has to work a certain way internally, but it can still provide
array-like convenience functions to the rest of the program.
2019-12-02 00:11:45 +11:00
itsmattkc ef18980e7c removed connect/disconnect block functions that are unnecessary now 2019-12-01 01:38:52 +11:00
itsmattkc 8b1dab8296 moved track to take an array of blocks rather than a non-directed graph 2019-12-01 00:03:59 +11:00
itsmattkc da680094bf created NodeInputArray parameter type
It seems unwise to let NodeInputs take more than one value, but at times
it makes sense to create a list or array of inputs. This class will create
sub-parameters as an easy way to provide variable inputs while also enforcing
one connection per input parameter.

This is also the primary motivation for the previous commit (disambiguating
when a NodeParam's parent is a Node vs some other type).
2019-12-01 00:01:25 +11:00
itsmattkc 092d76f41a disambiguated whether NodeParam::parent() would return a Node* or a QObject*
Old code assumes that a NodeParam's parent will always be a Node. The function
has been separated off and tweaked in the event that this is not the case.
2019-11-30 23:58:56 +11:00
itsmattkc a478b11fd0 removed "previous_input" param from block
It was becoming inevitable to get rid of this, it was continuously an exception
that had to be made to the DAG concept seeing as blocks are never really
"dependents" on each other, i.e. the images they produce have nothing to do
with other blocks. The only exception is a transition which will also be
easier to accomplish with this slightly different design.
2019-11-30 23:24:01 +11:00
itsmattkc 7c5b50c5e7 fixed gross misusage of sampler2D
This particular compile issue should be solved, however the majority of its
function remains untested for the time being.
2019-11-30 18:29:46 +11:00
itsmattkc 44d649903c copy values whenever the cache is invalidated
Since we're now working with a separate proxy copy of the original node graph,
if the user changes a parameter in one of those nodes (triggering an
InvalidateCache signal), the values in our copied graph need to be updated
with these new values too.
2019-11-23 17:06:49 +09:00
itsmattkc 1bc8a20425 never send signals while nodes are still locked
A signal emitted and received in the same thread will call other functions
before returning to the one that emitted the signal. If these other functions
try to lock a mutex while a mutex is already locked by the emitting function,
we get stuck in a deadlock. These changes ensure that a signal is never emitted
by any function until all the nodes locked by it are unlocked.
2019-11-23 17:04:33 +09:00
itsmattkc 2cfccbfbef copy node graph before rendering
Previous iterations would use mutexes to prevent changing of the graph
mid-render, however several user actions would need to capture these mutexes
causing the main thread to hang until the current render job (frame/range of
samples) was complete. We now copy the nodes necessary as part of the "compile"
process so that the main thread shouldn't need nearly as much blocking while
caching occurs.
2019-11-23 08:53:52 +09:00
itsmattkc b233aa5319 added signal for an edge changing that can ripple through the graph
Useful for detecting when a graph needs recompiling, in tandem with the
"InvalidateCache()" signal when necessary, this signal ripples through the
nodes when any of the connections change which will likely need handling by
the renderer.
2019-11-23 08:51:15 +09:00
itsmattkc b1535b73b7 implemented clear() function for nodegraphs
Added a convenient (destructive) way of emptying a NodeGraph completely.
2019-11-23 08:48:59 +09:00
itsmattkc 9131b32be4 small code cleanup in block class 2019-11-23 01:56:13 +09:00
itsmattkc bc9b7bc4f0 add mode for copying values only and not connections
Sometimes we'll be copying nodes without wanting to copy their connections,
since we'll want to connect them to equivalent copies rather than connecting
them to the same nodes the originals were connected to. We now have an extra
parameter to distinguish such operations.
2019-11-23 01:51:36 +09:00
itsmattkc 492c8f474a added clone functions for nodes
Since nodes are are extremely derivative types, we use a clone/copy function
to produce new types of the derived class easily.
2019-11-22 16:53:30 +09:00
itsmattkc 073176a45d added function for returning a block at a time
Assists with certain timeline-related functions.
2019-11-19 22:25:04 +09:00
itsmattkc 065fbc0428 return nullptr if a TrackReference references a track that doesn't exist
Fixes assert trying to access an array location that doesn't exist.
2019-11-19 22:24:23 +09:00
itsmattkc 54ecc01dbe clarified some fixme comments 2019-11-19 22:14:11 +09:00
itsmattkc 2752a0a005 made output param cache thread safe
Multiple threads could be accessing these values at any given time, they'll
need to be thread safe.
2019-11-17 17:11:40 +09:00
itsmattkc 9d154e1909 use different signals when the audio invalidates vs the video
Both audio and video renderers were working off the same invalidation signal
(i.e. changing audio would also trigger a re-render of the video). This is
obviously suboptimal and now they are separate.
2019-11-17 13:44:50 +09:00
itsmattkc 35802d37b0 ensure invalidated values are removed
When a node receives an InvalidateCache signal, it will
automatically signal its outputs to discard any cached values in
the invalidated time range
2019-11-17 12:31:10 +09:00
itsmattkc a9660201f1 miscellaneous other changes to make audio rendering work
Many changes were made throughout the codebase to support audio, these are
most of the small changes necessary.

The audio support still is not perfect. I still need to write in resampling
support. After that it should work correctly with all audio types.
2019-11-15 13:57:49 +09:00
itsmattkc 3b224c7638 multithreaded download and files that probably should have been in the last
commit

For testing the new iteration, the texture cache disk download was written
into the main thread instead of into the separate threads. Now they're back
in separate threads again.

Also I think some of these files probably should have been in the previous
commit.
2019-11-06 09:14:20 +11:00
itsmattkc 97a4294bb3 refactoring work to improve issues with new rendering pipeline 2019-11-04 11:34:43 +11:00
itsmattkc 663ae56ac4 more coherent render threading for now
Once again, conceptually this system should work, however it does not seem to
be the most efficient and it wouldn't surprise me if the multithreading was
eventually upgraded to an even more coherent system one day. However for
"core principles" this should be fairly decent.
2019-11-03 04:05:43 +11:00
itsmattkc 788502cd11 removed another unnecessary node function 2019-11-02 18:12:54 +11:00
itsmattkc 16ac2fc0e1 sweeping node graph changes for new rendering pipeline
The new rendering pipeline strives to simplify the nodes themselves as much
as possible and move much of the logic to an external rendering engine. This
change removes all of the responsibilities that no longer belong to the
nodes themselves and will soon be folded into the renderer.
2019-11-02 01:39:37 +11:00
itsmattkc 133dab1666 some code cleanup
Removal of translations around debug messages since these waste cycles and are
likely not useful
2019-10-31 21:45:53 +11:00
itsmattkc 55f7d6aa8a restored previous renderer iteration for porting 2019-10-31 20:06:11 +11:00
itsmattkc 77bcb70dac started porting renderer to new portable form 2019-10-31 19:14:58 +11:00
itsmattkc d96395ea27 don't use track as the time chooser
This design, while not completely illogical, seems to betray the DAG design
and borders on impossible to actually recompile. The plan is to build this
functionality into the renderer instead.
2019-10-29 01:41:08 +11:00
itsmattkc 401aff52a8 attempts at folding opencl support in 2019-10-28 18:21:20 +11:00