Skip to content

Conversation

@jasoncoon
Copy link
Owner

Enable for other products after discussion.

The polar noise patterns should be enabled on any product that has angle and radius (or a radius proxy).

Thoughts on consolidating HAS_POLAR_COORDS and HAS_RADIUS_PROXY completely?

Enable for other products after discussion.
@jasoncoon jasoncoon self-assigned this Dec 13, 2021
@jasoncoon jasoncoon requested a review from henrygab December 13, 2021 23:59
Copy link
Collaborator

@henrygab henrygab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional question:

Should we change the constant data here, to be able to remove both RADII_SCALE_DIVISOR and RADII_SCALE_MULTIPLIER?

It would require:

  • Fib512 -- add new uint8_t radiusProxy[] that stores physicalToFibonacci[] / 2 (+512 bytes ROM)
  • Fib128 -- add new uint8_t radiusProxy[] that stores physicalToFibonacci[] * 2 (+128 bytes ROM)
  • Fib64 -- add new uint8_t radiusProxy[] that stores physicalToFibonacci[] * 2 (+64 bytes ROM)
  • Fib32 -- add new uint8_t radiusProxy[] that stores physicalToFibonacci[] * 2 (+32 bytes ROM)

Doing the above, would remove all references to RADII_SCALE_DIVISOR and RADII_SCALE_MULTIPLIER. I also believe it makes the code cleaner.

thoughts?

}

#if HAS_POLAR_COORDS // change to "HAS_CONCENTRIC_RINGS" ?
void rainbowNoise() {
Copy link
Collaborator

@henrygab henrygab Dec 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You wrote:

Thoughts on consolidating HAS_POLAR_COORDS and HAS_RADIUS_PROXY completely?

Yes, I think removal of the defines for HAS_POLAR_COORDS and HAS_RADIUS_PROXY would be a good thing. Any board that defines HAS_COORDINATE_MAP should simply define the following:

  • coordsX[NUM_PIXELS]
  • coordsY[NUM_PIXELS]
  • angles[NUM_PIXELS]
  • radiusProxy[NUM_PIXELS]
  • RADII_SCALE_DIVISOR and RADII_SCALE_MULTIPLIER -- but see above comment on removal of these?

Of course, radiusProxy could normally still be a reference to an existing array, to avoid double-storage costs.

At the same time, I think keeping the radiusProxy variable named as such would be good for at least two reasons:

  1. It makes it clear that the radius proxy does not have to be the X/Y values converted to a radius. For some props, it's better to have a manually defined proxy for the radius value, rather than having it hard-coded to use the actual radius values.
  2. It also avoids any confusion in later-written effects, which might otherwise expect radiusProxy[i] to mean the actual offset from center for the pixel.

I think Kraken64 may not use the actual radius for the pixels. In essence, it's an example of the above.

@jasoncoon
Copy link
Owner Author

Should we change the constant data here, to be able to remove both RADII_SCALE_DIVISOR and RADII_SCALE_MULTIPLIER?

Yes, I think so. Whether we call it radius or radiusProxy, I would rather it be explicit, and always in a one byte (0-255) scale, like the other coords.

@jasoncoon
Copy link
Owner Author

I think we could actually get rid of the physicalToFibonacci arrays, as the only places they are used should be using either radius or fibonacciToPhysical instead. 😆

I'll try to get these changes made and tested before merging this PR.

@henrygab
Copy link
Collaborator

I think we could actually get rid of the physicalToFibonacci arrays, as the only places they are used should be using either radius or fibonacciToPhysical instead. 😆

OK, although the compiler will optimize them away if they are never referenced, so it shouldn't cause any change in the final binary size. Then again, since they are dead code, it makes sense to drop them.

@jasoncoon
Copy link
Owner Author

I still need to test on all the different products, but everything builds without errors or warnings.

@jasoncoon jasoncoon changed the title Enable polar noise patterns on f256. Enable polar noise patterns on more products. Dec 15, 2021
@henrygab henrygab merged commit 0ca7a84 into main Dec 16, 2021
@henrygab henrygab deleted the jcoon/polar-noise-on-more-products branch December 16, 2021 09:48
@henrygab
Copy link
Collaborator

Very nice! I like how the standardized radius range (always 0..255) allows simplification of the clock hand calculations, and removing the HAS_POLAR_COORDS is another "Good Thing:tm:"

Nicely done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants