Jump to content

Recommended Posts

Hi Affinity team,

can you please add logic functions that would allow to process if/select-clauses?

i currently try to simulate by + and *, but could lead to complex formulas and wrong results  

0 rated as false, all other values rated as true

* means any other value (except those listed above)

logic functions and, or, not should return only 0 or 1, normalizing all non-0 to 1

E.g. 

and(a,b) res

0 * 0

* 0 0

* * 1

or (a,b): res

0 0 0

* * 1

not (a) res

0 1

* 0

if (c,y,n) res

0 y n n

* y n y

Ifsign (c, n, z, p) res

C=0 z

c<0 n

c>0 p

Thank you in advance

Link to post
Share on other sites

I do a fair amount of Procedural Texture programming and handle conditional statements by such as first deriving 0-1 for true-false and then multiplying by the result for condition a then adding multiplying by inverse for condition b. For comparing numbers, I typically subtract and do a roundup (scaling numbers as needed).

eg (untested, so fingers crossed) a version of max(R,G) is:

var ifrg=roundup(R-G); //is zero if green greater than red else 1

var mxrg=ifrg*R+(1-ifrg)*G;

And yes, things get complex!

 

Dave Straker

Cameras: Sony A7R2, RX100V

Computers: Win10: Chillblast i9 Custom + Philips 40in 4K & Benq 23in; Surface Pro 4 i5; iPad Pro 11"

Favourite word: Aha. For me and for others.

Link to post
Share on other sites
23 minutes ago, dmstraker said:

I do a fair amount of Procedural Texture programming and handle conditional statements by such as first deriving 0-1 for true-false and then multiplying by the result for condition a then adding multiplying by inverse for condition b. For comparing numbers, I typically subtract and do a roundup (scaling numbers as needed).

eg (untested, so fingers crossed) a version of max(R,G) is:

var ifrg=roundup(R-G); //is zero if green greater than red else 1

var mxrg=ifrg*R+(1-ifrg)*G;

And yes, things get complex!

 

absolutely. Normally a+b can be used for "OR", but if you don't always normalize and have e.g. 1 + (-1) you get wrong results.

Link to post
Share on other sites

Ah yes. -ves of course.

Another gotcha is calcs done as real numbers. So what should be 0 could be just out. 

Dave Straker

Cameras: Sony A7R2, RX100V

Computers: Win10: Chillblast i9 Custom + Philips 40in 4K & Benq 23in; Surface Pro 4 i5; iPad Pro 11"

Favourite word: Aha. For me and for others.

Link to post
Share on other sites

Hi Dave (dmstraker)

Are your Procedural Texture  macros cross platform compatible. I run on MAC and have had trouble with your macros in 1.9.1

I don't code but am really interested in getting your macros to work especially the Luminosity ones

I have attached a screen capture of what they look like. (missing sliders)

Thanks for any info

 

screenshot_01.png

Link to post
Share on other sites
On 3/9/2021 at 8:27 PM, spiderpod7d said:

Hi Dave (dmstraker)

Are your Procedural Texture  macros cross platform compatible. I run on MAC and have had trouble with your macros in 1.9.1

I don't code but am really interested in getting your macros to work especially the Luminosity ones

I have attached a screen capture of what they look like. (missing sliders)

Thanks for any info

 

screenshot_01.png

Looks like you can scroll down to other sliders -- see the scroll bar to the right of sliders visible.

Dave Straker

Cameras: Sony A7R2, RX100V

Computers: Win10: Chillblast i9 Custom + Philips 40in 4K & Benq 23in; Surface Pro 4 i5; iPad Pro 11"

Favourite word: Aha. For me and for others.

Link to post
Share on other sites

There is a bug (afp-4203) in the current Mac1.9.x versions of the procedural texture dialog where the input controls are not displayed and you only see blank space.

Hoping this is fixed by end of 1.9.2 beta as I use Dave's (great) macros too, a significant enhancement to the attribute based selection of APh.

Link to post
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

Please note there is currently a delay in replying to some post. See pinned thread in the Questions forum. These are the Terms of Use you will be asked to agree to if you join the forum. | 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.