-
-
Notifications
You must be signed in to change notification settings - Fork 495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(ColorSetting): chroma effect options #4800
base: nextgen
Are you sure you want to change the base?
Conversation
|
||
override fun update(value: ColorValue, time: Long) { | ||
val frequency = getFrequency(value) | ||
val oscillation = abs((time % (frequency * 2)) - frequency) / frequency |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe add easing. I think something like sine or quadratic easing should look good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did choose modulo for performance
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what performance? Calculating a sine takes 40 ns.
If you do something computationally expensive, there is no problem if you do it like 10 times per frame.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
40ns sounds a bit low unless you have a fast CPU. The JVM can barely optimize this function as it has a new time value each time. Considering it could run on different modules multiple time per frame i think this should be considered (mainly because i had issues with the speed when i implemented that before).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One cache miss is as expensive as calculating a sin. If that function runs more than 10 times per frame something is wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to calculate it for each setting that has it enabled as we can change the speed
Adds a cyclic rainbow mode and a pulse mode to color settings.
TODOs (mainly about the GUI):
HTMLElement