AI-Assisted Visual Coding

Code mode opens up endless possibilities, but you don't have to write it all yourself. You can easily collaborate with AI to translate your creative visual ideas into working module code.

To guide an AI in writing compatible code, you can use the official contract files: shader-ai-contract.txt for shader modules and scene-ai-contract.txt for scene modules.

The workflow is simple and it works well:

  1. Open your favorite LLM (like ChatGPT, Claude, etc.).

  2. Provide the contract by pasting its text or including the file link in your prompt, then describe the visual you want to create.

  3. Copy the generated code from the LLM and paste it directly into the module inside Drambo.

Shader AI contract

Scene AI contract

 

For a Shader module, you need to add an empty module, set it to Code mode, and paste the result. The Scene module works in code mode only, so you can paste the code directly.

Note: The dedicated 3D Shader module itself is not codeable, but you can absolutely prompt the AI to generate raymarched 3D shader code to run inside the standard Shader module.

Choosing Between Shaders and Scenes

To get the best results from the AI, it helps to specify the right module type for your visual idea:

  • Shaders (Per-Pixel Content): Ask the AI for a Shader module when you want to create full-screen visual textures, patterns, glows, gradients, or organic math-based shapes. Shaders calculate color pixel-by-pixel, making them incredibly fast for complex surface details.

  • Scenes (Stateful, Object-Based Systems): Ask the AI for a Scene module when you want to manage distinct independent objects, physics, or particle systems. Scene modules can also accept MIDI signals directly.

What does "stateful" mean? In short, it means the module has a memory. While a shader just looks at the current time and recalculates every single pixel from scratch, a stateful Scene remembers its own history from frame to frame. This memory allows it to track things over time , like the changing position of a bouncing ball, the aging lifespan of a particle, or whether a MIDI note is currently being held down.