• Installation Guide
  • Amoebot Model
  • User Guide
  • Model Reference
  • Dev Guide
  • API Documentation
Search Results for

    Show / Hide Table of Contents
    • Architecture Overview
    • Simulator
      • History
      • Save and Load
      • User API
      • Round Simulation
      • Reflection
      • Error Handling
    • User Interface
    • Input Handling
    • Render System
      • Unity Rendering Basics
      • Background Renderer
      • UI Renderer
      • Object Renderer
      • Particle Renderer
        • Particles
        • Shader Example
        • Circuits and Bonds
        • Data Structures and Interface

    Dev Guide: The Render System

    The render system renders the background grid, the particles, their circuits and bonds, the objects and some additional UI overlays to the screen. This must be done efficiently to keep the application responsive even while simulating large particle systems. Achieving this requires some effort and the render system's code is therefore quite complex. This part of the Developer Guide gives an overview of the render system's structure, roughly explains the most important high-level concepts and points to the places where the visualization could be changed or extended. Its main purpose is to provide some information for users who want to change the visualization so that they do not have to read through the entire rendering code.

    This page gives an outline of the render system's structure. The individual parts of the system are explained in more detail on their own pages.

    General structure

    Render System Overview

    The RenderSystem class is the main container of the render system and forms the root of a tree structure. One instance of this class is created by the application's main class, AmoebotSimulator, when the application starts. In every Update call, the AmoebotSimulator calls the RenderSystem's Render() method, which triggers a cascade of similar method calls through the entire render system hierarchy (represented by the arrows in the image above). The RenderSystem creates and manages one instance of each of the four render classes, the RendererUI, RendererBackground, RendererObjects and RendererParticles. These classes receive the Render() call of the RenderSystem and handle the rendering or pass the call to subordinate classes.

    Apart from that, the RenderSystem class contains most of the render parameters and constants. These include the current visualization type (hexagonal, round hexagonal or graph), animation times, line widths, radii and scale values, and Z layers of all components. The Z layers define the order in which the rendered objects are drawn on top of each other (more about this can be found on the rendering basics page). Some of these values can be modified to easily change the visualization, like the animation times, for example. The class stores most of these parameters as public static fields, which makes them accessible from everywhere. Almost all of the render system's classes use these values to influence the render result.

    The next page explains the basics of rendering in Unity. The concepts explained on that page are relevant to all of the following pages, which explain the four render classes in more detail.

    In this article
    Back to top AmoebotSim 2.0 Documentation v1.11
    Copyright © 2025 AmoebotSim 2.0 Authors
    Generated by DocFX