Shape the pipeline
Describe layouts and shader stages with Ruby blocks.
Pure Ruby software renderer
Define a graphics pipeline in Ruby, rasterize it in software, and present native or headless frames.
gem install rbgl
Connect typed vertex data, Ruby shader blocks, rasterization, and portable output.
Describe layouts and shader stages with Ruby blocks.
Draw triangles, lines, and points with depth and alpha blending.
Use Cocoa, Wayland, X11, or headless file output.
A small first step
Install the gem, then follow the project guide for platform requirements and the full API.
require "rbgl"
window = RBGL::GUI::Window.new(
width: 160, height: 120, backend: :file,
output_dir: "frames", format: :ppm,
max_frames: 1, target_fps: nil
)
# Define pipeline and vertices as shown in the guide.
window.run do |context, _delta_time|
context.bind_pipeline(pipeline)
context.bind_vertex_buffer(vertices)
context.draw_arrays(:triangles, 0, 3)
end