The Shaders!

HTML5 canvas appears to be unsupported in the current browser.
Please try updating or use a different browser.

Aesthetic Measures

Aesthetic Measures are a mathematical function used to attempt to rate the aesthetics of an image. For my project I evolved shaders with regard to three measures:


Whats evolving?

Each shader has an expression tree for red, green, and blue values at each pixel of the texture. These expression trees have the variables x, y, and time, and include your basic math operators, trig functions, and some other shader shaping functions. The trees are mutated by either changing node types in the tree, for example an "X" node to a "cos" node. Note that this means creating a leaf node for the "cos" operator to use. Next the survivors are selected by the aesthetic measure used. Finally, survivors are split into pairs and their trees are subjected to crossover. This means swapping a random node in each tree with its corresponding tree in the other shader, bringing its children with it.


Tech Used

Evolving the shaders is done in a console application written entirely by me in C++. The program is multi-threaded to speed things up, and once mutation is done it turns all the shaders into strings and writes them to a file. A Godot application (what you are seeing now) is then used to display the shaders. All code is available on GitHub


Results?

Results are rather mixed. It is difficult to see the effects of the measures, and they could easily be mistaken for another. This could be the shaders not being given enough time to evolve, as the scores recorded at the end of the experiment do not seem to indicate any sort of convergence to an optimal value. This is especially true with reflectional symmetry. Another possible explanation or co-explanation is the finicky nature of these expression trees. Small mutations can have a huge effect on the resulting image, so even if very high scoring images are found, they may be mutated out of existence. A solution to this could be to allow a copy of all survivors to continue on to the next generation, without mutation or crossover. For more discussion on the results or methodology used, please view the paper.