Skip to content
Eduard Gushchin edited this page Jun 24, 2026 · 5 revisions

Home | API by Category | Complete API Index | API Compatibility

Field Value
Full name Electron2D.Shader
Namespace Electron2D
Kind class
Category Rendering

Overview

Provides the Electron2D resource for a canvas shader source.

Syntax

public sealed class Electron2D.Shader : Electron2D.Resource

Godot 4.7 C# profile compatibility

Profile: Electron2D 0.1.0 2D
Status: Partial / Not verified
Out of profile: yes
Godot reference: Shader

Canvas item shader resource storing source code for import-time compilation.

Remarks

Shader stores source code that is imported by Electron2D tooling into compiled canvas shader stages. Electron2D 0.1.0 Preview supports only the canvas item mode.

ShaderMaterial, uniforms and sampler assignment are implemented by later tasks. This type intentionally does not expose the shader compiler backend or the native GPU backend handles.

Thread Safety

This type is not synchronized. Mutate shader code on the main thread or in a single import worker.

Since

This type is available since Electron2D 0.1.0 Preview.

Members

Member Kind Summary
Code Property Gets or sets the shader source code.
Electron2D.Shader() Constructor Initializes a new instance of the Shader type.
GetMode() Method Gets the shader mode.

Member Details

Code

Kind: Property

public System.String Code { get; set; }

Summary

Gets or sets the shader source code.

Remarks

The source is stored as written by the user. Import tooling parses the shader_type canvas_item;, vertex_entry and fragment_entry header directives before sending HLSL to the shader compiler backend.

Value

The current code value.

Thread Safety

This property is not synchronized. Mutate it on the main thread or in a single import worker.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Shader

Electron2D.Shader()

Kind: Constructor

public Electron2D.Shader()

Summary

Initializes a new instance of the Shader type.

Remarks

The new instance follows the lifetime and validation rules of its declaring type.

Thread Safety

This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.

Since

This API is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Shader

GetMode()

Kind: Method

public Electron2D.Shader.Mode GetMode()()

Summary

Gets the shader mode.

Remarks

This method follows the validation and lifetime rules of its declaring type.

Returns

Electron2D.Shader.Mode.CanvasItem, the only supported shader mode in Electron2D 0.1.0 Preview.

Thread Safety

This method is safe to call from any thread when the shader is not being mutated concurrently.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Shader

Clone this wiki locally