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

Addition of Color Ramp node #252

Closed
wants to merge 2 commits into from

Conversation

keijiro
Copy link
Contributor

@keijiro keijiro commented Feb 20, 2018

This pull request is to add the Color Ramp node that allows handling color/alpha gradient data in shader graphs.

screenshot

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".

@keijiro keijiro requested a review from Kink3d February 20, 2018 09:33
{
properties.Add(new PreviewProperty(PropertyType.Vector4)
{
name = name + "_c" + i,
Copy link
Contributor

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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

@Kink3d
Copy link
Contributor

Kink3d commented Feb 21, 2018

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.

@keijiro
Copy link
Contributor Author

keijiro commented Feb 22, 2018

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.
@pbbastian
Copy link
Contributor

Can we close this one in favor of #310?

@keijiro
Copy link
Contributor Author

keijiro commented Apr 20, 2018

Sure. I close this as his PR is going to be merged.

@keijiro keijiro closed this Apr 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants