Currently I useI'm currently using a simple and ugly implementation of lineral -> linear to sRGB transfromtransform:
float sRGB(float x) {
if ( x <= 0.00031308)
return 12.92*x;92 * x;
else
return 1.055*pow(x,(1.0 / 2.4) ) - 0.055;
}
vec3 sRGB_v3(vec3 c) {
return vec3(sRGB(c.x),sRGB(c.y),sRGB(c.z));
}
PossiblePossibly, that the correction ( x <= 0.00031308 ) withfor small valesvalues (x <= 0.00031308)
will not important for practicalmatter in practice.
I considerconsidered to just leave powlet ´pow(x,1 1.0 /2 2.4) but I'm not sure how much impact it will have.
Anyone can suggest ways forIs there any way to optimize it?
Can Can be vectorization help?
Can be Can some polynomal fitting be practical better ?