//
// Then as we progress, eventually the luma range should move to the right
// so that more pixels start moving towards higher mix value:
//
// 0 w
// luma: |---------------------|
//
// Then as we progress, eventually the luma range should move to the right
// so that more pixels start moving towards higher mix value:
//
// 0 w
// luma: |---------------------|
//
// and at the very end, all pixels should be in the state 1.0 (0% first image,
// 100% second image):
//
// 0 w
// luma: |---------------------|
//
// and at the very end, all pixels should be in the state 1.0 (0% first image,
// 100% second image):
//
// 0 w
// luma: |---------------------|
//
// So clearly, it should move (w+1) units to the right, and apart from that
// just stay a simple mapping.
float w = PREFIX(transition_width);
//
// So clearly, it should move (w+1) units to the right, and apart from that
// just stay a simple mapping.
float w = PREFIX(transition_width);
- float luma = INPUT3(tc).x * w;
- float m = clamp((luma - w) + PREFIX(progress_mul_w_plus_one), 0.0, 1.0);
+ float luma = INPUT3(tc).x;
+ if (PREFIX(bool_inverse)) {
+ luma = 1.0 - luma;
+ }
+ float m = clamp((luma * w - w) + PREFIX(progress_mul_w_plus_one), 0.0, 1.0);