Make Soap effect Super Sync compatible
This commit is contained in:
@@ -7847,23 +7847,25 @@ uint16_t mode_2Dsoap() {
|
||||
const uint32_t mov = MIN(cols,rows)*(SEGMENT.speed+2)/2;
|
||||
const uint8_t smoothness = MIN(250,SEGMENT.intensity); // limit as >250 produces very little changes
|
||||
|
||||
//WLEDMM: changing noise calculation for super sync to make it deterministic using strip.now
|
||||
// init
|
||||
if (SEGENV.call == 0) {
|
||||
random16_set_seed(535);
|
||||
SEGMENT.setUpLeds();
|
||||
*noise32_x = random16();
|
||||
*noise32_y = random16();
|
||||
*noise32_z = random16();
|
||||
} else {
|
||||
*noise32_x += mov;
|
||||
*noise32_y += mov;
|
||||
*noise32_z += mov;
|
||||
}
|
||||
|
||||
uint32_t noise32_x_MM = *noise32_x + mov * strip.now / 100; //10 fps (original 20-40 fps, depending on realized fps)
|
||||
uint32_t noise32_y_MM = *noise32_y + mov * strip.now / 100;
|
||||
uint32_t noise32_z_MM = *noise32_z + mov * strip.now / 100;
|
||||
|
||||
for (int i = 0; i < cols; i++) {
|
||||
int32_t ioffset = scale32_x * (i - cols / 2);
|
||||
for (int j = 0; j < rows; j++) {
|
||||
int32_t joffset = scale32_y * (j - rows / 2);
|
||||
uint8_t data = inoise16(*noise32_x + ioffset, *noise32_y + joffset, *noise32_z) >> 8;
|
||||
uint8_t data = inoise16(noise32_x_MM + ioffset, noise32_y_MM + joffset, noise32_z_MM) >> 8;
|
||||
noise3d[XY(i,j)] = scale8(noise3d[XY(i,j)], smoothness) + scale8(data, 255 - smoothness);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
// version code in format yymmddb (b = daily build)
|
||||
#define VERSION 2309300
|
||||
#define VERSION 2310010
|
||||
|
||||
//uncomment this if you have a "my_config.h" file you'd like to use
|
||||
//#define WLED_USE_MY_CONFIG
|
||||
|
||||
Reference in New Issue
Block a user