Write in Ruby
Declare uniforms and express fragment logic with Ruby blocks.
Ruby Like Shading Language
Write shaders with Ruby constructs. RLSL infers types and emits GLSL, WGSL, MSL, or C.
gem install rlsl
Keep shader logic with the Ruby app, then select a target at the call site.
Declare uniforms and express fragment logic with Ruby blocks.
Use vector operations and inferred variable types.
Generate GLSL, WGSL, Metal Shading Language, or C source.
A small first step
Install the gem, then follow the project guide for platform requirements and the full API.
require "rlsl"
shader = RLSL.to_wgsl(:pulse) do
uniforms { float :time }
fragment do |coord, resolution, u|
uv = coord / resolution
wave = sin(u.time + uv.x * 6.28)
vec3(uv.x, uv.y, wave * 0.5 + 0.5)
end
end