• 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: Object Renderer

    The RendererObjects class is responsible for rendering the objects in the system. For this, every object contains an instance of the ObjectGraphicsAdapter class which represents the object in the render system. This instance has to be registered in the RendererObjects in order to be displayed.

    Once an object is registered, the ObjectGraphicsAdapter generates a mesh for the object and updates it every time the object is changed. The mesh consists of four triangles for every hexagon in the object and additional triangles between the hexagons at the borders of the object. These are necessary because the vertices at the borders are placed closer to their hexagon's center so that there is a gap between an object and neighboring particles or other objects.

    Object mesh

    In order to render the objects with different colors, the RendererObjects maintains a dictionary of material property blocks using colors as keys. Every time an object is registered or a registered object changes its color, a corresponding property block is created or taken from the dictionary. The material used to render the objects is Resources/Materials/Base/ObjectMat.mat. It is a very simple material giving the object mesh a solid color.

    When the Render method of the RendererObjects is called, it renders each object individually, using the TRS matrix computed by the object's ObjectGraphicsAdapter. If animations are enabled, the matrix uses an interpolated position between the previous and current object position.

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