class CrShader::Composer

Overview

============================================================================= Composer - Runtime Multi-Trait Shader Assembler & Variant Compiler

Defined in:

crshader/composer/shader_composer.cr
crshader_resource.cr

Constructors

Instance Method Summary

Constructor Detail

def self.canvas_item : self #

def self.compositor_effect(stage : Symbol | String = :post_transparent, depth : Bool = false, normal_roughness : Bool = false) : self #

def self.new(mode : Mode = Mode::Spatial) #

def self.screen_effect(mode : Symbol | String = :canvas, depth : Bool = false) : self #

def self.spatial(preset : Symbol | String | Nil = nil) : self #

Instance Method Detail

def compile(target : ShaderTarget | Nil = nil, cache : VariantCache = VariantCache.global) : String #

def compile_godot_shader(cache : VariantCache = VariantCache.global) : Godot::Shader | Nil #

def compositor_stage : String #

def compositor_stage=(compositor_stage : String) #

def declared_features : Array(Tuple(String, FeatureValue, Array(String))) #

def declared_features=(declared_features : Array(Tuple(String, FeatureValue, Array(String)))) #

def feature_overrides : Hash(String, FeatureValue) #

def feature_overrides=(feature_overrides : Hash(String, FeatureValue)) #

def fragment(code : String) : self #

def fragment_body : String | Nil #

def fragment_body=(fragment_body : String | Nil) #

def light(code : String) : self #

def light_body : String | Nil #

def light_body=(light_body : String | Nil) #

def mode : Mode #

def needs_depth : Bool #

def needs_depth=(needs_depth : Bool) #

def needs_normal_roughness : Bool #

def needs_normal_roughness=(needs_normal_roughness : Bool) #

def pixel(code : String) : self #

def pixel_body : String | Nil #

def pixel_body=(pixel_body : String | Nil) #

def preset : String | Nil #

def preset=(preset : String | Nil) #

def release(enabled : Bool = true) : self #

def render_mode_list : Array(String) #

def render_mode_list=(render_mode_list : Array(String)) #

def render_modes(*modes : Symbol | String) : self #

def screen_mode : String #

def screen_mode=(screen_mode : String) #

def strip_debug_inspects : Bool #

def strip_debug_inspects=(strip_debug_inspects : Bool) #

def to_crshader : String #

def traits : Array(TraitUse) #

def traits=(traits : Array(TraitUse)) #

def uniform_lines : Array(String) #

def uniform_lines=(uniform_lines : Array(String)) #

def vertex(code : String) : self #

def vertex_body : String | Nil #

def vertex_body=(vertex_body : String | Nil) #

def with_feature(name : Symbol | String, value : FeatureValue, options : Array(Symbol | String) | Nil = nil) : self #

def with_trait(path_or_name : Symbol | String, prefix : Symbol | String | Nil = nil) : self #

def with_uniform(name : Symbol | String, type_name : Symbol | String, default : String | Nil = nil, hint : Symbol | String | Nil = nil, range : ::Range(Float64, Float64) | ::Range(Float32, Float32) | Nil = nil) : self #