Skip to content

Instantly share code, notes, and snippets.

View maidopi-usagi's full-sized avatar
🐇

MaidOpi maidopi-usagi

🐇
View GitHub Profile
@maidopi-usagi
maidopi-usagi / ImExt.cs
Created June 30, 2025 15:49
ImGui C# 0GC interpolator
using System.Buffers;
using System.Numerics;
using System.Runtime.CompilerServices;
using Utf8StringInterpolation;
using Hexa.NET.ImGui;
[InterpolatedStringHandler]
public ref struct ImGuiGeneralTextHandler
{
private Utf8StringWriter<ArrayBufferWriter<byte>> _writer;
@maidopi-usagi
maidopi-usagi / subemitter_example.tscn
Last active June 8, 2025 14:06
Godot SubEmitter example
[gd_scene load_steps=9 format=3 uid="uid://djnfyqm1dgdud"]
[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_xlglh"]
sky_horizon_color = Color(0.662243, 0.671743, 0.686743, 1)
ground_horizon_color = Color(0.662243, 0.671743, 0.686743, 1)
[sub_resource type="Sky" id="Sky_crest"]
sky_material = SubResource("ProceduralSkyMaterial_xlglh")
[sub_resource type="Environment" id="Environment_axu21"]
@maidopi-usagi
maidopi-usagi / GodotDynamicExtensions.cs
Created June 7, 2025 17:50
GodotObject / Dictionary / Array to ExpandoObject
using Godot;
using System.Dynamic;
using Godot.Collections;
public static class GodotDynamicExtensions
{
public static ExpandoObject ToExpandoObject(this Dictionary godotDict)
{
var expando = new ExpandoObject();
var expandoDict = (IDictionary<string, object>)expando;
@maidopi-usagi
maidopi-usagi / GodotDictionaryExtensions.cs
Created June 7, 2025 17:18
Godot Dictionary To ExpandoObject
using System.Dynamic;
using Godot;
using Godot.Collections;
public static class GodotDictionaryExtensions
{
public static ExpandoObject ToExpandoObject(this Dictionary godotDict)
{
var expando = new ExpandoObject();
var expandoDict = (IDictionary<string, object>)expando;
@maidopi-usagi
maidopi-usagi / outline_atlas.gdshader
Created January 1, 2025 17:37
Godot AtlasTexture Outline Shader
shader_type canvas_item;
const vec2 VERTICES[4] = vec2[](vec2(0.0),vec2(0.0,1.0),vec2(1.0),vec2(1.0,0.0));
varying vec2 originalUV;
varying flat vec4 regionInfo;
uniform int outline_size:hint_range(0,10) = 1;
uniform vec4 outline_color:source_color = vec4(1.0);
void vertex() {