Jump to content
You must now use your email address to sign in [click for more info] ×

Functionality of the clamping functions clampmin and clampmax are swapped


Recommended Posts

Dear developers,

There is a bug in AP2. When using live procedural filter, the functions "clampmin" and "clampmax" do not work as they should, their functionalities are swapped.

E.g. clampmin is supposed to provide a "lower bound": When applying clampmin(R, 0.3) to the Red channel, 0.3 should be the lower bound, i.e. the function's result should be the R-value as long as it is greater or equal to 0.3, otherwise the result should be 0.3. 

However, this is not what the function does (see screenshot below): clampmin(R, 0.3) spits out the same value as min(R, 0.3) which boils down to 0.3 being an upper bound. So, the programming is wrong. Currently, you have programmed clampmin(a,LB)=min(a,LB) and clampmax(a,UB)=max(a,UB) which is wrong.

Correct would be:   clampmin(a,LB)=max(a,LB)      and        clampmax(a,UB)=min(a,UB). 

By the way clamp(a,LB,UB) works correctly. It would be great if you would correct this programming error.

Thank you in advance.

Best Steven

Screenshot AP2 clampmin.png

Link to comment
Share on other sites

I think the sequence of parameters is simply wrong. 
The PT documentations is next to non-exist as only types and single letter names are given without any further description.

 

Mac mini M1 A2348 | Windows 10 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080

LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5

iPad Air Gen 5 (2022) A2589

Special interest into procedural texture filter, edit alpha channel, RGB/16 and RGB/32 color formats, stacking, finding root causes for misbehaving files, finding creative solutions for unsolvable tasks, finding bugs in Apps.

 

Link to comment
Share on other sites

Mac mini M1 A2348 | Windows 10 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080

LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5

iPad Air Gen 5 (2022) A2589

Special interest into procedural texture filter, edit alpha channel, RGB/16 and RGB/32 color formats, stacking, finding root causes for misbehaving files, finding creative solutions for unsolvable tasks, finding bugs in Apps.

 

Link to comment
Share on other sites

Posted (edited)

No, it does not work as described - the sequence of inputs is correct, but it does not do what is said in the official description.

The description - according to your screenshot of the official AP page - says clampmin(n,min) clamps values below minimum, BUT: It doesn't do this!! As you see from my screenshot. A red layer filled with R'=255 pure red (or normalized with R=1.0) when applying clampmin(R,0.3) should yield the same red layer because the R-values are equal to 1.0 everywhere and obviously do not go below 0.3. So the R=1.0 value should not be clamped, only values below 0.3 should be clamped and then set equal to 0.3. That is not what clampmin is doing. The programming is simply wrong.

Just, look at the result: The layer is darkened and set to R-value 0.3. That should not happen. It should not alter the R-value as long as it does not go below 0.3.

 

 

Edited by stevenmiller
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.