This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
<!DOCTYPE html> | |
<html lang="en-us"> | |
<head> | |
<style> | |
canvas { | |
width: 100%; | |
height: 100%; | |
position: absolute; | |
} | |
</style> |
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 |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
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
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 |
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); |