class CrShader::CRShader

Overview

============================================================================= CRShader - First-Class Shading Language Resource for Godot

Inherits natively from Godot::Shader. Holds Crystal-based .crshader source and compiles transparently in-memory into Godot's native shader bytecode.

Defined in:

crshader_resource.cr

Constructors

Class Method Summary

Macro Summary

Instance Method Summary

Constructor Detail

def self.new(&block : self -> ) : self #

def self.new(pointer : Pointer(Void) = Pointer(Void).null) #

Class Method Detail

def self._godot_has_virtual_method(method_name : String) : Bool #

def self._godot_register_node_class : Void #

def self.godot_class_name : String #

def self.godot_parent_class_name : String #

Macro Detail

macro autoload(*args, **kwargs) #

DSL directives for in-body autoload configuration


macro autoload_node(*args, **kwargs) #

macro build(**kwargs, &block) #

macro create(**kwargs, &block) #

Instance Method Detail

def _godot_call_tool_button(button_name : String) : Void #
Description copied from class Godot::Object

Dispatches inspector tool button clicks on this object.


def _godot_call_virtual(method_name : String, delta : Float64) : Void #
Description copied from class Godot::Object

Virtual method and property dispatch hooks overridden by class registration macros. Delta timestep is received with 64-bit precision (Float64).


def _godot_call_virtual_with_data(method_name : String, args : Pointer(Pointer(Void)), ret : Pointer(Void)) : Void #
Description copied from class Godot::Object

Dispatches generic virtual methods with raw arguments and return buffer.


def _godot_dispatch_crystal_0(method : String) : Bool #

def _godot_dispatch_crystal_1(method : String, a0 : Godot::Variant) : Bool #

def _godot_get_property(prop_name : String, ret_ptr : Pointer(Void)) : Void #
Description copied from class Godot::Object

Invoked by the GDExtension bridge when retrieving an exposed @export property.


def _godot_has_crystal_method?(method : String) : Bool #
Description copied from class Godot::Object

Internal hooks overridden by Lapis node/gdclass/resource classes to expose Crystal-defined methods.


def _godot_set_property(prop_name : String, val_ptr : Pointer(Void)) : Void #
Description copied from class Godot::Object

Invoked by the GDExtension bridge when setting an exposed @export property.


def active_features : Hash(String, FeatureValue) #

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

def apply_dictionary_properties!(dict : Godot::Dictionary) : Void #
Description copied from class Godot::Object

Populates @[Export] properties on this object from a Godot::Dictionary.


def compile_and_sync_targets!(write_disk : Bool = true) : Array(Tuple(String, ShaderTarget, String)) #

Compiles all emit_target outputs (or default sibling output), optionally writes them to disk, and hot-reloads any cached Godot::Shader resources in ResourceLoader so open scenes update live.


def crshader_source : String #

def crshader_source=(crshader_source : String) #

def export_config_hash : UInt64 #
Description copied from class Godot::Object

Computes a deterministic 64-bit hash of all @[Export] properties on this object.


def export_gdshader : Void #

Tool button: Exports compiled GDShader to disk on-demand


def export_gdshaderinc : Void #

Tool button: Exports compiled GDShader include header (.gdshaderinc) to disk on-demand


def export_glsl : Void #

Tool button: Exports compiled GLSL compute shader to disk on-demand


def file_path : String #

def file_path=(file_path : String) #

def last_compiled_code : String #

def last_compiled_code=(last_compiled_code : String) #

def last_error_line : Int32 #

def last_error_line=(last_error_line : Int32) #

def last_error_message : String #

def last_error_message=(last_error_message : String) #

def last_resolved_target : ShaderTarget #

def last_resolved_target=(last_resolved_target : ShaderTarget) #

def recompile : Bool #

def resolve_disk_path(path : String) : String #

def set_crshader_source(source : String) : Void #

def set_feature(name : Symbol | String, value : FeatureValue) : Bool #

def shader_target : String #

def shader_target=(shader_target : String) #

def specialize(features : Hash(String, FeatureValue), cache : VariantCache = VariantCache.global) : Godot::Shader | Nil #

def specialize(**features) : Godot::Shader | Nil #

def strip_debug_inspects : Bool #

def strip_debug_inspects=(strip_debug_inspects : Bool) #

def trigger_recompile : Void #

Tool button: Recompiles shader in-memory