Skip to content

Instantly share code, notes, and snippets.

View leegoonz's full-sized avatar

jplee leegoonz

View GitHub Profile
@leegoonz
leegoonz / LightProbeRebuilder.cs
Created February 23, 2016 13:08 — forked from keijiro/LightProbeRebuilder.cs
Extracts SH coefficients from light probes, and rebuilds light probes from given SH coefficients.
using UnityEngine;
using UnityEditor;
using System.Collections;
public class LightProbeRebuilderWindow : EditorWindow
{
string text = "Paste extracted coefficients here.";
float multiplier = 1.0f;
[MenuItem("Window/Light Probe Rebuilder")]
/*
optimized-ggx.glsl
This file describes several optimizations you can make when creating a GGX shader.
AUTHOR: John Hable
LICENSE:
This is free and unencumbered software released into the public domain.
@leegoonz
leegoonz / CustomEditorBase.cs
Created March 25, 2016 08:26 — forked from t0chas/CustomEditorBase.cs
Default Custom Inspector-Editor for Unity3D with ReorderableLists for arrays handling
using UnityEngine;
using UnityEditor;
using UnityEditorInternal;
using System.Collections.Generic;
using UnityEditor.AnimatedValues;
[CustomEditor(typeof(UnityEngine.Object), true, isFallback = true)]
[CanEditMultipleObjects]
public class CustomEditorBase : Editor
{
@leegoonz
leegoonz / FGlowShader.cs
Created April 19, 2016 08:16 — forked from jpsarda/FGlowShader.cs
A Glow CG shader for Futile (Unity 3D)
public class FGlowShader : FShader
{
private float _glowAmount;
private Color _glowColor;
public FGlowShader(float glowAmount,Color glowColor) : base("GlowShader", Shader.Find("Futile/Glow"))
{
_glowAmount = glowAmount;
_glowColor = glowColor;
needsApply = true;
Shader "Volund/Standard Scatter (Metallic, Surface)" {
Properties {
_Color("Color", Color) = (1,1,1,1)
_MainTex("Albedo", 2D) = "white" {}
_Cutoff("Alpha Cutoff", Range(0.0, 1.0)) = 0.5
_Glossiness("Smoothness", Range(0.0, 1.0)) = 0.5
[Gamma] _Metallic("Metallic", Range(0.0, 1.0)) = 0.0
_MetallicGlossMap("Metallic", 2D) = "white" {}
@leegoonz
leegoonz / UnityStandardBRDF.cginc
Created August 17, 2016 05:30 — forked from xDavidLeon/UnityStandardBRDF.cginc
UnityStandardBRDF modification for Cel Shading.
#ifndef UNITY_STANDARD_BRDF_INCLUDED
#define UNITY_STANDARD_BRDF_INCLUDED
#include "UnityCG.cginc"
#include "UnityStandardConfig.cginc"
#include "UnityLightingCommon.cginc"
//-------------------------------------------------------------------------------------
// Legacy, to keep backwards compatibility for (pre Unity 5.3) custom user shaders:
#define unity_LightGammaCorrectionConsts_PIDiv4 (IsGammaSpace()? (UNITY_PI/4)*(UNITY_PI/4): (UNITY_PI/4))
@leegoonz
leegoonz / UnlitCastShadow.shader
Created August 22, 2016 16:59 — forked from sugi-cho/UnlitCastShadow.shader
ShadowCastの使い方
Shader "Unlit/UnlitCastShadow"
{
Properties
{
_MainTex("Texture", 2D) = "white" {}
}
CGINCLUDE
#include "UnityCG.cginc"
struct appdata
@leegoonz
leegoonz / Debug.cs
Created August 31, 2016 17:50 — forked from kimsama/Debug.cs
It overrides UnityEngine.Debug to mute debug messages completely on a platform-specific basis. [Edit] Added isDebugBuild property.
//#if UNITY_EDITOR
//#define DEBUG
//#endif
using UnityEngine;
using System.Collections;
using System;
using System.IO;
using System.Text.RegularExpressions;
using UnityEngineInternal;
@leegoonz
leegoonz / ComputeOcclusionFromDepth.shader
Created October 31, 2016 13:18 — forked from aras-p/ComputeOcclusionFromDepth.shader
Unity command buffer that modifies screenspace shadow mask
Shader "Hidden/ComputeOcclusion"
{
Properties
{
_MainTex ("", 2D) = "white" {}
}
SubShader
{
Pass
{
@leegoonz
leegoonz / SkinnedMeshObjectPreviewExample.cs
Created January 18, 2017 13:18 — forked from radiatoryang/SkinnedMeshObjectPreviewExample.cs
An example of a custom ObjectPreview rendering out a SkinnedMesh for Unity Editor C#... I used it for facial expressions and blendshape editing, you might want to use it for something else. I hereby place it under MIT License. Full write-up here: http://www.blog.radiator.debacle.us/2016/06/working-with-custom-objectpreviews-and.html
using UnityEngine;
using UnityEditor;
using System;
using System.Collections;
[CustomPreview(typeof(YourCustomScriptableObject))] // THIS IS VERY IMPORTANT, this is so the editor knows what this is supposed to be previewing at all
public class SkinnedMeshObjectPreviewExample : ObjectPreview {
PreviewRenderUtility m_PreviewUtility;