Hi since It is not possible to expose property of type Gradient in my shader I decided to bake my hdr Gradient onto 1 dimensional *.exr texture.
Unfortunately my LUT kind of looks different than Gradient when used in shader , like it lost it’s hdr values. (no bloom etc.)
I export gradient like this :
Texture2D outputTex = new Texture2D(width, height, TextureFormat.RGBAFloat, false);
for (int i = 0; i < width; i++) {
outputTex.SetPixel(i, 0, gradient.Evaluate((float)i / (float)(imageSize - 1)));
}
outputTex.Apply(false);
_bytes = outputTex.EncodeToEXR();
System.IO.File.WriteAllBytes(_fullPathNoExtension + "." + extension, _bytes);
I retrieve values of texture in shader using Sample Texture 2D node.