class
CrShader::CRShaderCompositorEffect
- CrShader::CRShaderCompositorEffect
- Godot::CompositorEffect
- Godot::Resource
- Godot::RefCounted
- Godot::Object
- Reference
- Object
Overview
============================================================================= CRShaderCompositorEffect - Godot 4.8+ Render Pipeline Compositor Effect Base
Plugs directly into Godot 4's WorldEnvironment / Camera3D Compositor stack.
Compiles .crshader or .glsl compute shaders to SPIR-V via RenderingDevice,
binds per-view color (rgba16f image2D), depth (sampler2D), Forward+
normal_roughness (sampler2D), and CrShaderSceneData matrices, and packs
uniform parameters automatically into std430 push constants or std140 UBOs.
Defined in:
crshader/compositor/compositor_effect_base.crConstant Summary
-
COMPOSITOR_MOUNT_GDSCRIPT =
"extends RefCounted\n\nfunc mount_effect(world_env: WorldEnvironment, effect: CompositorEffect) -> void:\n\tif world_env == null or effect == null:\n\t\treturn\n\tif world_env.compositor == null:\n\t\tworld_env.compositor = Compositor.new()\n\tvar list: Array[CompositorEffect] = [effect]\n\tworld_env.compositor.compositor_effects = list\n\nfunc clear_effects(world_env: WorldEnvironment) -> void:\n\tif world_env == null or world_env.compositor == null:\n\t\treturn\n\tvar empty: Array[CompositorEffect] = []\n\tworld_env.compositor.compositor_effects = empty"
Constructors
Class Method Summary
- ._godot_has_virtual_method(method_name : String) : Bool
- ._godot_register_node_class : Void
-
.build_scene_ubo_bytes(scene_data : Godot::RenderSceneData, view : Int64, size : Vector2i, elapsed_sec : Float32) : Bytes
Packs 272-byte CrShaderSceneData std140 UBO: mat4 INV_PROJECTION_MATRIX, mat4 PROJECTION_MATRIX, mat4 INV_VIEW_MATRIX, mat4 VIEW_MATRIX, vec2 VIEWPORT_SIZE, float TIME, float pad
-
.clear_world_environment(world_env : Godot::Object) : Void
Clears active
CompositorEffectentries on aWorldEnvironment - .godot_class_name : String
- .godot_parent_class_name : String
-
.invert_mat4(m : Pointer(Float32), out_inv : Pointer(Float32)) : Void
Analytical 4x4 column-major matrix inversion (Cramer's rule / cofactors in Float64 precision)
-
.mount_to_world_environment(world_env : Godot::Object, effect : Godot::CompositorEffect) : Void
Mounts a
CompositorEffectonto aWorldEnvironment(auto-creatingCompositorif needed) - .write_transform_mat4(dst : Pointer(Float32), t : Transform3D) : Void
Macro Summary
-
autoload(*args, **kwargs)
DSL directives for in-body autoload configuration
- autoload_node(*args, **kwargs)
- build(**kwargs, &block)
- create(**kwargs, &block)
Instance Method Summary
-
#_godot_call_tool_button(button_name : String) : Void
Dispatches inspector tool button clicks on this object.
-
#_godot_call_virtual(method_name : String, delta : Float64) : Void
Virtual method and property dispatch hooks overridden by class registration macros.
-
#_godot_call_virtual_with_data(method_name : String, args : Pointer(Pointer(Void)), ret : Pointer(Void)) : Void
Dispatches generic virtual methods with raw arguments and return buffer.
- #_godot_dispatch_crystal_0(method : String) : Bool
- #_godot_dispatch_crystal_1(method : String, a0 : Godot::Variant) : Bool
- #_godot_dispatch_crystal_2(method : String, a0 : Godot::Variant, a1 : Godot::Variant) : Bool
-
#_godot_get_property(prop_name : String, ret_ptr : Pointer(Void)) : Void
Invoked by the GDExtension bridge when retrieving an exposed
@exportproperty. -
#_godot_has_crystal_method?(method : String) : Bool
Internal hooks overridden by Lapis
node/gdclass/resourceclasses to expose Crystal-defined methods. -
#_godot_set_property(prop_name : String, val_ptr : Pointer(Void)) : Void
Invoked by the GDExtension bridge when setting an exposed
@exportproperty. -
#_render_callback(effect_callback_type : Int64, render_data : Godot::RenderData) : Void
Executed on the Godot render thread for each frame
- #active_features : Hash(String, FeatureValue)
- #active_features=(active_features : Hash(String, FeatureValue))
-
#apply_dictionary_properties!(dict : Godot::Dictionary) : Void
Populates
@[Export]properties on this object from aGodot::Dictionary. - #compiled_glsl : String
- #compiled_program : ShaderProgram | Nil
- #configure_compositor_flags : Void
- #crshader_path : String
- #crshader_path=(crshader_path : String)
- #crshader_source : String
- #crshader_source=(crshader_source : String)
-
#export_config_hash : UInt64
Computes a deterministic 64-bit hash of all
@[Export]properties on this object. - #intensity : Float32
- #intensity=(intensity : Float32)
-
#load_shader_file(path : String) : Bool
Sets
.crshaderor.glslfile path at runtime and flags GPU pipeline for recompilation - #needs_depth_buffer : Bool
- #needs_depth_buffer=(needs_depth_buffer : Bool)
- #needs_normal_roughness_buffer : Bool
- #needs_normal_roughness_buffer=(needs_normal_roughness_buffer : Bool)
- #packed_layout : GLSLLayoutPacker::PackedLayout | Nil
- #parameter_overrides : Hash(String, ParamValue)
- #parameter_overrides=(parameter_overrides : Hash(String, ParamValue))
-
#set_feature(name : Symbol | String, value : FeatureValue) : Bool
Toggles or updates a compile-time specialization feature and schedules SPIR-V swap
-
#set_shader_code(source : String, is_glsl : Bool = false) : Void
Sets
.crshadersource code at runtime and flags GPU pipeline for recompilation -
#set_shader_parameter(name : String, value : ParamValue) : Void
Updates a uniform parameter dynamically (mirrors ShaderMaterial#set_shader_parameter)
-
#specialize(**features) : String
Compiles a specialized GLSL compute permutation using VariantCache
- #stage_callback : Int32
- #stage_callback=(stage_callback : Int32)
- #strip_debug_inspects : Bool
- #strip_debug_inspects=(strip_debug_inspects : Bool)
Constructor Detail
Class Method Detail
Packs 272-byte CrShaderSceneData std140 UBO: mat4 INV_PROJECTION_MATRIX, mat4 PROJECTION_MATRIX, mat4 INV_VIEW_MATRIX, mat4 VIEW_MATRIX, vec2 VIEWPORT_SIZE, float TIME, float pad
Clears active CompositorEffect entries on a WorldEnvironment
Analytical 4x4 column-major matrix inversion (Cramer's rule / cofactors in Float64 precision)
Mounts a CompositorEffect onto a WorldEnvironment (auto-creating Compositor if needed)
Macro Detail
Instance Method Detail
Dispatches inspector tool button clicks on this object.
Virtual method and property dispatch hooks overridden by class registration macros.
Delta timestep is received with 64-bit precision (Float64).
Dispatches generic virtual methods with raw arguments and return buffer.
Invoked by the GDExtension bridge when retrieving an exposed @export property.
Internal hooks overridden by Lapis node/gdclass/resource classes to expose Crystal-defined methods.
Invoked by the GDExtension bridge when setting an exposed @export property.
Executed on the Godot render thread for each frame
Populates @[Export] properties on this object from a Godot::Dictionary.
Computes a deterministic 64-bit hash of all @[Export] properties on this object.
Sets .crshader or .glsl file path at runtime and flags GPU pipeline for recompilation
Toggles or updates a compile-time specialization feature and schedules SPIR-V swap
Sets .crshader source code at runtime and flags GPU pipeline for recompilation
Updates a uniform parameter dynamically (mirrors ShaderMaterial#set_shader_parameter)
Compiles a specialized GLSL compute permutation using VariantCache