• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

What math is the best for combining several 32b channels?

Enthusiast ,
Feb 14, 2023 Feb 14, 2023

Copy link to clipboard

Copied

I'd like to combine height, two UV gradients and ID  into single 32-bit  gray channel to use it in fx-map node max blending to then split successfully  after.
I tried to put  the height before the comma and  two gradients as passengers after in  digits order  using just floor  and add nodes ?   It works  with one gradient at best , the second comes  pretty degraded due to values precision and  no room for ID at all.   
 

Should I use  some other math . Rather multiplying one to another?    Isn't floating point value should allow to pack lots of info?    Is there any cool advanced way  to do it that could workaround  precision issue?   Sort of bit masks maybe?

 

TOPICS
Substance Graph

Views

214

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 16, 2023 Feb 16, 2023

Copy link to clipboard

Copied

Isn't floating point value should allow to pack lots of info?

Not really, the point of floating point numbers was to combine an extended range with good precision (which relates to significant digits not to decimal places i.e. decimal place precision varies on the size of the number being represented). 

 

What are you trying to achieve by combining the channels that treating them separately and using instancing for the fx would not?

 

Dave

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Feb 16, 2023 Feb 16, 2023

Copy link to clipboard

Copied

Too many instances nesessary.  Works too slow. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 16, 2023 Feb 16, 2023

Copy link to clipboard

Copied

The issue with packing such data into a single floating value using the pre decimal point and post decimal point parts is that changes to the pre-decimal point part can affect the post-decimal point part. This is due to the way floating point numbers work with larger numbers having less precision after the decimal point (the precision is set in terms of significant digits not decimal points).

 

Dave

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Feb 16, 2023 Feb 16, 2023

Copy link to clipboard

Copied

LATEST

Yeah, I see this . But hope there might be certain range where it would still work.   It's  like a short blanket  ,  enough to cover one thing  or another. So some tradeoff is inevitable.

Looks like shape splatter uses same idea .

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines