forked from bartvdbraak/blender
Fix for bug #11005: hue-sat-value node was doing unnecessary
clamping, which not only is suboptimal for working with hdr images, it was also doing the clamping incorrect.
This commit is contained in:
parent
106974a9d2
commit
ad38297a08
@ -52,9 +52,7 @@ static void do_hue_sat_fac(bNode *node, float *out, float *in, float *fac)
|
||||
hsv[0]+= (nhs->hue - 0.5f);
|
||||
if(hsv[0]>1.0) hsv[0]-=1.0; else if(hsv[0]<0.0) hsv[0]+= 1.0;
|
||||
hsv[1]*= nhs->sat;
|
||||
if(hsv[1]>1.0) hsv[1]= 1.0; else if(hsv[1]<0.0) hsv[1]= 0.0;
|
||||
hsv[2]*= nhs->val;
|
||||
if(hsv[2]>1.0) hsv[2]= 1.0; else if(hsv[2]<0.0) hsv[2]= 0.0;
|
||||
hsv_to_rgb(hsv[0], hsv[1], hsv[2], col, col+1, col+2);
|
||||
|
||||
out[0]= mfac*in[0] + *fac*col[0];
|
||||
|
@ -54,9 +54,7 @@ static void do_hue_sat_fac(bNode *node, float *out, float *hue, float *sat, floa
|
||||
hsv[0]+= (*hue - 0.5f);
|
||||
if(hsv[0]>1.0) hsv[0]-=1.0; else if(hsv[0]<0.0) hsv[0]+= 1.0;
|
||||
hsv[1]*= *sat;
|
||||
if(hsv[1]>1.0) hsv[1]= 1.0; else if(hsv[1]<0.0) hsv[1]= 0.0;
|
||||
hsv[2]*= *val;
|
||||
if(hsv[2]>1.0) hsv[2]= 1.0; else if(hsv[2]<0.0) hsv[2]= 0.0;
|
||||
hsv_to_rgb(hsv[0], hsv[1], hsv[2], col, col+1, col+2);
|
||||
|
||||
out[0]= mfac*in[0] + *fac*col[0];
|
||||
|
Loading…
Reference in New Issue
Block a user