Skip to content

Instantly share code, notes, and snippets.

@NickDiMucci
NickDiMucci / unityBuildWindows.bat
Created August 25, 2014 14:30
Script to automate build the Windows player of a Unity project, and committing build to a git repo.
@echo off
set PROJECT=-projectPath
set PROJECT_PATH="C:\path\to\your\Unity\project"
set WIN_PATH="C:\path\to\your\game.exe"
@REM Common options
set BATCH=-batchmode
set QUIT=-quit
@aras-p
aras-p / foo.md
Last active October 7, 2025 16:28
Controlling fixed function states from materials/scripts in Unity

(typing off the top of my head, might not compile)

Since Unity 4.3:

In the shader, instead of writing Cull Off, write Cull [_MyCullVariable], the value will be fetched from the material or global float/int variable _MyCullVariable then.

You could have it be part of material, e.g. inside Properties block:

[Enum(Off,0,Front,1,Back,2)] _MyCullVariable ("Cull", Int) = 1
@mdo
mdo / 00-intro.md
Last active April 17, 2026 15:37
Instructions for how to affix an Ikea Gerton table top to the Ikea Bekant sit-stand desk frame.

Ikea Bekant standing desk with Gerton table top

@EddieCameron
EddieCameron / EdgeDetect.cs
Created September 3, 2017 00:08
EdgeDetection in new Unity Postprocessing Stack
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering.PostProcessing;
[Serializable]
[PostProcess( typeof( EdgeDetectRenderer ), PostProcessEvent.BeforeStack, "Custom/EdgeDetectNormals" )]
public sealed class EdgeDetect : PostProcessEffectSettings {
public enum EdgeDetectMode {
@phi-lira
phi-lira / UniversalPipelineTemplateShader.shader
Last active April 29, 2026 02:38
Template shader to use as guide to create Universal Pipeline ready shaders. This shader works with Universal Render Pipeline 7.1.x and above.
// When creating shaders for Universal Render Pipeline you can you the ShaderGraph which is super AWESOME!
// However, if you want to author shaders in shading language you can use this teamplate as a base.
// Please note, this shader does not necessarily match perfomance of the built-in URP Lit shader.
// This shader works with URP 7.1.x and above
Shader "Universal Render Pipeline/Custom/Physically Based Example"
{
Properties
{
// Specular vs Metallic workflow
[HideInInspector] _WorkflowMode("WorkflowMode", Float) = 1.0
@Split82
Split82 / UnityShadersCheatSheet.shader
Created April 17, 2018 10:07
Unity Shaders Cheat Sheet
Shader "Name" {
Properties {
_Name ("display name", Range (min, max)) = number
_Name ("display name", Float) = number
_Name ("display name", Int) = number
_Name ("display name", Color) = (number,number,number,number)
_Name ("display name", Vector) = (number,number,number,number)
@HAliss
HAliss / TextureCombiner.cs
Last active January 8, 2023 21:08
Texture combiner for Unity 3D
using System.Collections;
using System.Collections.Generic;
using System.IO;
using UnityEditor;
using UnityEngine;
public class TextureCombiner : EditorWindow {
//Input textures
private Texture2D[] textures = new Texture2D[4];
@jeffvella
jeffvella / ProfilerMarker.cs
Last active May 11, 2020 21:21
How to add burst job timing to the profiler.
public unsafe class JobTestSystem : JobComponentSystem
{
private ProfilerMarker _marker;
protected override void OnCreateManager()
{
_marker = new ProfilerMarker("Job1z");
}
protected override JobHandle OnUpdate(JobHandle inputDeps)
@eviltester
eviltester / gist:11093f0e4c501a41990e227393184eda
Last active February 24, 2026 13:58
uncheck twitter interests
var timer=100;document.querySelectorAll("div > input[type='checkbox']:checked").forEach((interest) => {setTimeout(function(){interest.click()},timer);timer+=2000;});
@MagistrAVSH
MagistrAVSH / URP-VertexLit.shader
Last active October 12, 2024 02:00
UniversalRenderingPipeline VertexLit Shader
Shader "Universal Render Pipeline/Custom/VertexLit"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_Gain ("Gain", Float) = 1.5
_Color ("Color", Color) = (1,1,1,1)
_EdgeColor ("Edge Color", Color) = (0,0,0,1)
[Toggle] _RemoveDiag("Remove diagonals", Float) = 0.