Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NODES] Channel Separation Options #122

Open
sobotka opened this issue May 9, 2020 · 7 comments
Open

[NODES] Channel Separation Options #122

sobotka opened this issue May 9, 2020 · 7 comments
Labels
Nodes/Compositing Usage of nodes for compositing

Comments

@sobotka
Copy link
Owner

sobotka commented May 9, 2020

Summary

Nodes should permit selection of application.

For example, the math node should have some sort of UI selection available that permits the creator to choose which channels are applied to. Given that Olive uses a table to pass values and arrays down the chain, it is likely that this channel selection needs to be dynamic.

@sobotka sobotka added the Nodes/Compositing Usage of nodes for compositing label May 9, 2020
@itsmattkc
Copy link
Collaborator

I feel a little uncertain of the exact behavior of this.

Let's say we had a blur node and then selected only the red channel. Which of these would be the expected output?

image
(i.e. red channel blurred, rest of the image intact)

image
(i.e. red channel blurred, no other channels)

@sobotka
Copy link
Owner Author

sobotka commented Jul 14, 2020

It would only apply to the selected data.

A blur with an RGBA+ancillary appends, it would be feasible to apply to only the RGB, or any of the data.

Nodes by nature should be "dumb" and not interpret or shim in any operation that isn't requested. So for example, with an associated alpha image, if a node routes an RGBA to a colour manipulation, it's going to produce wrong output, and it likely should produce wrong output. Otherwise it heads down a neverending rabbit hole of "smart software" checks, which as you can guess, becomes untenable with all possible combinations.

A checkbox table allows for discrete application of the node, in a relatively sane manner. Only want the blur applied to blue, green, and alpha? No problem.

In your example, I'd expect that if we dumped the image raw to the viewer, the result would be the totality of the buffer, RGBA, with the R channel blurred as chosen. As in if the node is passed A B C D X1 Y1 Z1 F Foobar, and Foobar is selected, the node should blur the Foobar and pass down the identical table with the Foobar blurred. In the Viewer node, if only the R of the R G B A Foobar was selected, we'd see only R as with your second image. Of course, it would also be entirely legitimate to select Foobar and dump the results to the viewer.

Ultimately it is up to the nodes to determine what their default action is. That is, in your example, passing R G B A Foobar to the Viewer, the viewer will look for the known defaults of R G B A and display the result, which in this specific example would be the blurred R with unblurred G B A.

TL;DR Nodes should not delete tables without (perhaps?) a delete node. Otherwise it simply passes the table data along, nodes look for specific default labels, and crunch the numbers. Answer to your specific question: Depends on the node that is displaying the data.

@itsmattkc
Copy link
Collaborator

Sure I get that, so what happens in a scenario like this:

Say we're adding two textures together and the channels are selected like this:

Input 1:        [x] R        [ ] G         [ ] B
Input 2:        [x] R        [x] G         [ ] B

How are these "added" like this? Obviously we could say add the two reds, keep the green from 2, and discard green 1 and the blues, but that's not the behavior of the second blur image, not the first.

@sobotka
Copy link
Owner Author

sobotka commented Jul 18, 2020

My sensibility suggests that the values added are dictated by the check, as in the table parameter.

Consider two tables:

R G B F X Y Z
R G B F A O Z

The selection would be the union of parameters:

R G B F X Y Z A O Z

And the operation would consider all values of that parameter, and apply. In the case where only one buffer has a parameter, consider NULL and pass through.

Blur with R G B A and all four channels selected would blur all four. With only R selected, blur applies to R and the others pass through.

Thoughts?

@sobotka
Copy link
Owner Author

sobotka commented Jul 18, 2020

Thinking about it more, I think your approach is more useful, to permit channels to cross talk.

@itsmattkc
Copy link
Collaborator

I'm not really proposing or advocating for any approach, this is just the puzzle I ran into while trying to figure out how to actually implement this.

To be honest, I like Blur Example #1 where you could simply select channels to operate on and the rest would pass through, but it becomes complicated whenever more than one input texture is involved (As in the "add" example, what does it mean for two blue channels to get passed through? How does one green channel get added to nothing and the other green channel passes through?)

I feel like the dilemma is kind of like this:

Perhaps both options need to be available to the user.

@sobotka
Copy link
Owner Author

sobotka commented Jul 18, 2020

I believe what might be able to work is:

  1. A list box in the Parameters with a + / - selection.
  2. Add a line to the list box. Two columns.
  3. Left column enumerates the input buffer parameters, in a group box.
  4. Right side column enumerated the output buffer parameters.

The input then is applied to output. If the goal were to add the R to F, G, and H, three rows, with R selected for each on the left, and F G H respectively on the right.

The others pass through.

I’m guessing that an Append node would add on selected parameters. For example, if an input table contains D E F and the output only has A, the append node could work with the above UI and permit the audience to append any to all of the three from the input.

Seems like a relatively powerful matrix. Nodes that do typical things, could perhaps have a set default series of enumerated matrix elements already predefined, subject to addition or removal as required.

The first example with the image:

  1. Add Filter node.
  2. Select input table R from the enumeration.
  3. Select output table parameter from node on right. Lanczos, Cubic, Box, Prefilter, etc.

Done!

This matrix approach also strikes me as powerful because it would allow a node to perform any and all of its operations to specific channels, and encode them as such.

Perhaps it’s three columns. Input on left, operation next, and output table encoding on right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Nodes/Compositing Usage of nodes for compositing
Projects
None yet
Development

No branches or pull requests

2 participants