Skip to content

Instantly share code, notes, and snippets.

@lyuma
lyuma / compact_godot_editor_theme.tres
Created October 15, 2023 21:27
Editor theme for Godot 4 which makes the inspector and tree view compact, removing unnecessary spaces between items.
[gd_resource type="Theme" load_steps=32 format=3]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_fnqu7"]
content_margin_left = 4.0
content_margin_top = 1.0
content_margin_right = 4.0
content_margin_bottom = 1.0
bg_color = Color(0.1, 0.1, 0.1, 0.3)
corner_radius_top_left = 3
corner_radius_top_right = 3
@lyuma
lyuma / resource_parser.gd
Created August 21, 2023 15:48
Validates a given Godot 4 resource file for embedded Resource types or references to external file paths.
# resource_parser.gd for Godot 4.0
# Copyright (c) 2023 Lyuma <xn.lyuma@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
// WIP Godot port. Lighting function not yet implemented. Clouds need #define and are not transparent.
/*
MIT License
Godot Port Copyright (c) 2022 Lyuma
Copyright (c) 2022 SCRN-VRC
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
/*************************************************************************/
/* default_godot_light_function.gdshader */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2022 Godot Engine contributors (cf. AUTHORS.md). */
/* */
@lyuma
lyuma / SimpleOSC.gd
Created February 24, 2022 05:55
Simple single-file OSC library for GDScript 4.0a with all base and extended types defined in OSC 1.1, bundle support and an integrated UDP sender and receiver.
# SimpleOSC for Godot 4.0 alpha3 , version 0.1
# Copyright (c) 2022 Lyuma <xn.lyuma@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
@lyuma
lyuma / SimpleOSC.cs
Created February 24, 2022 05:45
Simple single-file OSC library with all base and extended types defined in OSC 1.1, bundle support and an integrated UDP sender and receiver.
/* SimpleOSC for C#, version 0.1
Copyright (c) 2022 Lyuma <xn.lyuma@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@lyuma
lyuma / endif_colors.py
Created January 29, 2022 22:06
Indents and colorizes lines based on the number of levels of preprocessor if statements
# Copyright 2021 Lyuma
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
@lyuma
lyuma / SimpleParallax.shader
Created April 19, 2021 15:13
Simple parallax Unity surface shader using tangent space constructed in the vertex shader.
Shader "Custom/SimpleParallax"
{
Properties
{
_Color ("Color", Color) = (1,1,1,1)
_MainTex ("Albedo (RGB)", 2D) = "white" {}
_Glossiness ("Smoothness", Range(0,1)) = 0.5
_Metallic ("Metallic", Range(0,1)) = 0.0
_Parallax ("Height Scale", Range (0.005, 0.08)) = 0.02
_ParallaxMap ("Height Map", 2D) = "black" {}
@lyuma
lyuma / VRMChecker.cs
Created March 3, 2021 12:58
Prints out pre- and post- quaternion values from Unity's Humanoid Avatar
// MIT License
// Copyright (c) 2021 Lyuma <xn.lyuma@gmail.com> and lox9973
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@lyuma
lyuma / rounded_trail_shaded.shader
Last active March 30, 2021 11:47
Rounded shader for a Unity Particle Trails and TrailRenderer, with shading.
// VERSION 0.3.1. Please get the latest version from:
// https://gist.github.com/lyuma/744e7fe35f7758add2f4468bb12f87f1
// Lyuma's Rounded Trail with Shading
// Based on phi16's rounded trail
// Based on Xiexe's Unity Lit Shader Templates:
// https://github.com/Xiexe/Unity-Lit-Shader-Templates
// Installation Notes:
// YOU MUST COPY ALL OF THE .cginc FILES FROM