LinearTosRGB top-level property

dynamic LinearTosRGB
getter/setter pair

Implementation

var LinearTosRGB = ShaderNode((inputs) {
  var value = inputs.value;

  var rgb = value.rgb;

  var a = sub(mul(pow(value.rgb, vec3(0.41666)), 1.055), vec3(0.055));
  var b = mul(rgb, 12.92);
  var factor = vec3(lessThanEqual(rgb, vec3(0.0031308)));

  var rgbResult = mix(a, b, factor);

  return join([rgbResult.r, rgbResult.g, rgbResult.b, value.a]);
});