GradientTexture Op

GradientTexture

texture containing a colour gradient that can be altered with an editor


<p>This op allows the creation of custom gradients. Click the edit button to get the UI to edit gradient. More colours can be added to the gradient.</p> <p>Click on the small squares at the bottom and then the larger square to change the colour of that gradient point.</p> <p>Drag the small squares around to change the relationship between the different colours. Click once in the thin line at the bottom to add extra squares/gradient points.</p> <p>This will produce a datastructure like this, which can also go into the &#39;Gradient Array&#39;-Port:</p> <pre><code>[ { &quot;pos&quot;: 0, &quot;r&quot;: 0, &quot;g&quot;: 0.19215686274509805, &quot;b&quot;: 0.6705882352941176, &quot;a&quot;: 1 }, { &quot;pos&quot;: 0.085, &quot;r&quot;: 0.00784313725490196, &quot;g&quot;: 0.20392156862745098, &quot;b&quot;: 0.6941176470588235, &quot;a&quot;: 0.76 }, ... { &quot;pos&quot;: 1, &quot;r&quot;: 0.9882352941176471, &quot;g&quot;: 0.3215686274509804, &quot;b&quot;: 1, &quot;a&quot;: 0 } ] </code></pre>


Full Name
  • Ops.Gl.GradientTexture
Visibility
  • Core Op - Official cables op
License
  • MIT
AuthorgithubTest Patches


INPUT PORTS


Gradient (Number)

<p>Click this to open the editor for the gradient. See docs for a more in depth explanation.</p>

Direction index (Number:

<i>integer</i>

)

Smoothstep (Number:

<i>boolean</i>

)

<p>Enable smoothstep on changes in gradients.</p>

Step (Number:

<i>boolean</i>

)

Flip (Number:

<i>boolean</i>

)

sRGB (Number:

<i>boolean</i>

)

Oklab (Number:

<i>boolean</i>

)

Size (Number:

<i>integer</i>

)

<p>The resolution of the gradient in pixels. 256 is a good default value</p>

filter index (Number:

<i>integer</i>

)
 nearest  linear  mipmap 
wrap index (Number:

<i>integer</i>

)

Dither (Number)
Gradient Array (Array)

<p>An array of Object containing pos,r,g,b,a information (see documentation for format)</p>

Randomize Colors (Trigger)

OUTPUT PORTS


Texture (Object)

<p>The texture out</p>

Colors (Array)
Colors Pos (Array)

Patches using GradientTexture

  • Examples
  • Public
  • My Patches

Changelog


bugfixfixed radial mode: flip option was ignored / default gradient was not shown without making changesuser avatarpandur - 2024-02-29 14:04
improvementoptimized/reduced unnecessary recreation user avatarpandur - 2024-02-29 14:09
improvementRadial mode is more compatible/same colors like the simple gradientuser avatarpandur - 2024-03-12 17:01
improvementAdded XY and YX mode to generate diagonal color gradientsuser avatarpandur - 2024-03-12 17:11
improvementFix problems with flickering because texture was generated not early enoughuser avatarpandur - 2024-08-05 15:11
featureAdded option to add dithering to reduce color bandinguser avatarpandur - 2024-08-29 10:47
featureAdd XX and YY option to have a one axis gradient that is size*size pixels big and not size*1 pixels (e.g. needed to add dithering)user avatarpandur - 2024-08-29 10:48
improvementOpening the gradient editor at the bottom edge of the window will now move the gradient editor up so it is fully visibleuser avatarpandur - 2024-08-30 11:57