A problem with gradient textures and linear color

Hi,

I have a little problem with a gradient texture.
What I’m trying to do is a circular progress bar material.
The gradient is used to control the bar opacity regions.
I checked the gradient values in photoshop. They are correct.

I tried it in two ways:

  • Importing the texture as grayscale
  • Importing the texture as a channel in a color image with other masks in the other channels

In both cases the sRGB tickbox is unchecked in the texture asset editor.
The texture sampler nodes in the material uses the linear color (or grayscale) sampler type.

In both cases I get different but incorrect results for the bar position.
Except for the value of 0.75 which is somehow correct. In general, the lower the value, the bigger the discrepancy.

Any idea why this is not working ?
I have attached some images of the gradient, the material function and various settings and their results.

I’d be happy for any help :slight_smile:

Cheers,
Klaus

Try something like this and note that it’s atan2(y,x) in the custom node and not x,y

@IronicParadox

Here you go :slight_smile:
I included both files, the standalone grayscale and the version packed into the red channel of a color image.

After taking a closer look, it looks like your gradient has some compression issues. You can see the square patterning pretty hard. My guess is that it was a JPG before it was a TGA. I used a render target to render out the computationally generated version of the angle gradient. Use the texture settings that I’ve linked, and your first post will work just fine!

EDIT: Never mind on that unchecking of the draw border view option. I must be trippin or something.