-
Notifications
You must be signed in to change notification settings - Fork 156
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
Addition of Color Ramp node #252
Conversation
{ | ||
properties.Add(new PreviewProperty(PropertyType.Vector4) | ||
{ | ||
name = name + "_c" + i, |
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 should be pre-generated to avoid allocation, as it is called every frame during preview rendering.
|
||
properties.Add(new PreviewProperty(PropertyType.Vector2) | ||
{ | ||
name = name + "_a" + i, |
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.
Same as above
I wouldnt bother amending this PR tbh. I have a gradient branch open already. I will likely merge the two approaches in some way. For example, my branch has a gradient type and slot that allows sampling the same gradient multiple times which I feel is very useful. |
Thanks for reviewing. Sure. I'd like to wait for @Kink3d's merge. I fixed the issues @pbbastian pointed out, just in case. |
Also added GradientControl that handles Gradient data in graph views.
Can we close this one in favor of #310? |
Sure. I close this as his PR is going to be merged. |
This pull request is to add the Color Ramp node that allows handling color/alpha gradient data in shader graphs.
It only allows handling static gradients -- these gradients are converted into inline constants and arithmetic operations in the shader, so that it can achieve nearly optimal performance (it's rather faster than using a look-up texture in most cases). On the other hand, it uses uniforms for previews in order to avoid recompilation on every modification, so it may be a bit less performant while edit time.
I chose the word "Ramp" because most node-based VFX systems (e.g. Houdini, Nuke, Blender, etc.) use this term, not "Gradient" nor "Gradation".