Skip to content

Instantly share code, notes, and snippets.

@maxattack
maxattack / DualQuaternion.cs
Created November 18, 2018 22:44
Dual Quaternion Sample Implementation for Unity3D
using UnityEngine;
/*
Dual-Quaternions are an alternate encoding for rigid transforms (translation + rotation),
with the special property that linear combinations will "arc" the translation in response
to rotation, producing a skinning interpolation that prevents the kind of collapsing you
get from simple linear interpolation of translations in their native coordinates.
Copyright (c) 2018 Max Kaufmann
// Shader created with Shader Forge v1.38
// Shader Forge (c) Neat Corporation / Joachim Holmer - http://www.acegikmo.com/shaderforge/
// Note: Manually altering this data may prevent you from opening it in Shader Forge
/*SF_DATA;ver:1.38;sub:START;pass:START;ps:flbk:,iptp:0,cusa:False,bamd:0,cgin:,lico:1,lgpr:1,limd:1,spmd:1,trmd:0,grmd:0,uamb:True,mssp:True,bkdf:False,hqlp:False,rprd:False,enco:False,rmgx:True,imps:True,rpth:0,vtps:0,hqsc:True,nrmq:1,nrsp:0,vomd:0,spxs:False,tesm:0,olmd:1,culm:0,bsrc:0,bdst:1,dpts:2,wrdp:True,dith:0,atcv:False,rfrpo:True,rfrpn:Refraction,coma:15,ufog:True,aust:True,igpj:False,qofs:0,qpre:2,rntp:3,fgom:False,fgoc:False,fgod:False,fgor:False,fgmd:0,fgcr:1,fgcg:1,fgcb:1,fgca:1,fgde:0.01,fgrn:5,fgrf:15,stcl:False,atwp:False,stva:128,stmr:255,stmw:255,stcp:6,stps:0,stfa:0,stfz:0,ofsf:0,ofsu:0,f2p0:False,fnsp:False,fnfb:False,fsmp:False;n:type:ShaderForge.SFN_Final,id:4904,x:33076,y:32617,varname:node_4904,prsc:2|diff-5996-OUT,clip-8651-A;n:type:ShaderForge.SFN_Color,id:848,x:32
anonymous
anonymous / xBRx2.shader
Created November 4, 2017 17:30
Shader version of xBRx2 filtering for pixel art in Shaderlab format (for Unity 2017)
// Originally from:
// https://gamedev.stackexchange.com/questions/87275/how-do-i-perform-an-xbr-or-hqx-filter-in-xna
// Tweaked for Shaderlab by twitter.com/yankooliveira
// (Having almost no idea what he was doing)
Shader "Custom/xBRx2" {
Properties {
_PixelTexture ("Texture to filter (RGB)", 2D) = "white" {}
texture_size ("Pixel Texture Size", Vector) = (16,16,0,0)
}
/**
* Author: David Asmuth
* Contact: piranha771@gmail.com
* License: Public domain
*
* Converts the .fbx model
* from Blender orientation system (Z is up, Y is forward)
* to the Unity3D orientation system (Y is up, Z is forward)
*/
using System.IO;
@JavadocMD
JavadocMD / CompileIndicator.cs
Last active July 21, 2025 21:17
A Unity script to play a sound effect when script compiling starts and ends.
using System;
using System.Reflection;
using UnityEditor;
using UnityEngine;
// I recommend dropping this script in an Editor folder.
// You should have two audio clips somewhere in the project.
// You'll need to edit-in the paths of those clips (from your project root folder) in the static initializer below.
// Example path: "Assets/Editor/CompileIndicator/start.mp3"
using UnityEditor;
using UnityEngine;
/// <summary>
/// Made by Rodrigo Diaz
/// http://www.rodrigos.work
/// This code is licensed under MIT license
///
/// Make sure to add this class under a folder named "Editor" in the Unity Project
///