Search Unity

Feature Request Add Curve Node.

Discussion in 'Shader Graph' started by 479813005, Apr 8, 2019.

  1. 479813005

    479813005

    Joined:
    Mar 18, 2015
    Posts:
    71
    Snipaste_2019-04-08_10-33-55.jpg
    I hope to use it in shaders.
     
    florianBrn, joeee19 and rsodre like this.
  2. Thaina

    Thaina

    Joined:
    Jul 13, 2012
    Posts:
    1,163
    More like you need vector property that show curve inspector and custom node that translate vector to curve function
     
  3. Kink3d

    Kink3d

    Joined:
    Nov 16, 2015
    Posts:
    45
    Hi,

    This is a nice idea (and something I've thought about before). Honestly, the only reason we don't have one is no-one has had the time to work on it. :)

    Worth noting that this requires an HLSL representation of an array of bezier curve segments, which requires many vectors and some non-trivial evaluation maths. Its pretty similar to our current Gradient definition, which (if you want to allow it as a Property type like the Gradient) isnt so simple.
     
    shikhrr, zhuchun and 479813005 like this.
  4. joeee19

    joeee19

    Joined:
    Jul 14, 2012
    Posts:
    56
    I want the same as the curve node of VFX Graph.
    Since it is in VFX Graph, I want you to copy it as it is.
    I just need the curve to return the float in time.
    I use Time nodes, Sine nodes, and Multiphy for animation, but it is troublesome.
    I want to define an animation in a Curve node.
     
  5. Kleptine

    Kleptine

    Joined:
    Dec 23, 2013
    Posts:
    282
    +1 would be very helpful!
     
  6. DeathSong

    DeathSong

    Joined:
    Sep 7, 2013
    Posts:
    2
    the gradient is prety much the same
    sculpt the curve whith keys
     
  7. Kleptine

    Kleptine

    Joined:
    Dec 23, 2013
    Posts:
    282
    By the way, I wrote a package that gives you this feature:
    https://twitter.com/kleptine/status/1307039895991521291

    Instead of using Beziers directly (expensive in terms of ALU), it bakes curves to a 1x32 texture and just reads them normally.

    This also means your curves can be arbitrarily complex, without any additional costs.
     
  8. Livealot

    Livealot

    Joined:
    Sep 2, 2013
    Posts:
    228
    Is this still true?
     
    Joshdbb likes this.
  9. barbelot

    barbelot

    Joined:
    Jul 18, 2017
    Posts:
    38
    VFXGraph has add exactly this node for years now and has also have AnimationCurve and Gradients exposable as properties. I wish ShaderGraph could just copy their nodes...
     
  10. Just_Lukas

    Just_Lukas

    Joined:
    Feb 9, 2019
    Posts:
    34
    Works a charm, thank you. Tested with Unity 2021.2.12f1
     
    Kleptine likes this.
  11. Tehenauin

    Tehenauin

    Joined:
    Oct 18, 2018
    Posts:
    43
    I would also love this feature.
    In VFX Graph I use curves a lot.
    Would be great to have it in shadergraph too!
     
  12. Rafaelski

    Rafaelski

    Joined:
    May 1, 2019
    Posts:
    12
    +1 reaaly needed!