class Opal::Shader::Pipeline

Overview

Multi-pass shader compositing pipeline that applies chained shader passes sequentially across an entire buffer or targeted sub-regions.

Defined in:

opal/shader/pipeline.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new #

[View source]

Instance Method Detail

def add(pass : Pass) : self #

[View source]
def apply(buffer : UI::Buffer, time : Float64 = 0.0, frame : UInt64 = 0_u64) : UI::Buffer #

Applies all pipeline passes sequentially to the target buffer using ping-pong buffering.


[View source]
def audio_visualizer(region : Rect | Nil = nil, speed : Float64 = 1.0, bar_count : Int32 = 16, low_color : Color | Symbol | String = :green, mid_color : Color | Symbol | String = :yellow, high_color : Color | Symbol | String = :bright_red, peak_color : Color | Symbol | String = :bright_white) : self #

[View source]
def crt(region : Rect | Nil = nil, intensity : Float64 = 0.35, scanline_gap : Int32 = 2, phosphor_tint : Color | Symbol | String = Color.none, flicker : Bool = true) : self #

[View source]
def custom(region : Rect | Nil = nil, &block : ShaderContext -> Nil) : self #

[View source]
def fire(region : Rect | Nil = nil, speed : Float64 = 1.0) : self #

[View source]
def fractal_landscape(region : Rect | Nil = nil, speed : Float64 = 1.0, sky_color : Color | Symbol | String = :dark_gray, mountain_color : Color | Symbol | String = :blue, ridge_color : Color | Symbol | String = :magenta, foreground_color : Color | Symbol | String = :bright_cyan) : self #

[View source]
def glitch(region : Rect | Nil = nil, intensity : Float64 = 0.2, slice_height : Int32 = 3, chromatic_shift : Bool = true) : self #

[View source]
def matrix(region : Rect | Nil = nil, speed : Float64 = 1.0, density : Float64 = 0.2, lead_color : Color | Symbol | String = :bright_white, trail_color : Color | Symbol | String = :green, preserve_text : Bool = true) : self #

[View source]
def passes : Array(Pass) #

[View source]
def plasma(region : Rect | Nil = nil, scale : Float64 = 0.2, speed : Float64 = 1.5, shade_bg : Bool = false) : self #

[View source]
def raymarch_sphere(region : Rect | Nil = nil, speed : Float64 = 1.0, radius : Float64 = 0.75, sphere_color : Color | Symbol | String = :bright_cyan, light_color : Color | Symbol | String = :white, preserve_text : Bool = false) : self #

[View source]
def ripple(region : Rect | Nil = nil, speed : Float64 = 2.0, frequency : Float64 = 0.4, amplitude : Float64 = 1.5) : self #

[View source]
def starfield(region : Rect | Nil = nil, speed : Float64 = 1.0, count : Int32 = 80, preserve_text : Bool = true) : self #

[View source]
def tunnel(region : Rect | Nil = nil, speed : Float64 = 1.2, rotation_speed : Float64 = 0.5) : self #

[View source]
def vignette(region : Rect | Nil = nil, radius : Float64 = 0.8, falloff : Float64 = 0.5) : self #

[View source]
def voronoi(region : Rect | Nil = nil, speed : Float64 = 0.8, scale : Float64 = 0.15, border_color : Color | Symbol | String = :bright_cyan, inner_color : Color | Symbol | String = :blue) : self #

[View source]