Skip to content

Instantly share code, notes, and snippets.

View forestrf's full-sized avatar

Andrés Leone Gámez forestrf

View GitHub Profile
@Fewes
Fewes / PixelDot.shader
Last active May 12, 2021 04:38
Renders a screen-aligned, distance-independent, resolution-independent, pixel-perfect quad in Unity. Use it with the built-in quad mesh. You don't have to rotate or scale the mesh renderer, the shader will take care of it.
Shader "FX/PixelDot"
{
Properties
{
[NoScaleOffset] _MainTex ("Texture", 2D) = "white" {}
_Color ("Color", Color) = (1, 1, 1, 1)
_Size ("Pixel Size", Range(1, 64)) = 1
}
SubShader
{
@Refsa
Refsa / GrabScreenFeature.cs
Last active November 3, 2025 09:23
Unity URP custom grab pass
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
public class GrabScreenFeature : ScriptableRendererFeature
{
[System.Serializable]
public class Settings
@LaneF
LaneF / DefineSymbolUtil.cs
Last active March 30, 2025 16:46
Unity Define Symbols Utility
using System.Text;
using UnityEditor;
using UnityEngine;
namespace Cleverous
{
public static class DefineSymbolUtil
{
public const string Symbol = "YOUR_DEFINE_SYMBOL";
@Fewes
Fewes / Tricubic.cginc
Last active September 3, 2025 10:38
Tricubic texture sampling using 8 trilinear samples
#ifndef TRICUBIC_INCLUDED
#define TRICUBIC_INCLUDED
float4 Cubic(float v)
{
float4 n = float4(1.0, 2.0, 3.0, 4.0) - v;
float4 s = n * n * n;
float x = s.x;
float y = s.y - 4.0 * s.x;
float z = s.z - 4.0 * s.y + 6.0 * s.x;
@vikpe
vikpe / fix_authenticity_of_github_problem.md
Last active December 3, 2025 11:38
FIX: The authenticity of host github.com can't be established.

Error

The authenticity of host 'github.com (140.82.113.4)' can't be established.

Fix

ssh-keyscan github.com >> ~/.ssh/known_hosts
@JoseEmilio-ARM
JoseEmilio-ARM / GPUOptimizationForGames.md
Last active December 29, 2025 08:27 — forked from silvesthu/GPUOptimizationForGameDev.md
GPU Optimization for Games
@NovemberDev
NovemberDev / BehaviourTree.cs
Last active March 11, 2021 10:37
C# Behaviour Tree
using System;
using System.Linq;
using System.Collections.Generic;
public enum BehaviourTreeState
{
Success,
Failure,
Running
}
@andreiagmu
andreiagmu / FastPlatformSwitcher.cs
Last active June 19, 2024 07:26
Improved FastPlatformSwitcher for Unity 2018 (and maybe other Unity versions), for Asset Database v1
// Improved FastPlatformSwitcher for Unity 2018 (and maybe other Unity versions)
// For Asset Database v1
// by Andy Miira (Andrei Müller), October 2019
//
// Based on:
// Unity – fast build platform switcher script! (by Aymeric - Da Viking Code)
// https://davikingcode.com/blog/unity-fast-build-platform-switcher-script/
//
// A simple fast platform switcher for Unity (by Waldo Bronchart)
// https://gist.github.com/waldobronchart/b3cb789c028c199e2855
@roguesleipnir
roguesleipnir / ShaderOccurence.cs
Last active August 2, 2022 11:18
Material/Shader reference searcher. Find materials that use a shader by name string. Find materials with missing shader or errors. Original snippet from https://answers.unity.com/questions/510945/find-materials-that-use-a-certain-shader.html
using UnityEngine;
using UnityEditor;
using System.Collections.Generic;
using System.IO;
//https://answers.unity.com/questions/510945/find-materials-that-use-a-certain-shader.html
public class ShaderOccurenceWindow : EditorWindow {
[MenuItem ("Tools/Shader Occurence")]
public static void Open () {