Increase fps for most scenes to 40#25
Conversation
FPS is increased by generating new frames by linear averaging between existing frames. Example: Let's say we had animation that starts with following frames: [0f, 1f, 2f, 3f], [2f, 3f, 4f, 5f] [ ... ] [..last frame..] Then, one more frame between each frame pairs is inserted: [0f, 1f, 2f, 3f], [1f, 2f, 3f, 4f], [2f, 3f, 4f, 5f] [ ... ] [..last frame..] This way, we get `2x - 1` frames, which means that we can increase from 20 fps to 40. Now, every scene will have its own FPS setting. Previous scenes will remain at 20 until all of them are improved.
|
it probably makes sense to transfer all transformation matrices to assets. But I do not know how to do it :-) |
|
I was thinking about that too. Not sure if it has any benefits. The apk size would probably be the same and the arrays will not be readable unless you read that binary file and println the contents. I did not commit the script I used to generate the binaries but I can do it. This project has unconventional paths for source sets. and tests go to I don't know how your source sets are configured because you commited root folder inside root_dir instead of moving this dir under root project directory. I can open a PR with conventional setup if you like. |
|
I am not sure that I can correctly redo the directory structure in a git project. |
|
perhaps it makes sense for me to give you access to the repository? |
|
You don't need to give me access for this. I can open a pull request with new directory structure. |
|
Yes, of course |
Increase FPS to 40 for all scenes except:
FPS is increased by generating new matrixTransform and colorTransform frames by linear averaging between
existing frames. Example:
Let's say we had animation that starts with following matrixTransform frames:
Then, one more frame between each matrixTransform frames pairs is inserted:
This way, we get
2x - 1matrixTransformsandcolorTransforms, which means that we can increase from20 fps to 40 without increasing speed.
This same logic could be used to generate frames for 60 FPS, but I find that it was too heavy on render thread, it could not maintain 60 fps and dropped frames on emulators so I decided to stick with 40.
Now, every scene will have its own FPS setting.
Previously mentioned scenes will remain at
20.For scenes that have textures, no new textures were generated, instead,
animCounterSkipis used to skipanimCounterincrement every second frame. Looks good.You can switch and review individual commits if you find this easier to review like this.
Some scene transforms were to large to compile, they were moved to
assets.File structure is explained in array reader class javadoc.