Shading font with gradient

Hello,

I’m trying to create a gradient like on the image below on our fonts but I’ve ran into some problems.

  • I have not found a way to send an additional color to the fonts pixel shader. I need an additional color that represents the gradient start value, I can then use the face color to represent the gradients end value.
  • I need a value that spans between similar values for each character and that increases/decreases along the Y-axis. texcoord0 seems to be in screen space and I’ve found no matrix multiplication that achieves the wanted result.

http://imgur.com/XK89m4P

Passing values to the shader is doable through a custom render script. The render.draw() function takes an optional constants buffer that you can set up with the gradient color value. See render.constant_buffer.

For the second part: Won’t it work to set a float varying in the vertex shader to vertex position.y, then use that value in the fragment shader?