-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Shaders: more graster-nodes no-std fixups
#3090
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
Conversation
| GradientStops, | ||
| )] | ||
| mut image: T, | ||
| #[default(Color::BLACK)] tint: Table<Color>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please verify that changing Table<Color> -> Color indeed changes absolutely nothing, since with the table you're just using the first entry of the table anyway. Affects both this black_and_white node and the color_overlay node.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change shouldn't occur, we do need it to take a Table since that is the only data type relating to colors that is processed within the node graph.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I now replaced Table<Color> with Option<Color> (instead of just Color) and added an into_node!(from: Table<Color>, to: Option<Color>),, since we already have a impl From<Table<Color>> for Option<Color>. So there's no need to adjust anything in the preprocessing!
However, both Color and Option<Color> makes the tint property disappear in the properties panel.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried adding Option<Color> to TaggedValue to the UI to show, but I couldn't get it to work. Would appreciate it if someone with more editor experience took a look, so I can focus on other important things.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In PR #3048, Keavon removed Color and Option<Color> from the properties system and also from the TaggedValue (used to serialize properties). This seems to me to be a bad idea. I wonder what your opinions are on this matter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The into nodes should now be added automatically if needed. The gpu node declares it's input as Color or Option<Color> but you can still feed a Table<Color> as input.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. Even on the CPU side, there is no need for nodes that work only on a single colour to accept a table.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this is approved by Keavon (at least for the GPU case). @0HyperCube if you want you can make a pr to just revert the removal of Color and Option<Color> from the node_properties
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. Even on the CPU side, there is no need for nodes that work only on a single colour to accept a table.
And I think there is an argument to be made that now that we have automatic into node insertion we should revert this for nodes which only ever operate on a single color, but I assume @Keavon will have opinions on that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's please do Option<Color> only, not Color, since this is somewhat temporary as discussed in our Discord conversation.
3f5d3ca to
38fc5d4
Compare
38fc5d4 to
d36d0b4
Compare
|
I just noticed that I'll need them to be |
|
Actually, if they'd just default to black color if the Option is None, why have it be optional in the first place? |
5bab3de to
1b64e1f
Compare
|
@TrueDoctor are you sure you want to merge this, even though it'll break the UI for color selection of the two nodes? |
ea2e61b to
68f195c
Compare
|
I removed the one problematic change of |
|
Feel free to merge at your own discretion, if the change to colors is only temporary it is fine break the ui for now and fix that in a followup pr |
prep work for shaders, does not contain any shader stuff:
cargo b -p graster-nodes --no-default-featuresbeing broken on masterTable<Color>->Colorwhere only the first row is used anyway