0
Under review

BUG: component mask node looses settings

Jason Booth 11 year бұрын жаңартылды 11 year бұрын 8
The component mask often looses it's settings for the R/G/B tabs. I'm currently working on a shader which uses a component mask, and when I'm working downstream from the node, it often looses it's settings for the outputs, resetting to either a single channel output or outputting 3 of the same channel (R).
Under review
Could you show me an isolated repro case?
I've narrowed down the issue..

- Create an append node and plug two floats together to create a vector 2
- plug the result into the component mask node and separate out the R/G channels of your vector2
- Disconnect an input from the append node, everything is fine..
- Disconnect the second input from the append node, and the component mask changes it's settings to R/R


Must be some kind of validation update causing it, but when there's thirty nodes between the two, well, it's not so obvious to the user..
I'm not sure which behaviour you would expect. You're disconnecting inputs, that affect the component mask input, which affects its buttons. The append node is currently set to output a value with a component count of 1 when it has invalid inputs, in which case it makes sense that the component mask adapts to the new component count, where only the R channel is available.

If anything, I suppose the append node could not change component count until both required inputs are connected.

What are your thoughts?
I think there's a few issues here. 

The append node should likely not say what it's output is until both inputs are connected. An append node shouldn't be able to output a float, after all..

The channel mask node should never change my settings. If I say I want BRG, then it should always say BRG. If I plug a float into it, it should upcast it to a float3 and give me my float 3 times. That way, no matter what happens upstream from it my settings will be retained.

The issue I was having is that my channel masks were getting changed some 30 nodes upstream from the section of the code I was working on, which made it hard to track down what had broken. 

BTW - I haven't come up with a repro for this, but I've seen the append node get stuck with the wrong number of outputs even when both inputs are connected, causing a compile error. (ie: 2 inputs, but shows float as output). If I see it again I'll try to come up with a repro..
So if your component mask is set to a BRG masking with a Vector3 input, and you connect a value, " it should upcast it to a float3 and give me my float 3 times" ?
So essentially, if you set it to BRG, it should output RRR (Without you knowing it?).
Isn't it better if you see that it actually will output RRR?

The component mask node has to be able to adapt based on its input.

The real problem though is that the node is updated when it has a pending incoming connection, it should stay idle until you've got a valid incoming input

It would be better to see both, but we likely only want to show one. Here's the thing; if it changes my settings at all, then it's broken, IMO. If I spent the time to specify BRG masking, and disconnect an input and reconnect it upstream, I don't want it to ever have changed it to something other than BRG. That's a destructive edit that I didn't actually make. I set that node to BRG, I should be able to trust that.

So if you think it should show RRR, I think that's fine - but if I later connect a vector3 to it, I'd want it to remember than I had set it to BRG, since that's what I specified. That way when I'm monkeying around with stuff on the otherside of the graph from it, it's not editing the top part of my graph destructively for me, causing me to spend 10 minutes tracking down what has broken.

And I'm guessing that (right now) if I click undo after the append changes my mask to RRR, it stays RRR, which means undo is broken as well in this case. (That's assuming you register undo's on a per node basis).



BTW, I've hit this several times today not using the append node. Basically, if the input becomes invalid for any reason, you're settings on the component mask node get lost.