Skip to content

Instantly share code, notes, and snippets.

View Sithdown's full-sized avatar

Sithdown Sithdown

View GitHub Profile
@passivestar
passivestar / Editor.tres
Last active April 10, 2024 20:07
Godot editor theme
[gd_resource type="Theme" load_steps=12 format=3 uid="uid://7bvxnk5n5imx"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_6h42l"]
content_margin_left = 10.5
content_margin_top = 8.75
content_margin_right = 10.5
content_margin_bottom = 8.75
bg_color = Color(0.117647, 0.117647, 0.117647, 1)
draw_center = false
border_color = Color(1, 1, 1, 0.137255)
@HungryProton
HungryProton / depth_override_shader.gdshader
Last active March 29, 2024 12:45
A Godot 4 shader to make things appear on top of other things within a range.
// A Godot 4 shader to make things appear on top of other things within a range.
// Initially, this was made so my characters' facial features would be rendered on top of their hair.
shader_type spatial;
render_mode unshaded;
uniform sampler2D depth_texture : hint_depth_texture, repeat_disable, filter_nearest;
// Maximum depth we can overdraw relative to the object original depth, in ENGINE UNITS.
#if UNIVERSAL_RENDERER
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif
using System;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
using UnityEngine.Experimental.Rendering;
@martymcmodding
martymcmodding / MMPX.fx
Last active May 31, 2023 13:47
McGuire & Mara, MMPX Style-Preserving Pixel Art Magnification, port to ReShade
/*
Copyright 2020 Morgan McGuire & Mara Gagiu.
Provided under the Open Source MIT license https://opensource.org/licenses/MIT
by Morgan McGuire and Mara Gagiu.
*/
/*=============================================================================
ReShade 4 effect file
github.com/martymcmodding
@dorodo95
dorodo95 / GenerateVectorData.cs
Last active July 11, 2023 00:20
Object Smearing via Shader
using UnityEngine;
public class GenerateVectorData : MonoBehaviour
{
private SkinnedMeshRenderer m_mesh;
private Mesh skinnedMeshCache;
private Vector3[] vertexFrameCache1;
private Vector3[] vertexFrameCache2;
private Vector3[] vertexFrameCache3;
private ComputeBuffer vertexBuffer1;
@gekidoslair
gekidoslair / TextureProcessor.cs
Last active April 13, 2020 18:30
Batch apply textures to materials
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
[System.Serializable]
public class MaterialEntry
{
public Material material;
public List<Texture2D> textures;
@LotteMakesStuff
LotteMakesStuff / NetworkingTools.cs
Last active April 28, 2023 09:49
Since Unity 2018.3 we've had this cool new tool called [SettingsProvider] that we can use to add custom settings menu into Unitys settings screens. This short example shows how i use [SettingsProvider] and some [MenuItems] to help build and run test clients when im developing a multiplayer game. My usecase is that i want a quick way to build and…
using System.Collections.Generic;
using System.Diagnostics;
using UnityEditor;
using UnityEditor.Build.Reporting;
using UnityEngine;
using Debug = UnityEngine.Debug;
public static class NetworkingTools
{
@gekidoslair
gekidoslair / ResetParentTransform.cs
Created November 10, 2019 01:07
Quick utility to reset a parent GameObject position to 0,0,0 without screwing up the child positions
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
namespace MWU.Shared.Utilities
{
public static class ResetParentTransform
{
[MenuItem("Tools/Edit/Reset Parent Transform %_r")]
public static void DistributeObjectsEvenly()
@LotteMakesStuff
LotteMakesStuff / LookatTool.cs
Last active November 2, 2023 21:04
In Unity 2019.1 Unity added a new custom EditorTool API, heres some example code showing some tools we could make with it!
using UnityEditor;
using UnityEditor.EditorTools;
using UnityEngine;
[EditorTool("LookAt Tool")]
public class LookatTool : EditorTool
{
GUIContent cachedIcon;
// NOTE: as were caching this, unity will serialize it between compiles! so if we want to test out new looks,
Shader "Custom/Grass Geometry Shader" {
Properties{
[NoScaleOffset] _MainTex("Grass A", 2D) = "white" {}
[NoScaleOffset] _GrassTwo("Grass B", 2D) = "white" {}
_Splat("Splat", 2D) = "white" {}
_Cutoff("Cutoff", Range(0,1)) = 0.25