Skip to content

Instantly share code, notes, and snippets.

View OwenMagelssen's full-sized avatar

Owen Magelssen OwenMagelssen

View GitHub Profile
@bgolus
bgolus / InfiniteGrid.shader
Last active June 12, 2024 18:15
Infinite Grid shader with procedural grid with configurable divisions and major and minor lines markings.
Shader "Unlit/InfiniteGrid"
{
Properties
{
[Toggle] _WorldUV ("Use World Space UV", Float) = 1.0
_GridScale ("Grid Scale", Float) = 1.0
_GridBias ("Grid Bias", Float) = 0.5
_GridDiv ("Grid Divisions", Float) = 10.0
_BaseColor ("Base Color", Color) = (0,0,0,1)
_LineColor ("Line Color", Color) = (1,1,1,1)
@SnowyMouse
SnowyMouse / halo-map-structure.tex
Last active May 31, 2024 12:21
Halo Map Structure
\documentclass[12pt,oneside]{article}
\renewcommand{\familydefault}{\sfdefault}
\usepackage[a4paper,margin=1in]{geometry}
\usepackage{hyperref}
\usepackage[utf8]{inputenc}
\usepackage[none]{hyphenat}
\usepackage{tabularx}
\usepackage{emoji}
\usepackage[document]{ragged2e}
\usepackage{xspace}
@Ragueel
Ragueel / Mesh Helper C#
Created August 17, 2020 07:37
For subdividing meshes in Unity
public class MeshHelper
{
static List<Vector3> vertices;
static List<Vector3> normals;
// [... all other vertex data arrays you need]
static List<int> indices;
static Dictionary<uint, int> newVectices;
@simonbroggi
simonbroggi / MainLightNode.hlsl
Last active May 14, 2024 14:09
Unity Shadergraph custom function node for main light data
#ifndef MAINLIGHT_INCLUDED
#define MAINLIGHT_INCLUDED
void GetMainLightData_float(out half3 direction, out half3 color, out half distanceAttenuation, out half shadowAttenuation)
{
#ifdef SHADERGRAPH_PREVIEW
// In Shader Graph Preview we will assume a default light direction and white color
direction = half3(-0.3, -0.8, 0.6);
color = half3(1, 1, 1);
distanceAttenuation = 1.0;
@mattatz
mattatz / Matrix.hlsl
Last active July 2, 2024 13:45
Matrix operations for HLSL
#ifndef __MATRIX_INCLUDED__
#define __MATRIX_INCLUDED__
#define IDENTITY_MATRIX float4x4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)
float4x4 inverse(float4x4 m) {
float n11 = m[0][0], n12 = m[1][0], n13 = m[2][0], n14 = m[3][0];
float n21 = m[0][1], n22 = m[1][1], n23 = m[2][1], n24 = m[3][1];
float n31 = m[0][2], n32 = m[1][2], n33 = m[2][2], n34 = m[3][2];
float n41 = m[0][3], n42 = m[1][3], n43 = m[2][3], n44 = m[3][3];
@phi-lira
phi-lira / UniversalPipelineTemplateShader.shader
Last active June 15, 2024 02:13
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
@tomkail
tomkail / ExtendedScriptableObjectDrawer.cs
Last active July 1, 2024 03:14
Displays the fields of a ScriptableObject in the inspector
// Developed by Tom Kail at Inkle
// Released under the MIT Licence as held at https://opensource.org/licenses/MIT
// Must be placed within a folder named "Editor"
using System;
using System.Reflection;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
@dhilowitz
dhilowitz / wavecuepoint.c
Last active April 29, 2023 22:01 — forked from jimmcgowan/wavecuepoint.c
This code reads a .wav file and a text file containing marker locations (specified as frame indexes, one per line) and creates a new .wav file with embedded cue points for each location. The code is standard, portable C.
//
// wavecuepoint.c
// Created by Jim McGowan on 29/11/12.
// Turned into command-line utility by David Hilowitz on 19/11/16.
// jim@bleepsandpops.com
// jim@malkinware.com
//
// This function reads a .wav file and a text file containing marker locations (specified as frame indexes, one per line)
// and creates a new .wav file with embedded cue points for each location. The code is standard, portable C.
//
@andreibosco
andreibosco / creative-cloud-disable.md
Last active June 26, 2024 09:36
disable creative cloud startup on mac
@TarasOsiris
TarasOsiris / DumpEditorTextures.cs
Last active February 15, 2023 10:07
Dump all Unity3d Editor GUI skin textures as images
using UnityEngine;
using System.IO;
using UnityEditor;
public static class DumpEditorTextures
{
const string AssetsFolder = "Assets";
const string TexturesDestFolderNamePro = "TexturesPro";
const string TexturesDestFolderNameNormal = "TexturesNormal";
static readonly string TexturesDestPathPro = Path.Combine(AssetsFolder, TexturesDestFolderNamePro);