Table of Contents
Fetching ...

A Tool for the Procedural Generation of Shaders using Interactive Evolutionary Algorithms

Elio Sasso, Daniele Loiacono, Pier Luca Lanzi

TL;DR

This work tackles the barrier designers face when crafting shaders by marrying Unity Shader Graph with an interactive evolutionary algorithm that seeds from existing shaders. The method uses a graph-based chromosome to evolve shader graphs through mutation and crossover, guided by user feedback via previews within the Unity editor. Key contributions include a native-graph representation for end-to-end evolution, domain-aware operators (e.g., Swap Noise Map), and a user-driven workflow offering both automated and manual control. Preliminary evaluation with design students suggests promising usability and diversity of generated shaders, with future work focusing on broader evaluation and open-sourcing to adapt to Unity updates.

Abstract

We present a tool for exploring the design space of shaders using an interactive evolutionary algorithm integrated with the Unity editor, a well-known commercial tool for video game development. Our framework leverages the underlying graph-based representation of recent shader editors and interactive evolution to allow designers to explore several visual options starting from an existing shader. Our framework encodes the graph representation of a current shader as a chromosome used to seed the evolution of a shader population. It applies graph-based recombination and mutation with a set of heuristics to create feasible shaders. The framework is an extension of the Unity editor; thus, designers with little knowledge of evolutionary computation (and shader programming) can interact with the underlying evolutionary engine using the same visual interface used for working on game scenes.

A Tool for the Procedural Generation of Shaders using Interactive Evolutionary Algorithms

TL;DR

This work tackles the barrier designers face when crafting shaders by marrying Unity Shader Graph with an interactive evolutionary algorithm that seeds from existing shaders. The method uses a graph-based chromosome to evolve shader graphs through mutation and crossover, guided by user feedback via previews within the Unity editor. Key contributions include a native-graph representation for end-to-end evolution, domain-aware operators (e.g., Swap Noise Map), and a user-driven workflow offering both automated and manual control. Preliminary evaluation with design students suggests promising usability and diversity of generated shaders, with future work focusing on broader evaluation and open-sourcing to adapt to Unity updates.

Abstract

We present a tool for exploring the design space of shaders using an interactive evolutionary algorithm integrated with the Unity editor, a well-known commercial tool for video game development. Our framework leverages the underlying graph-based representation of recent shader editors and interactive evolution to allow designers to explore several visual options starting from an existing shader. Our framework encodes the graph representation of a current shader as a chromosome used to seed the evolution of a shader population. It applies graph-based recombination and mutation with a set of heuristics to create feasible shaders. The framework is an extension of the Unity editor; thus, designers with little knowledge of evolutionary computation (and shader programming) can interact with the underlying evolutionary engine using the same visual interface used for working on game scenes.
Paper Structure (15 sections, 4 figures)

This paper contains 15 sections, 4 figures.

Figures (4)

  • Figure 1: Unity Shadergraph graph inspector view of dissolve direction metallic shader for Unity Universal Render Pipeline dissolve_shader.
  • Figure 2: Graph representation of a section of shader (left) with the same shader coded manually. As can be noted the graph representation is bloated with respect to the actual code needed to implement the same visual effect.
  • Figure 3: Our tool can be launched by selecting the tools tab into Unity (a) that opens the tool launch tab presents users with all the settings that users can modify (b).
  • Figure 4: Shader preview screen using (a) Unity standard shader view; (b) Cornell Box; (c) darkroom with a moving light; (d) traditional checkerboard floor.