How to make an animated movie that's only 8KB?



The group '

Ctrl-Alt-Test ', which creates demo scenes using CG animation, has released a 3D animation created under the constraint of keeping it to only 8 kilobytes, and explains how to create it.

How we made an animated movie in 8kB - Ctrl-Alt-Test
https://www.ctrl-alt-test.fr/2024/how-we-made-an-animated-movie-in-8kb/

The Sheep and the Flower - Razor 1911 & Ctrl-Alt-Test (8kB demo) - YouTube


In November 2022, Ctrl-Alt-Test set the challenge of creating a short animation under the constraints of 8 kilobytes. According to Ctrl-Alt-Test, the goal was to include high-quality graphics and animation, direction and camera work, and music to match them.

Ctrl-Alt-Test first used the method of ``covering the entire screen by drawing a rectangle consisting of two triangles'' (PDF file), which has been a standard approach since 2008 when rendering. .

Next, we use the programming language GLSL to run a GPU program called a shader on the rectangle. A program written in GLSL performs color calculations for each pixel and each frame. So the user has to write a function that takes coordinates as input and returns a color.

Therefore, we use a function called a signed distance function (SDF) to create cubes, cones, spheres, etc. We created a function related to the shape of the sheep by combining the body and wool made up of 3D noise functions.

In order to draw 3D images on the screen, ray marching was used, which uses SDF to draw objects of various shapes without using polygons. Rather than mathematically calculating the points of intersection of the lights as in racing, the drawing is done using the distance the light travels to hit the object.

Below is an initial rendered image using Ctrl-Alt-Test.



Given the 8 kilobyte limit, it is difficult to have multiple characters appear or make characters perform complex movements. But you have to tell the story to the viewer. So Ctrl-Alt-Test omitted things that weren't necessary for the story. Initially, Ctrl-Alt-Test was supposed to be a sheep walking in the desert, but the story didn't need a desert. Therefore, the animation was created with a pure white background without creating a desert or sky.



In addition, by narrowing down the scope of work, such as by eliminating the background, he was able to concentrate more on object details, camera work, and editing. Ctrl-Alt-Test says, 'Each shot was created by hand and went through many adjustments and adjustments to ensure the flow was just right.'

Furthermore, in order to create a story that resonates with the viewer, Ctrl-Alt-Test not only uses general story creation techniques, but also increases the walking speed to express the excited sheep. , using techniques such as violently moving its tail and head. In addition, by adding changes to the music during exciting scenes, they were able to convey a variety of emotions to viewers throughout the story.

To create this animation, we initially used a 3D animation tool called '

Shadertoy ,' but Ctrl-Alt-Test later moved to a tool called ' KodeLife .' In the end, we used a framework tool called ' Leviathan ' that can be used with C++.

A synthesizer software called `` 4klang '' was used for the music for the animation. In order to compress the file size as much as possible, Ctrl-Alt-Test not only reduced the number of instrument types from 16 to 13, but also improved the compression rate by repeating the same phrase over and over again. I'm letting you do it.

Also, the sheep's eyes originally rendered by Ctrl-Alt-Test were black and featureless.



However, based on the idea that ``eyes are useful for expressing emotions,'' we added pupils and irises using a method called

environmental mapping .



In addition, by applying a calculation formula called the Fresnel relation to objects such as sheep's hooves, we are able to achieve realistic reflections against the lighting settings.



During the production stage of Ctrl-Alt-Test, we experimented with changing the video to monochrome and adding noise. But Ctrl-Alt-Test says, 'After much discussion, we decided to abandon this experiment and focus on a clean, modern look.'



Ctrl-Alt-Test compresses the data by encoding all of this data. Regarding music, we have digitized ``sheet music for performance'' and ``list of instructions for each instrument.'' A special compression tool called '

Crinkler ' was also used for further data compression.

However, using Crinkler left us with a total of 42 kilobytes of shader source code . Therefore, additional steps are required to fit this shader into binary.

To further minify the shader source code, Ctrl-Alt-Test used a proprietary tool called ' Shader Minifier .'

As a result of working with Shader Minifier, we succeeded in compressing the shader source code, which was 42 kilobytes in total, to about 5 kilobytes. Ctrl-Alt-Test successfully managed to keep the data, including the music and C++ code for execution, within 8 kilobytes.

The source code of the work 'The Sheep and the Flower' produced by Ctrl-Alt-Test is available on GitHub.

GitHub - ctrl-alt-test/mouton
https://github.com/ctrl-alt-test/mouton

in Software,   Web Application,   Video, Posted by log1r_ut