Skip to content

Instantly share code, notes, and snippets.

@darktable
darktable / GenerateSceneLoaderMenu.cs
Created July 17, 2023 13:23
Utility script to generate a menu items to load the scenes included in build settings.
// The contents of this file is free and unencumbered software released into the
// public domain. For more information, please refer to <http://unlicense.org/>
using System;
using System.IO;
using System.Text;
using UnityEditor;
using UnityEngine;
using UnityEngine.SceneManagement;
@darktable
darktable / Loggers.cs
Created July 31, 2023 01:47 — forked from thygrrr/Loggers.cs
A zero-boilerplate static logger for Unity in 25 lines of code
//SPDX-License-Identifier: Unlicense OR CC0-1.0+
using System;
using System.Collections.Generic;
using UnityEngine;
using Object = UnityEngine.Object;
// ReSharper disable MemberCanBePrivate.Global
namespace Loggers
{
/// <summary>
@darktable
darktable / SpatialHash.cs
Last active August 29, 2023 13:43
Spatial hash implementation for Unity.
// The contents of this file is free and unencumbered software released into the
// public domain. For more information, please refer to <http://unlicense.org/>
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using UnityEngine;
using UnityEngine.Assertions;
public class SpatialHash<T>
@darktable
darktable / WorldNormalFromDepthTexture.shader
Created November 11, 2023 18:00 — forked from bgolus/WorldNormalFromDepthTexture.shader
Different methods for getting World Normal from Depth Texture, without any external script dependencies.
Shader "WorldNormalFromDepthTexture"
{
Properties {
[KeywordEnum(3 Tap, 4 Tap, Improved, Accurate)] _ReconstructionMethod ("Normal Reconstruction Method", Float) = 0
}
SubShader
{
Tags { "RenderType"="Transparent" "Queue"="Transparent" }
LOD 100