Skip to content

Instantly share code, notes, and snippets.

using UnityEngine;
using System.Collections;
public class Gismo16to9 : MonoBehaviour {
public void OnDrawGizmos()
{
var camSizeHeight = Camera.main.orthographicSize;
var camSizeWidth = camSizeHeight * 16f / 9f;
var leftUp = new Vector2(-camSizeWidth, camSizeHeight);
Shader "GrayScale" {
Properties
{
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)
[MaterialToggle] PixelSnap ("Pixel snap", Float) = 0
_EffectAmount ("Effect Amount", Range (0, 1)) = 1.0
}
SubShader
@Stals
Stals / latency.markdown
Created June 1, 2012 10:49 — forked from hellerbarde/latency.markdown
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
Read 1 MB sequentially from memory ..... 250,000 ns  = 250 µs

Round trip within same datacenter ...... 500,000 ns = 0.5 ms

@Stals
Stals / about.md
Last active December 11, 2015 11:48 — forked from jasonrudolph/about.md
Shader "Custom/GreyScaleForBackPlay" {
Properties
{
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)
[MaterialToggle] PixelSnap ("Pixel snap", Float) = 0
_EffectAmount ("Effect Amount", Range (0, 1)) = 1.0
}
SubShader
<!DOCTYPE html>
<html lang="en-us">
<head>
<style>
canvas {
width: 100%;
height: 100%;
position: absolute;
}
</style>