cosine RGB gradient shader



  • On 29/01/2017 at 07:00, xxxxxxxx wrote:

    I was thinking about trying this out as a personal project, but I had to post here as well to see what you all think:
    I found this very simple but awesome approach to colour gradient manipulation, where RGB intensity is controlled by a per channel cosine function each with adjustable parameters:

    http://dev.thi.ng/gradients/

    this would be ideal for application wherever a gradient data field is present, eg. colourizer shader.
    and to have animation control over the individual function parameters would be an extremely powerful feature.

    The keyframes in the gradient section would effectively be where the generated gradient is sampled, and have option to remember original colour at location or re-sample as it is moved, allowing cool gradient distortion/interpolation.

    I haven't looked into how to approach this yet, any pointers would be appreciated. Otherwise, would love to see if anyone would like to try this out.



  • On 30/01/2017 at 02:35, xxxxxxxx wrote:

    Hi,

    interesting link.

    Basically you have two options. I think, the more generic one is to implement a CustomGUI/iCustomGui for the gradient data type. There's a small example in the cinema4dsdk examples. I'd say, it's one of the more advanced topics in the SDK and this can only be done via C++.

    The other option is to really implement a new gradient shader via ShaderData, there are multiple examples on this topic. This can also be done in Python (although it might not be the best idea due to the need for speed). And you will also have to think about mapping the gradient to e.g. UV space.



  • On 02/02/2017 at 02:46, xxxxxxxx wrote:

    Thanks, damn that's beyond me at this point..
    I might try and do a simple dirty version using python tag with c4d.Gradient


Log in to reply