Skip to content

Instantly share code, notes, and snippets.

@PopupAsylum
PopupAsylum / ShaderExposure.shader
Last active January 29, 2017 21:04
Applies the exposure of Exposure.cs
//Apply exposure
o.vColor.rgb *= _PA_Exposure;
//Uncharted 2 tonemapping curve http://filmicgames.com/archives/75
o.vColor.rgb =((o.vColor.rgb*(0.15*o.vColor.rgb + 0.10*0.50) + 0.20*0.02) / (o.vColor.rgb*(0.15*o.vColor.rgb + 0.50) + 0.20*0.30)) - 0.02 / 0.30;
@PopupAsylum
PopupAsylum / SymbolicProjectMenu.cs
Created September 23, 2016 14:23
Adds a menu option to create a copy of the current Unity project using symbolic links, Windows only, usually needs admin
using UnityEngine;
using UnityEditor;
using System.Collections;
using System.Runtime.InteropServices;
internal static class SymbolicLink {
#if UNITY_EDITOR_WIN
[DllImport("kernel32.dll", SetLastError = true)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool CreateSymbolicLink(string lpSymlinkFileName, string lpTargetFileName, SymLinkFlag dwFlags);
@PopupAsylum
PopupAsylum / CustomFramer.cs
Created January 24, 2017 11:41
Change how unity's 'F' framing is applied
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif
public class CustomFramer : MonoBehaviour {
public float radius = 1f;
@PopupAsylum
PopupAsylum / PreviewCulling.cs
Created September 23, 2016 08:45
When attached to a Camera, shows that cameras frustum culling in the scene view
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif
using System.Collections;
[ExecuteInEditMode]
public class PreviewCulling : MonoBehaviour {
#if UNITY_EDITOR